Exemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtAssociationCode.Text.Length == 3)
                {
                    BLL.DataCenterBiz     biz = new BLL.DataCenterBiz();
                    DTO.ConfigAssociation ent = new DTO.ConfigAssociation();
                    ent.ASSOCIATION_CODE = txtAssociationCode.Text.Trim();
                    ent.ASSOCIATION_NAME = txtAssociationName.Text.Trim();
                    if (ddlAgentType.SelectedValue != "")
                    {
                        ent.AGENT_TYPE = ddlAgentType.SelectedValue;
                    }
                    if (ddlCompType.SelectedValue != "")
                    {
                        ent.COMP_TYPE = ddlCompType.SelectedValue;
                    }
                    ent.ACTIVE = "Y";

                    List <DTO.AssociationLicense> al = new List <DTO.AssociationLicense>();
                    foreach (ListItem i in chkLicense.Items)
                    {
                        al.Add(new DTO.AssociationLicense
                        {
                            LICENSE_TYPE_CODE = i.Value,
                            ACTIVE            = i.Selected ? "Y" : "N"
                        });
                    }
                    var res = biz.InsertAssociation(ent, UserProfile, al);
                    if (!res.IsError)
                    {
                        initGridAssociation();
                        UCSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                        UCSuccess.ShowModalSuccess();
                    }
                    else
                    {
                        UCError.ShowMessageError = res.ErrorMsg;
                        UCError.ShowModalError();
                        mpeAssociation.Show();
                        UplPopUp.Update();
                    }
                }
                else
                {
                    UCError.ShowMessageError = "รหัสสมาคมต้องมีจำนวน 3 หลักเท่านั้น";
                    UCError.ShowModalError();
                }
            }
            catch (Exception ex)
            {
                UCError.ShowMessageError = ex.Message;
                UCError.ShowModalError();
                mpeAssociation.Show();
                UplPopUp.Update();
            }
            //txtAssociationCode.Text = "";
            //txtAssociationName.Text = "";
        }
Exemplo n.º 2
0
        private void GetProvince()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetProvince(SysMessage.DefaultSelecting);

            BindToDDL(UcAddress.DropdownProvince, ls);
        }
Exemplo n.º 3
0
        private void CreateTab()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var res = biz.GetConfigPetitionLicenseType("");

            tbcDynamic = new AjaxControlToolkit.TabContainer();

            for (int i = 0; i < res.DataResponse.Count(); i++)
            {
                TabPanel tbpnlProcessCategory = new TabPanel();
                tbpnlProcessCategory.HeaderText = res.DataResponse[i].Name;
                tbpnlProcessCategory.ID         = "Tab" + i.ToString();

                var ls = biz.GetDocumentLicenseConfigByPetitionType(res.DataResponse[i].Id);
                IEnumerable <DTO.ConfigDocument> configs = ls.DataResponse;

                var tmp = configs.GroupBy(c => c.LICENSE_TYPE_CODE);

                Class.CustomConfigTable configTagle = new Class.CustomConfigTable(res.DataResponse[i].Id);

                configTagle.LinkButtonDelete_Click += new EventHandler(LinkButtonDelete_Click);
                tbpnlProcessCategory.Controls.Add(configTagle);

                tbcDynamic.Tabs.Add(tbpnlProcessCategory);
                TabSettingLicense.Controls.Add(tbcDynamic);
                TabSetting.Controls.Add(TabSettingLicense);
                TabSetting.Controls.Add(TabSettingRegister);
            }
        }
Exemplo n.º 4
0
        public string[] GetCompanyCodeAsCompanyTname(string prefixText)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var list = biz.GetCompanyCodeAsCompanyT(prefixText);

            return(list.ToArray());
        }
Exemplo n.º 5
0
        private void GetCompanyNameById()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetCompanyNameById(base.UserProfile.CompCode);

            ddlCompany.Items.Insert(0, ls);
        }
