本文整理汇总了C#中CustomList.Find方法的典型用法代码示例。如果您正苦于以下问题:C# CustomList.Find方法的具体用法?C# CustomList.Find怎么用?C# CustomList.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomList
的用法示例。
在下文中一共展示了CustomList.Find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ddlReportList_SelectedIndexChanged
protected void ddlReportList_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
chkIndividual.Checked = false;
chkDirector.Checked = false;
chkOptional.Checked = false;
MailSetupList = manager.GetAllMailSetup(Convert.ToInt32(ddlReportList.SelectedValue));
API.DAO.MailSetup masterInfo = MailSetupList.Find(f=>f.IsIndividual || f.IsDirector || f.IsOptional || f.Subject.IsNotNullOrEmpty() || f.FileName.IsNotNullOrEmpty() || f.Body.IsNotNullOrEmpty());
if (masterInfo.IsNotNull())
{
chkIndividual.Checked = masterInfo.IsIndividual;
chkDirector.Checked = masterInfo.IsDirector;
chkOptional.Checked = masterInfo.IsOptional;
txtSubject.Text = masterInfo.Subject;
txtFileName.Text = masterInfo.FileName;
txtBody.Text = masterInfo.Body;
chkSubject.Checked = masterInfo.IsSubjectYM;
chkFileName.Checked = masterInfo.IsFileNameYM;
}
}
catch (Exception ex)
{
throw (ex);
}
}
示例2: LoadFilterTable
//
public void LoadFilterTable(DataColumnCollection dcCollection)
{
filterSetList = new CustomList<FilterSets>();
FilterSets newFilter;
RDLColumn rc;
foreach (RDLParameter rp in Parameters)
{
newFilter = new FilterSets();
string[] items = rp.Name.Split('_');
if (items.Length == 2)
{
newFilter.ColumnName = items[0];
newFilter.Caption = "*";
}
else
{
newFilter.ColumnName = rp.Name;
}
newFilter.DataType = rp.DbType.ToString();
newFilter.TableName = "Parameter";
newFilter.OrAnd = "And";
newFilter.Operators = "=";
//newFilter.Caption = "***";
newFilter.IsParameter = true;
filterSetList.Add(newFilter);
}
foreach (DataColumn dc in dcCollection)
{
rc = Fields.Find(item => item.Name == dc.ColumnName);
if (rc.IsNotNull())
{
if (filterSetList.Find(item => item.ColumnName == dc.ColumnName && (item.TableName == "Parameter" || item.TableName == rc.TableName)).IsNull())
{
newFilter = new FilterSets();
newFilter.ColumnName = rc.Name;
newFilter.DataType = rc.DataType;
newFilter.TableName = rc.TableName;
newFilter.OrAnd = "And";
newFilter.Operators = "=";
newFilter.IsParameter = false;
filterSetList.Add(newFilter);
}
}
}
//foreach (String tableName in BodyTablesName)
//{
// //Expression
// newFilter = new FilterSets();
// newFilter.ColumnName = "Expression";
// newFilter.DataType = "Expression";
// newFilter.TableName = tableName;
// newFilter.OrAnd = "And";
// newFilter.Operators = "=";
// newFilter.IsParameter = false;
// filterSetList.Add(newFilter);
//}
}
示例3: SaveContactInfo
public void SaveContactInfo(ref CustomList<ContactInfo> ContactInfoList, ref CustomList<ContactType> ContactTypeList, ref CustomList<ContactTypeChild> ContactTypeChildList, ref CustomList<ContactDetail> lstContactDetail)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
Boolean blnTranStarted = false;
try
{
conManager.BeginTransaction();
ReSetSPName(ContactInfoList, ContactTypeList, ContactTypeChildList);
Int32 contactID = ContactInfoList[0].ContactID;
blnTranStarted = true;
if (ContactInfoList[0].IsAdded)
{
contactID = Convert.ToInt32(conManager.InsertData(blnTranStarted, ContactInfoList));
ContactInfoList[0].ContactID = contactID;
}
else
conManager.SaveDataCollectionThroughCollection(blnTranStarted, ContactInfoList);
foreach (ContactType cT in ContactTypeList)
{
CustomList<ContactType> ContactType_List = new CustomList<ContactType>();
if (cT.IsAdded)
{
Int32 contactTypeID = 0;
ContactType_List.Add(cT);
ContactType_List.InsertSpName = "spInsertContactType";
contactTypeID = Convert.ToInt32(conManager.InsertData(blnTranStarted, ContactType_List));
cT.ContactTypeID = contactTypeID;
}
if (cT.IsModified)
{
cT.SetModified();
ContactType_List.Add(cT);
ContactType_List.UpdateSpName = "spUpdateContactType";
conManager.SaveDataCollectionThroughCollection(blnTranStarted, ContactType_List);
}
}
CustomList<ContactDetail> ContactDetailList = new CustomList<ContactDetail>();
foreach (ContactType cT in ContactTypeList)
{
if (cT.IsChecked)
{
ContactDetail contactDetail = new ContactDetail();
contactDetail.ContactTypeID = cT.ContactTypeID;
contactDetail.ContactID = contactID;
ContactDetailList.Add(contactDetail);
}
}
foreach (ContactDetail cD in lstContactDetail)
{
ContactDetail obj = ContactDetailList.Find(f => f.ContactTypeID == cD.ContactTypeID);
if (obj.IsNotNull())
obj.SetModified();
else
{
cD.Delete();
ContactDetailList.Add(cD);
}
}
ReSetSPName(ContactDetailList);
conManager.SaveDataCollectionThroughCollection(blnTranStarted, ContactDetailList);
ContactInfoList.AcceptChanges();
ContactTypeList.AcceptChanges();
ContactTypeChildList.AcceptChanges();
ContactDetailList.AcceptChanges();
conManager.CommitTransaction();
blnTranStarted = false;
}
catch (Exception Ex)
{
conManager.RollBack();
throw Ex;
}
finally
{
if (conManager.IsNotNull())
{
conManager.Dispose();
}
}
}