Example #1
0
        protected void SetLicenseType()
        {
            var res = Dcbiz.GetConfigLicenseType("---- เลือก ----").DataResponse;

            if (res != null)
            {
                List <DTO.DataItem> tempItem = new List <DTO.DataItem>();
                foreach (var item in res)
                {
                    if (Convert.ToInt32(item.Id) < 10)
                    {
                        tempItem.Add(new DTO.DataItem {
                            Id = item.Id, Name = item.Name
                        });
                    }
                }
                tempItem.Add(new DTO.DataItem {
                    Id = "09", Name = "รวมประเภทตัวแทนประกันชีวิต"
                });                                                                                //(ให้แสดงข้อมูลของประเภท 01 และ 07)
                tempItem.Add(new DTO.DataItem {
                    Id = "10", Name = "รวมประเภทตัวแทนประกันวินาศภัย"
                });                                                                                   //(ให้แสดงข้อมูลของประเภท 02, 05, 06, 08)
                BindToDDL(ddlLicenseType, tempItem.ToArray());
            }
        }
        protected void SetLicenseType()
        {
            var res = Dcbiz.GetConfigLicenseType("---- เลือก ----").DataResponse;

            if (res != null)
            {
                List <DTO.DataItem> tempItem = new List <DTO.DataItem>();
                //foreach (var item in res)
                //{
                //    if(Convert.ToInt32(item.Id) < 10)
                //        tempItem.Add(new DTO.DataItem { Id = item.Id, Name = item.Name });
                //}
                tempItem.Add(new DTO.DataItem {
                    Id = "01", Name = "ตัวแทนประกันชีวิต"
                });                                                                       //(ให้แสดงข้อมูลของประเภท 01 และ 07)
                tempItem.Add(new DTO.DataItem {
                    Id = "02", Name = "ตัวแทนประกันวินาศภัย"
                });                                                                          //(ให้แสดงข้อมูลของประเภท 02, 05, 06, 08)
                tempItem.Add(new DTO.DataItem {
                    Id = "03", Name = "นายหน้าประกันชีวิต (บุคคลธรรมดา)"
                });                                                                                      //(ให้แสดงข้อมูลของประเภท 03)
                tempItem.Add(new DTO.DataItem {
                    Id = "04", Name = "นายหน้าประกันวินาศภัย (บุคคลธรรมดา)"
                });                                                                                         //(ให้แสดงข้อมูลของประเภท 04)
                tempItem.Add(new DTO.DataItem {
                    Id = "00", Name = "ทั้งหมด"
                });                                                             //(ให้แสดงข้อมูลของประเภท Id=01,02,03,04)
                BindToDDL(ddlLicenseType, tempItem.ToArray());
                ddlLicenseType.Items.Insert(0, "---- เลือก ----");
            }
        }