Exemplo n.º 6
0
        private void GetDocumentTypeLicense()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetDocumentType(SysMessage.DefaultSelecting);

            BindToDDL(ddlLicenseDocumentType, ls.ToList());
        }
Exemplo n.º 7
0
        private void GetPetitionType()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetConfigPetitionLicenseType(SysMessage.DefaultSelecting);


            List <DTO.DataItem> newls = new List <DTO.DataItem>();
            int i = 0;

            foreach (DTO.DataItem item in ls.DataResponse)
            {
                if (item.Id != "01")
                {
                    if (i == 0)
                    {
                        i = i + 1;
                        newls.Add(item);
                        continue;
                    }
                    //item.Name = item.Name.Substring(3);
                    newls.Add(item);
                }
            }



            BindToDDL(ddlPetitionType, newls);
        }
Exemplo n.º 8
0
        private void GetTumbonRegisterAddressBefore(string provinceId, string ampurId, string id)
        {
            var biz = new BLL.DataCenterBiz();
            var ls  = biz.GetTumbonById(provinceId, ampurId, id);

            if (DTO.MemberType.General.GetEnumValue() == EDIT_USER_TYPE)
            {
                if (ls.DataResponse != null)
                {
                    txtParishRegisterAddressBeforeReg.Text = ls.DataResponse.Name;
                }
                else
                {
                    txtParishRegisterAddressBeforeReg.Text = "-";
                }
            }
            else
            {
                if (ls.DataResponse != null && UserProfile.MemberType == DTO.MemberType.General.GetEnumValue())
                {
                    txtParishRegisterAddressBeforeReg.Text = ls.DataResponse.Name;
                }
                else
                {
                    txtParishRegisterAddressBeforeReg.Text = "-";
                }
            }
        }
Exemplo n.º 9
0
        private void GetAmpurRegisterAddressAfter(string provinceId, string id)
        {
            var biz = new BLL.DataCenterBiz();
            var ls  = biz.GetAmpurById(provinceId, id);

            if (DTO.MemberType.General.GetEnumValue() == EDIT_USER_TYPE)//edit by milk
            {
                if (ls.DataResponse != null)
                {
                    txtDistrictRegisterAddressAfterReg.Text = ls.DataResponse.Name;
                }
                else
                {
                    txtDistrictRegisterAddressAfterReg.Text = "-";
                }
            }
            else
            {
                if (ls.DataResponse != null && UserProfile.MemberType == DTO.MemberType.General.GetEnumValue())
                {
                    txtDistrictRegisterAddressAfterReg.Text = ls.DataResponse.Name;
                }
                else
                {
                    txtDistrictRegisterAddressAfterReg.Text = "-";
                }
            }
        }
Exemplo n.º 10
0
        protected void SetDDLExamPlaceGroup()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetExamPlaceGroup(SysMessage.DefaultSelecting);

            BindToDDL(ddlExamPlaceGroup, ls.DataResponse);
        }
Exemplo n.º 11
0
        private void GetRequestLicenseType()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetRequestLicenseType(SysMessage.DefaultSelecting);

            BindToDDLArr(ddlRequestLicenseType, ls.DataResponse);
        }
Exemplo n.º 12
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                BLL.DataCenterBiz     biz = new BLL.DataCenterBiz();
                DTO.ConfigAssociation ent = new DTO.ConfigAssociation();
                ent.ASSOCIATION_CODE = txtAssociationCode.Text;
                ent.ASSOCIATION_NAME = txtAssociationName.Text;
                ent.UPDATED_BY       = base.UserId.ToString();
                ent.UPDATED_DATE     = DateTime.Now;
                ent.ACTIVE           = "Y";

                List <DTO.AssociationLicense> al = new List <DTO.AssociationLicense>();
                var res = biz.InsertExamPlaceGroupR(ent, UserProfile, al);
                if (!res.IsError)
                {
                    initGridAssociation();
                    UCSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                    UCSuccess.ShowModalSuccess();
                }
                else
                {
                    UCError.ShowMessageError = res.ErrorMsg;
                    UCError.ShowModalError();
                }
            }
            catch (Exception ex)
            {
                UCError.ShowMessageError = ex.Message;
                UCError.ShowModalError();
            }
        }
