Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack.IsFalse())
     {
         InitializeSession();
         PopulateDropdown();
     }
     else
     {
         Page.ClientScript.GetPostBackEventReference(this, String.Empty);
         String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
         if (Request["__EVENTTARGET"] == "SearchContactInfo")
         {
             ContactInfoList = new CustomList <ContactInfo>();
             ContactInfo searchContactInfo = Session[STATIC.StaticInfo.SearchSessionVarName] as ContactInfo;
             ContactInfoList.Add(searchContactInfo);
             if (searchContactInfo.IsNotNull())
             {
                 PopulateContactInfo(searchContactInfo);
                 ContactDetailList = manager.GetAllContactDetail(searchContactInfo.ContactID);
                 foreach (ContactDetail cD in ContactDetailList)
                 {
                     ContactType cT = ContactTypeList.Find(f => f.ContactTypeID == cD.ContactTypeID);
                     cT.IsChecked = true;
                 }
             }
         }
     }
 }
Exemple #2
0
 public void NoLabel()
 {
     using (new SoodaTransaction())
     {
         ContactTypeList types = ContactType.GetList(true);
         Assert.AreEqual(3, types.Count);
         Assert.IsNull(types[0].GetLabel(false));
         Assert.IsNull(types[1].GetLabel(false));
         Assert.IsNull(types[2].GetLabel(false));
     }
 }
Exemple #3
0
        public void DoGetListTest()
        {
            using (TestSqlDataSource testDataSource = new TestSqlDataSource("default"))
            {
                testDataSource.Open();

                using (SoodaTransaction tran = new SoodaTransaction())
                {
                    tran.RegisterDataSource(testDataSource);
                    ContactTypeList ctl = ContactType.GetList(tran, SoodaWhereClause.Unrestricted, SoodaSnapshotOptions.Default);
                    foreach (ContactType ct in ctl)
                    {
                        Console.Out.WriteLine("ContactType[{0}]", ct.GetPrimaryKeyValue());
                    }

                    RoleList rl = Role.GetList(tran, SoodaWhereClause.Unrestricted);
                    foreach (Role r in rl)
                    {
                        Console.Out.WriteLine("Role[{0}]", r.GetPrimaryKeyValue());
                    }
                    tran.Commit();
                }
            }
        }