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 = ""; }
private void GetProvince() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetProvince(SysMessage.DefaultSelecting); BindToDDL(UcAddress.DropdownProvince, ls); }
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); } }
public string[] GetCompanyCodeAsCompanyTname(string prefixText) { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var list = biz.GetCompanyCodeAsCompanyT(prefixText); return(list.ToArray()); }
private void GetCompanyNameById() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetCompanyNameById(base.UserProfile.CompCode); ddlCompany.Items.Insert(0, ls); }
private void GetDocumentTypeLicense() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetDocumentType(SysMessage.DefaultSelecting); BindToDDL(ddlLicenseDocumentType, ls.ToList()); }
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); }
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 = "-"; } } }
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 = "-"; } } }
protected void SetDDLExamPlaceGroup() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetExamPlaceGroup(SysMessage.DefaultSelecting); BindToDDL(ddlExamPlaceGroup, ls.DataResponse); }
private void GetRequestLicenseType() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetRequestLicenseType(SysMessage.DefaultSelecting); BindToDDLArr(ddlRequestLicenseType, ls.DataResponse); }
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(); } }
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(); } }
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(); }
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); }
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; } } } }
private void GetApplicantDetailDocumentType() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetDocumentType(SysMessage.DefaultSelecting); BindToDDL(ddlApplicantDocumentType, ls.ToList()); }
private void GetTypeDocument() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetRequestLicenseType("ทั้งหมด"); BindToDDLAr(ddlLicenseType, ls.DataResponse); }
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); }
public string[] GetAutomCompleteCompany(string prefixText) { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var list = biz.GetCompanyCodeByName(prefixText); return(list.ToArray()); }
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, "")); }
public void GetEducation() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetEducation(SysMessage.DefaultSelecting); BindToDDL(ddlEducation, ls); }
private void GetSearchOICType() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetOICType(SysMessage.DefaultSelecting); BindToDDL(ddlSearchMemberType, ls); }
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")); }
private void GetSearchStatus() { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var ls = biz.GetStatus(""); BindToDDL(ddlSearchStatus, ls); }
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); }
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); }
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(); } }
public string[] GetAutoInsuranceAssociate(string prefixstring) { BLL.DataCenterBiz biz = new BLL.DataCenterBiz(); var list = biz.GetInsuranceAssociate(prefixstring); return(list); }