Exemplo n.º 13
0
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
                GridViewRow       gr  = (GridViewRow)((LinkButton)sender).Parent.Parent;
                string            ID  = ((Label)gr.FindControl("lblAssociationCode")).Text;

                var res = biz.DeleteAsscoiation(ID);
                if (!res.IsError)
                {
                    initGridAssociation();
                    UCSuccess.ShowMessageSuccess = SysMessage.DeleteSuccess;
                    UCSuccess.ShowModalSuccess();
                }
                else
                {
                    UCError.ShowMessageError = res.ErrorMsg;
                    UCError.ShowModalError();
                }
            }
            catch (Exception ex)
            {
                UCError.ShowMessageError = ex.Message;
                UCError.ShowModalError();
            }
        }
Exemplo n.º 14
0
        protected void SetCheckBoxLicense(string Assoc_code)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var res = biz.GetLicenseType("");

            chkLicense.DataSource     = res.DataResponse;
            chkLicense.DataTextField  = "Name";
            chkLicense.DataValueField = "Id";
            chkLicense.DataBind();

            var sel = biz.GetAssociationLicense(Assoc_code);

            if (sel.DataResponse != null)
            {
                var data = sel.DataResponse;
                foreach (ListItem ck in chkLicense.Items)
                {
                    var qry = data.FirstOrDefault(s => s.LICENSE_TYPE_CODE == ck.Value && s.ACTIVE == "Y");
                    if (qry != null)
                    {
                        ck.Selected = true;
                    }
                }
            }

            //ValidTypeCheckBox();
        }
Exemplo n.º 15
0
        public ConfigGridView ConCreateGridView(BLL.DataCenterBiz biz, DTO.DataItem licenseType)
        {
            ConfigGridView configGridView            = new ConfigGridView(String.Format("gvConfig_{0}", licenseType.Id));
            IEnumerable <DTO.ConfigDocument> configs = ConfigDataSource.Where(c => c.LICENSE_TYPE_CODE == licenseType.Id);

            if (configs != null && configs.Count() > 0)
            {
                configGridView = new ConfigGridView(String.Format("gvConfig_{0}", licenseType.Id));

                /********** Config GridView  **************/
                configGridView.AutoGenerateColumns = false;
                configGridView.HorizontalAlign     = HorizontalAlign.Center;
                configGridView.Caption             = licenseType.Name;
                //configGridView.SelectedDataKey["ID"].ToString();
                configGridView.CaptionAlign = TableCaptionAlign.Left;

                /************  Add Columns ****************/
                configGridView.AddLabelTemplateField("ID", "ID", 5, true);
                configGridView.AddLabelRowNumberField("ลำดับ", "ID", 5, true);

                configGridView.AddBoundField("LICENSE_TYPE_CODE", "LICENSE_TYPE_CODE", "", 0, false);
                configGridView.AddBoundField("เอกสาร", "DOCUMENT_NAME", "", 73, true);
                configGridView.AddTemplateField("ต้องทำการแนบเอกสาร", "IS_REQUIRE", 12);
                configGridView.AddLinkButtonTemplateField("ดำเนินการ", "ID", 6);
                configGridView.DataSource = configs;
            }
            return(configGridView);
        }
Exemplo n.º 16
0
        protected void gvUpload_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                LinkButton hplView   = (LinkButton)e.Row.FindControl("hplViewDetailImg");
                Label      lblFileGv = (Label)e.Row.FindControl("lblAttachFilePathGv");
                Label      lblTypeGv = (Label)e.Row.FindControl("lblTypeGv");
                if (hplView != null)
                {
                    hplView.Visible       = true;
                    hplView.OnClientClick = LinkPopUp(lblFileGv.Text);
                }
                BLL.DataCenterBiz       biz = new BLL.DataCenterBiz();
                List <DTO.DocumentType> ls  = biz.GetDocumentConfigList();

                if (!string.IsNullOrEmpty(lblFileGv.Text))
                {
                    string[] ary         = lblFileGv.Text.Split('.');
                    string[] arrFileType = ary[0].Split('_');
                    foreach (var item in ls)
                    {
                        if (arrFileType[1] == item.DOCUMENT_CODE)
                        {
                            lblTypeGv.Text = item.DOCUMENT_NAME;
                        }
                    }
                    if (string.IsNullOrEmpty(lblTypeGv.Text))
                    {
                        lblTypeGv.Text = Resources.errorResultVerify_001;
                    }
                }
            }
        }
Exemplo n.º 17
0
        private void GetApplicantDetailDocumentType()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetDocumentType(SysMessage.DefaultSelecting);

            BindToDDL(ddlApplicantDocumentType, ls.ToList());
        }
Exemplo n.º 18
0
        private void GetTypeDocument()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetRequestLicenseType("ทั้งหมด");

            BindToDDLAr(ddlLicenseType, ls.DataResponse);
        }
Exemplo n.º 19
0
        private void GetLicenseType()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetConfigLicenseType(SysMessage.DefaultSelecting);

            BindToDDL(ddlLicenseType, ls.DataResponse.ToList());
        }
        public void GetTitleName()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetTitleName(SysMessage.DefaultSelecting);

            BindToDDL(ddlDetailTitleName, ls);
        }
Exemplo n.º 21
0
        public string[] GetAutomCompleteCompany(string prefixText)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var list = biz.GetCompanyCodeByName(prefixText);

            return(list.ToArray());
        }
Exemplo n.º 22
0
        private void initDDLExamPlace(string placeGroup)
        {
            BLL.DataCenterBiz dbiz = new BLL.DataCenterBiz();
            if (ddlGroupType.SelectedValue == "3")
            {
                ddlExamPlace.DataTextField  = "Name";
                ddlExamPlace.DataValueField = "Id";
                ddlExamPlace.DataSource     = dbiz.GetExamPlace_UnderAssocicate(SysMessage.DefaultSelecting, ddlExamPlaceGroup.SelectedValue.ToString()).DataResponse;
                ddlExamPlace.DataBind();
                if (ddlExamPlace.Items.Count != 0)
                {
                    ddlExamPlace.Items.Insert(0, new ListItem(SysMessage.DefaultSelecting, ""));
                }
            }
            else if (ddlGroupType.SelectedValue == "7")
            {
                ddlExamPlace.DataSource     = dbiz.GetExamPlace_AndProvince(ddlExamPlaceGroup.SelectedValue.ToString()).DataResponse;
                ddlExamPlace.DataTextField  = "Name";
                ddlExamPlace.DataValueField = "Id";
                ddlExamPlace.DataBind();

                if (ddlExamPlace.Items.Count != 0)
                {
                    ddlExamPlace.Items.Insert(0, new ListItem(SysMessage.DefaultSelecting, ""));
                }
            }
            //  ddlExamPlace.Items.Insert(0, new ListItem(SysMessage.DefaultSelecting, ""));
        }
Exemplo n.º 23
0
        public void GetEducation()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetEducation(SysMessage.DefaultSelecting);

            BindToDDL(ddlEducation, ls);
        }
Exemplo n.º 24
0
        private void GetSearchOICType()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetOICType(SysMessage.DefaultSelecting);

            BindToDDL(ddlSearchMemberType, ls);
        }
Exemplo n.º 25
0
        private void GetCompanyByLicenseType(string strLicenTypeCode)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            List <string>     lst = biz.GetCompanyCodeByName("");

            Session["lsCompCode"] = lst;

            List <string> ls = (List <string>)Session["lsCompCode"];
            List <String> ls2;

            switch (strLicenTypeCode)
            {
            case "01":
            case "07": ls2 = ls.Where(l => l.Contains("[1")).ToList();
                break;

            case "03":
            case "04": ls2 = ls.Where(l => l.Contains("[3")).ToList();
                break;

            case "02":
            case "05":
            case "06":
            case "08": ls2 = ls.Where(l => l.Contains("[2")).ToList();
                break;

            default: ls2 = ls;
                break;
            }
            ddlCompany.DataSource = ls2;
            ddlCompany.DataBind();
            ddlCompany.Items.Insert(0, new ListItem(SysMessage.DefaultSelecting, "0"));
        }
Exemplo n.º 26
0
        private void GetSearchStatus()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetStatus("");

            BindToDDL(ddlSearchStatus, ls);
        }
Exemplo n.º 27
0
        protected void ddlDistrict_SelectedIndexChanged(object sender, EventArgs e)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetTumbon(SysMessage.DefaultSelecting, UcAddress.DropdownProvince.SelectedValue, UcAddress.DropdownDistrict.SelectedValue);

            BindToDDL(UcAddress.DropdownParish, ls);
        }
Exemplo n.º 28
0
        public ConfigGridView ConCreateGridView(BLL.DataCenterBiz biz, DTO.DataItem licenseType)
        {
            ConfigGridView configGridView            = new ConfigGridView(String.Format("gvConfig_{0}", licenseType.Id));
            IEnumerable <DTO.ConfigDocument> configs = ConfigDataSource.Where(c => c.LICENSE_TYPE_CODE == licenseType.Id);

            if (configs != null && configs.Count() > 0)
            {
                configGridView = new ConfigGridView(String.Format("gvConfig_{0}", licenseType.Id));

                /********** Config GridView  **************/
                configGridView.AutoGenerateColumns = false;
                configGridView.Caption             = licenseType.Name;

                /************  Add Columns ****************/
                configGridView.AddBoundField("ID", "ID", "", 10, true);
                configGridView.AddBoundField("LICENSE_TYPE_CODE", "LICENSE_TYPE_CODE", "", 10, true);
                configGridView.AddBoundField("DOCUMENT_NAME", "DOCUMENT_NAME", "", 10, true);
                //configGridView.AddCheckBoxField("IS_REQUIRE", "IS_REQUIRE",  10);
                //configGridView.AddCommandField(true);
                configGridView.AddTemplateField("IS_REQUIRE", "IS_REQUIRE");
                configGridView.DataSource = configs;
            }


            return(configGridView);
        }
Exemplo n.º 29
0
        protected void LinkButtonDelete_Click(Object sender, EventArgs e)
        {
            var gv = (GridViewRow)((LinkButton)sender).NamingContainer;
            //gv.Cells[0].Visible = true;
            string strNo = ((Label)gv.Cells[0].Controls[0]).Text;

            BLL.DataCenterBiz biz      = new BLL.DataCenterBiz();
            DTO.UserProfile   profiles = (DTO.UserProfile)HttpContext.Current.Session[PageList.UserProfile];
            string            Alert    = "confirm('" + Resources.infoSettingAttach_001 + "')";

            ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "confirm", Alert, true);
            var res = biz.DeleteConfigDocument(Convert.ToInt16(strNo), profiles);

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                UCModalSuccess.ShowMessageSuccess = SysMessage.DeleteConfigLicense;
                UCModalSuccess.ShowModalSuccess();
                UpdatePanelGrid.Update();
            }
        }
Exemplo n.º 30
0
        public string[] GetAutoInsuranceAssociate(string prefixstring)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var list = biz.GetInsuranceAssociate(prefixstring);

            return(list);
        }