/// <summary> /// GetAllLicense : IF Fee > 0 : PETITION_TYPE_CODE : ใบแทนใบอนุญาต(เปลี่ยนชื่อ-สกุล) /// </summary> /// <Author>Natta</Author> /// <LastUpdate>30/06/2557</LastUpdate> private void GetAllLicense() { LicenseBiz biz = new LicenseBiz(); DTO.ResponseService <DTO.PersonLicenseTransaction[]> resAll = biz.getViewPersonLicense(this.MasterLicense.UserProfile.IdCard, "A"); if (resAll.DataResponse != null) { resAll.DataResponse.ToList().ForEach(lic => { if (lic.FEES == 0) { lic.PETITION_TYPE_CODE = "ใบแทนใบอนุญาต(เปลี่ยนชื่อ-สกุล)"; } }); this.ucLicensePaymentAll.lblGvHead.Text = Resources.propLicenseCheck_LicensePaymentAll; this.ucLicensePaymentAll.GridPayment.DataSource = resAll.DataResponse; this.ucLicensePaymentAll.GridPayment.DataBind(); } else { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = resAll.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); } }
protected void Page_Load(object sender, EventArgs e) { try { LicenseBiz biz = new LicenseBiz(); report.Load(Server.MapPath("../Reports/RptReplacementReport.rpt")); var dt = biz.GetReplacementReport(Request.QueryString["LicenseType"].ToString(), Request.QueryString["CompCode"].ToString(), Request.QueryString["Replacement"].ToString(), Request.QueryString["DateStart"].ToString(), Request.QueryString["DateEnd"].ToString()).DataResponse.Tables[0]; if (dt.Rows.Count > 0) { report.SetDataSource(dt); string date_st = Utils.ConvertCustom.ConvertToTxtThai(Request.QueryString["DateStart"].ToString(), '/'); string date_en = Utils.ConvertCustom.ConvertToTxtThai(Request.QueryString["DateEnd"].ToString(), '/'); report.SetParameterValue("startdate", date_st); report.SetParameterValue("enddate", date_en); report.SetParameterValue("replacemant", Session["ReplaceName"].ToString()); CrystalReportViewer1.ReportSource = report; } else { Response.Write("ไม่พบข้อมูล"); } } catch (Exception ex) { Response.Write("โปรดติดต่อผู้ดูแลระบบ"); LoggerFactory.CreateLog().Fatal("LicenseReportViewer", ex); } }
private ResponseMessage <bool> LicenseValidation() { LicenseBiz biz = new LicenseBiz(); ResponseMessage <bool> res = new ResponseMessage <bool>(); foreach (DTO.PersonLicenseHead h in this.MasterLicense.PersonLicenseH) { DTO.PersonLicenseDetail details = this.MasterLicense.PersonLicenseD.Where(group => group.UPLOAD_GROUP_NO == h.UPLOAD_GROUP_NO).FirstOrDefault(); ResponseMessage <bool> result = biz.SingleLicenseValidation(h, details); if ((result.IsError) || (result.ResultMessage == false)) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = result.ErrorMsg.ToString(); this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); lblResult.Text = result.ErrorMsg.ToString(); btnNext.Enabled = false; pnlNext.Enabled = false; res = result; //return; } else if (result.ResultMessage == true) { res = result; } } return(res); }
private void FirstTabDataBind(object sender, EventArgs e) { LicenseBiz biz = new LicenseBiz(); var gr = (GridViewRow)((LinkButton)sender).NamingContainer; var idCardNo = (Label)gr.FindControl("lblIDNumberGv"); Session["idCardNo"] = idCardNo.Text; var IDCard = Session["idCardNo"].ToString(); var res = biz.GetPersonalHistoryByIdCard(IDCard); if (res.IsError) { //UCModalError.ShowMessageError = res.ErrorMsg; //UCModalError.ShowModalError(); } else { DTO.PersonalHistory person = res.DataResponse; if (res.DataResponse != null) { if (!string.IsNullOrEmpty(person.FLNAME)) { this.ucLicenseDetail.TxtName.Text = person.FLNAME; this.ucLicenseDetail.TxtName.DataBind(); } if (!string.IsNullOrEmpty(person.ID_CARD_NO)) { this.ucLicenseDetail.TxtIDCard.Text = person.ID_CARD_NO; this.ucLicenseDetail.TxtIDCard.DataBind(); } } } }
protected void imbSubmit_Click(object sender, ImageClickEventArgs e) { LicenseBiz lService = new LicenseBiz(); lwg_LicenseForm license = new lwg_LicenseForm(); license.Name = this.txtName.Text; license.Email = this.txtEmail.Text; license.Phone = this.txtPhone.Text; license.Address = this.txtAddress.Text; license.City = this.txtCity.Text; license.State = this.jumpMenu.Value; license.Zipcode = this.txtZipcode.Text; license.LicenseType = (int)this.Type; if (lService.InsertLicense(license) == true) { this.ltrMessage.Text = "Your license is submitted successfully."; } else { this.ltrMessage.Text = "Your license is not submitted successfully. Please try again."; } this.pnForm.Visible = false; this.pnMessage.Visible = true; }
protected void btnSearch_Click(object sender, EventArgs e) { DateTime from, to; if (!DateTime.TryParse(this.txtFrom.Text, out from)) { from = DateTime.MinValue; } if (!DateTime.TryParse(this.txtTo.Text, out to)) { to = DateTime.MaxValue; } int type = int.Parse(this.drpType.SelectedValue); LicenseBiz lService = new LicenseBiz(); List <lwg_LicenseForm> listLicense = lService.Search(from, to, type); if (listLicense != null) { this.grvLicense.DataSource = listLicense.OrderByDescending(l => l.CreatedDate).ToList(); this.grvLicense.DataBind(); } }
protected void LoadDataToViewer() { try { PetitionType = Request.QueryString["PetitionType"].Trim(); if (!String.IsNullOrEmpty(Request.QueryString["DateStart"].Trim())) { DateStart = Convert.ToDateTime(Request.QueryString["DateStart"].ToString()); } if (!String.IsNullOrEmpty(Request.QueryString["DateEnd"].Trim())) { DateEnd = Convert.ToDateTime(Request.QueryString["DateEnd"].ToString()); } CompCode = Request.QueryString["CompCode"].Trim(); Days = Request.QueryString["Days"].Trim(); LicenseBiz biz = new LicenseBiz(); DataSet ds = biz.GetRenewLicenseQuick(PetitionType, DateStart, DateEnd, CompCode, Days).DataResponse; DataTable dt = ds.Tables[0].Rows.Count > 0 ? ds.Tables[0] : null; if (dt != null) { rpt.Load(Server.MapPath(base.ReportFilePath_Key + "RptLicenseQuick.rpt")); rpt.SetDataSource(ds.Tables[0]); cryViewer.ReportSource = rpt; } else { Response.Write("ไม่พบข้อมูล"); } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void grvLicense_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("DLT")) { LicenseBiz lBiz = new LicenseBiz(); if (lBiz.DeleteLiscense(int.Parse(e.CommandArgument.ToString()))) { this.BindData(); } } }
private void BindData() { LicenseBiz lService = new LicenseBiz(); List <lwg_LicenseForm> listLicense = lService.GetAllLicense(); if (listLicense != null) { this.grvLicense.DataSource = listLicense.OrderByDescending(l => l.CreatedDate).ToList(); this.grvLicense.DataBind(); } }
protected void grvLicense_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { lwg_LicenseForm license = (lwg_LicenseForm)e.Row.DataItem; Literal ltrType = (Literal)e.Row.FindControl("ltrType"); if (license != null && ltrType != null) { ltrType.Text = LicenseBiz.GetLicenseType(license.LicenseType); } } }
/// <summary> /// GetLicenseY : Where Fee > 0 : Not show /// </summary> /// <Author>Natta</Author> /// <LastUpdate>30/06/2557</LastUpdate> private void GetLicenseY() { LicenseBiz biz = new LicenseBiz(); DTO.ResponseService <DTO.PersonLicenseTransaction[]> resY = biz.getViewPersonLicense(this.MasterLicense.UserProfile.IdCard, "Y"); if (resY.DataResponse != null) { List <DTO.PersonLicenseTransaction> lsPerLicenseY = new List <DTO.PersonLicenseTransaction>(); resY.DataResponse.ToList().ForEach(lic => { if (lic.FEES > 0) { DTO.PersonLicenseTransaction ent = new DTO.PersonLicenseTransaction(); lic.MappingToEntity <DTO.PersonLicenseTransaction>(ent); lsPerLicenseY.Add(ent); } }); if (resY.DataResponse.Count() <= 0) { this.pnlSort.Enabled = false; this.pnlSort.Visible = false; this.pnlY.Enabled = false; this.ucLicensePaymentY.lblGvHead.Text = Resources.propLicenseCheck_LicensePaymentY; //this.ucLicensePaymentY.GridPayment.DataSource = resY.DataResponse; this.ucLicensePaymentY.GridPayment.DataSource = lsPerLicenseY; this.ucLicensePaymentY.GridPayment.DataBind(); } else if (resY.DataResponse.Count() > 0) { this.pnlSort.Enabled = true; this.pnlSort.Visible = true; this.pnlY.Enabled = true; this.ucLicensePaymentY.lblGvHead.Text = Resources.propLicenseCheck_LicensePaymentY; //this.ucLicensePaymentY.GridPayment.DataSource = resY.DataResponse; this.ucLicensePaymentY.GridPayment.DataSource = lsPerLicenseY; this.ucLicensePaymentY.GridPayment.DataBind(); } } else if ((resY.DataResponse == null) || (resY.IsError)) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = resY.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); } }
private void BindReport() { LicenseBiz biz = new LicenseBiz(); PersonBiz perBiz = new PersonBiz(); ReportDocument rpt = new ReportDocument(); CrystalReport1 cr = new CrystalReport1(); var res = perBiz.GetById(id); string ReportFolder = @"D:\[-- AR Soft --]\[-- Project --]\IAS_PROJECT10\Web\IAS\Reports\"; //rpt.Load(Server.MapPath(ReportFolder + "RptAgreement_1.rpt")); //rpt.SetDataSource(res.DataResponse); cr.Load(ReportFolder + "RptAgreement_1.rpt"); cr.SetDataSource(new [] { res }); CrystalReportViewer.ReportSource = cr; }
public void GetAttatchFiles() { LicenseBiz biz = new LicenseBiz(); if (this.MasterLicense.AttachFiles == null) { DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetAttatchFileLicenseByPersonId(this.MasterLicense.UserProfile.Id); var list = res.DataResponse.ToList(); ucAttachLicense.AttachFiles = list.ConvertToAttachFilesView(); udpMain.Update(); } else if (this.MasterLicense.AttachFiles != null) { ucAttachLicense.AttachFiles = this.MasterLicense.AttachFiles; udpMain.Update(); } }
public void GetAllLicenseByIDCard() { LicenseBiz biz = new LicenseBiz(); Int32 FeeMode = 1; //Get All Licese By ID_CARD_NO if (this.MasterLicense != null) { if (this.MasterLicense.Menu.Equals(4)) { //ใบแทนใบอนุญาต(ชำรุดสูญหาย) FeeMode = 1; } else { //ใบแทนใบอนุญาต(เปลี่ยนชื่อ-สกุล) FeeMode = 2; } } DTO.ResponseService <DTO.PersonLicenseTransaction[]> res = biz.GetAllLicenseByIDCard(this.MasterLicense.UserProfile.IdCard, "1", FeeMode); if (res.DataResponse != null) { //ใบแทนใบอนุญาต(ชำรุดสูญหาย) Fee = GetDB() if (this.MasterLicense.Menu.Equals(4)) { gvReplaceLicense.DataSource = res.DataResponse; gvReplaceLicense.DataBind(); } //ใบแทนใบอนุญาต(เปลี่ยนชื่อ-สกุล) Fee = 0 else { res.DataResponse.ToList().ForEach(x => x.FEES = 0); gvReplaceLicense.DataSource = res.DataResponse; gvReplaceLicense.DataBind(); } } else if (res.IsError) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); } }
public void GetPersonalLicenseApprover() { LicenseBiz biz = new LicenseBiz(); DTO.ResponseService <DTO.PersonLicenseApprover[]> approverlist = biz.GetPersonalLicenseApprover(this.MasterLicense.LicenseTypeCode); ddlLicenseApprover.DataTextField = "ASSOCIATION_NAME"; ddlLicenseApprover.DataValueField = "ASSOCIATION_CODE"; ddlLicenseApprover.DataSource = approverlist.DataResponse; ddlLicenseApprover.DataBind(); if (!string.IsNullOrEmpty(this.MasterLicense.LicenseApprover)) { if (ddlLicenseApprover.Items.FindByValue(this.MasterLicense.LicenseApprover) != null) { ddlLicenseApprover.SelectedValue = this.MasterLicense.LicenseApprover; } } }
public void GetCurrentLicense(string idCard) { LicenseBiz biz = new LicenseBiz(); //Get All Licese By ID_CARD_NO //DTO.ResponseService<DTO.PersonLicenseTransaction[]> res = biz.GetAllLicenseByIDCard(this.MasterRegis.UserProfile.IdCard); DTO.ResponseService <DTO.PersonLicenseTransaction[]> res = biz.GetAllLicenseByIDCard(idCard, "1", 1); if (res.DataResponse != null) { gvCurrentLicense.DataSource = res.DataResponse; gvCurrentLicense.DataBind(); } else if (res.IsError) { this.MasterRegis.ModelError.ShowMessageError = res.ErrorMsg; this.MasterRegis.ModelError.ShowModalError(); return; } }
public void GetPersonLicense() { LicenseBiz biz = new LicenseBiz(); this.MasterLicense.CurrentExpiredLicneseList.Clear(); //ต่ออายุก่อนหมดอายุ 60วัน if (this.MasterLicense.Menu.Equals(2)) { DTO.ResponseService <DTO.PersonLicenseTransaction[]> res = biz.GetRenewLicneseByIdCard(this.MasterLicense.UserProfile.IdCard); if (res.DataResponse != null) { gvRenewLicense.DataSource = res.DataResponse; gvRenewLicense.DataBind(); } else if (res.IsError) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); } } //หมดอายุขอต่อใหม่ else if (this.MasterLicense.Menu.Equals(3)) { DTO.ResponseService <DTO.PersonLicenseTransaction[]> res = biz.GetExpiredLicneseByIdCard(this.MasterLicense.UserProfile.IdCard); if (res.DataResponse != null) { this.MasterLicense.CurrentExpiredLicneseList = res.DataResponse.ToList(); gvRenewLicense.DataSource = res.DataResponse; gvRenewLicense.DataBind(); } else if (res.IsError) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); } } }
private DTO.ResponseMessage <bool> CheckCurrentPersoanlLicenseByIDCard() { LicenseBiz biz = new LicenseBiz(); DTO.ResponseMessage <bool> res = new ResponseMessage <bool>(); DTO.PersonLicenseTransaction licensechk = new PersonLicenseTransaction(); try { DTO.ResponseService <DTO.PersonLicenseTransaction[]> resLicense = biz.GetAllLicenseByIDCard(base.UserProfile.IdCard, "1", 3); if (resLicense.DataResponse.Count() > 0) { licensechk = resLicense.DataResponse.Where(li => li.LICENSE_TYPE_CODE.Equals(this.ddBusinessType.SelectedItem.Value)).FirstOrDefault(); if (licensechk == null) { res.ResultMessage = true; } else { res.ErrorMsg = "ไม่สามารถทำรายการได้เนื่องจากมีใบอนุญาตประเภท " + licensechk.LICENSE_TYPE_NAME + " อยู่ในระบบแล้ว"; res.ResultMessage = false; } } else { res.ResultMessage = true; } } catch (Exception ex) { res.ResultMessage = false; res.ErrorMsg = "โปรดติดต่อผู้ดูแลระบบ"; } return(res); }
protected void Page_Load(object sender, EventArgs e) { try { var ls = new List <RptLicenseStatisticsService>(); ReportDocument report = new ReportDocument(); // LicenseBiz biz = new LicenseBiz(); string ddlLicenseType = Request.QueryString["LicenseType"].ToString(); string dateStart1 = Request.QueryString["DateStart1"].ToString(); string dateStart2 = Request.QueryString["DateStart2"].ToString(); string dateEnd1 = Request.QueryString["DateEnd1"].ToString(); string dateEnd2 = Request.QueryString["DateEnd2"].ToString(); int x, y = 6, countT; if (ddlLicenseType == "00") { x = 4; } else { x = 1; } string[,] LicenseStatistics = new string[x, y]; for (countT = 1; countT <= x; countT++) { RptLicenseStatisticsService rcv = new RptLicenseStatisticsService(); string temp = ""; if (x == 1) { temp = ddlLicenseType; } else { temp = "0" + countT.ToString(); } #region code LicenseBiz biz = new LicenseBiz(); var res1 = biz.GetLicenseStatisticsReport(temp, dateStart1, dateEnd1, dateStart2, dateEnd2); if (res1.DataResponse.Tables[0].Rows.Count != 0) { DataTable DT1 = res1.DataResponse.Tables[0]; DataRow DR1 = DT1.Rows[0]; COUNT_COME_CODE1 = Convert.ToDouble(DR1["COUNT_COME_CODE1"]); } var res2 = biz.GetLicenseStatisticsReport(temp, dateStart2, dateEnd2, dateStart2, dateStart2); if (res2.DataResponse.Tables[0].Rows.Count != 0) { DataTable DT1 = res2.DataResponse.Tables[0]; DataRow DR1 = DT1.Rows[0]; COUNT_COME_CODE2 = Convert.ToDouble(DR1["COUNT_COME_CODE1"]); } var varsum1 = biz.GetSumLicenseStatisticsReport(dateStart1, dateEnd1); if (varsum1.DataResponse.Tables[0].Rows.Count != 0) { DataTable DT1 = varsum1.DataResponse.Tables[0]; DataRow DR1 = DT1.Rows[0]; sum1 = Convert.ToDouble(DR1["COUNT_COME_CODE1"]); } var varsum2 = biz.GetSumLicenseStatisticsReport(dateStart2, dateEnd2); if (varsum2.DataResponse.Tables[0].Rows.Count != 0) { DataTable DT1 = varsum2.DataResponse.Tables[0]; DataRow DR1 = DT1.Rows[0]; sum2 = Convert.ToDouble(DR1["COUNT_COME_CODE1"]); } share1 = sum1 == 0 ? 0 : COUNT_COME_CODE1 * 100 / sum1; share2 = sum2 == 0 ? 0 : COUNT_COME_CODE2 * 100 / sum2; CompareLicense = share2 - share1; #endregion code if (x == 1) { rcv.LicenseType = LicenseTypeName(temp); } else { rcv.LicenseType = LicenseTypeName(temp); } rcv.CountLicense1 = COUNT_COME_CODE1; rcv.Share1 = share1; rcv.CountLicense2 = COUNT_COME_CODE2; rcv.Share2 = share2; rcv.CompareLicense = CompareLicense; ls.Add(rcv); } string ReportFolder = base.ReportFilePath_Key; string PDF_Temp = base.PDFPath_Temp_Key; //string FileNameInput = "RptLicenseStatistics_Temp.pdf"; string PDF_Users = base.PDFPath_Users_Key; //string FileNameOutput = "RptLicenseStatistics.pdf"; rpt.Load(Server.MapPath(ReportFolder + "RptLicenseStatistics.rpt")); rpt.SetDataSource(ls); string date_st1 = Utils.ConvertCustom.ConvertToTxtThai(Request.QueryString["DateStart1"].ToString(), '/'); string date_en1 = Utils.ConvertCustom.ConvertToTxtThai(Request.QueryString["DateEnd1"].ToString(), '/'); string date_st2 = Utils.ConvertCustom.ConvertToTxtThai(Request.QueryString["DateStart2"].ToString(), '/'); string date_en2 = Utils.ConvertCustom.ConvertToTxtThai(Request.QueryString["DateEnd2"].ToString(), '/'); rpt.SetParameterValue("startdate1", date_st1); rpt.SetParameterValue("enddate1", date_en1); rpt.SetParameterValue("startdate2", date_st2); rpt.SetParameterValue("enddate2", date_en2); BindReport(rpt); } catch (Exception ex) { Response.Write("โปรดติดต่อผู้ดูแลระบบ"); LoggerFactory.CreateLog().Fatal("LicenseReportViewer", ex); } #region ทำเป็นไฟล์ PDF //rpt.ExportToDisk(ExportFormatType.PortableDocFormat, Server.MapPath(PDF_Temp + FileNameInput)); //using (Stream input = new FileStream(Server.MapPath(PDF_Temp + FileNameInput), FileMode.Open, FileAccess.Read, FileShare.Read)) //using (Stream output = new FileStream(Server.MapPath(PDF_Users + FileNameOutput), FileMode.Create, FileAccess.Write, FileShare.None)) //{ // PdfReader reader = new PdfReader(input); // /*ใส่ Password*/ // //PdfEncryptor.Encrypt(reader, output, true, "test", "test", PdfWriter.AllowPrinting); // /*ใส่ Password*/ // PdfEncryptor.Encrypt(reader, output, true, string.Empty, string.Empty, PdfWriter.AllowPrinting); //} ////ลบไฟล์ ใน Folder PDF_Temp ทิ้ง //string PathDelete = Server.MapPath(PDF_Temp + FileNameInput); //FileInfo File = new FileInfo(PathDelete); //if (File.Exists) //{ // File.Delete(); //} ////ลบไฟล์ ใน Folder PDF_Temp ทิ้ง //string FilePath = Server.MapPath(PDF_Users + FileNameOutput); //WebClient User = new WebClient(); //Byte[] FileBuffer = User.DownloadData(FilePath); //if (FileBuffer != null) //{ // Response.ContentType = "application/pdf"; // Response.AddHeader("content-length", FileBuffer.Length.ToString()); // Response.BinaryWrite(FileBuffer); //} //upd.Update(); #endregion //report.Load(Server.MapPath("../Reports/RptLicenseStatistics.rpt")); //report.SetDataSource(biz.GetLicenseStatisticsReport(Request.QueryString["LicenseType"].ToString(), Request.QueryString["DateStart1"].ToString(), Request.QueryString["DateEnd1"].ToString(), Request.QueryString["DateStart2"].ToString(), Request.QueryString["DateEnd2"].ToString()).DataResponse.Tables[0]); //report.SetParameterValue("startdate1", Request.QueryString["DateStart1"].ToString()); //report.SetParameterValue("enddate1", Request.QueryString["DateEnd1"].ToString()); //report.SetParameterValue("startdate2", Request.QueryString["DateStart2"].ToString()); //report.SetParameterValue("enddate2", Request.QueryString["DateEnd2"].ToString()); //report.SetParameterValue("LicenseName", Session["license"].ToString()); //CrystalReportViewer1.ReportSource = report; }
protected void hplView_Click(object sender, EventArgs e) { var gr = (GridViewRow)((LinkButton)sender).NamingContainer; Label PetitionCode = (Label)gr.FindControl("lblPetitionCode"); Label LicenseCode = (Label)gr.FindControl("lblLicenseCode"); Label RenewTime = (Label)gr.FindControl("lblRenewTime"); Label IdCard = (Label)gr.FindControl("lblIdCard"); Label lblLicenseno = (Label)gr.FindControl("lblLicenseno"); this.LicenseTypeCode = LicenseCode.Text; this.PettionTypeCode = PetitionCode.Text; this.CurrentLicenseRenewTime = RenewTime.Text == "" ? "0" : RenewTime.Text; this.CheckApprove = "ApproveL"; this.Mode = DTO.LicensePropMode.General.GetEnumValue().ToString(); LicenseBiz biz = new LicenseBiz(); #region gvGeneral DTO.ResponseService <DTO.ValidateLicense[]> result = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 1); // this.GridviewGeneral = result.DataResponse.ToList(); if (result.DataResponse.Count() > 0) { gvGeneral.Visible = true; gvGeneral.DataSource = result.DataResponse; gvGeneral.DataBind(); //Create Head Genaral if (gvGeneral.Controls.Count > 0) { AddSuperHeader(gvGeneral); checkHead = "T"; } else { //AddSuperHeader(gvTrainResult); } } else { gvGeneral.Visible = false; } #endregion #region gvExamResult DTO.ResponseService <DTO.ValidateLicense[]> result2 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 2); if (result2.DataResponse.Count() > 0) { gvExamResult.DataSource = result2.DataResponse; gvExamResult.DataBind(); gvExamResult.Visible = true; // this.GridviewExamResult = result2.DataResponse.ToList(); //Create Head Genaral if (gvGeneral.Controls.Count > 0) { //AddSuperHeader(gvExamResult); } else { if (checkHead != "T") { AddSuperHeader(gvExamResult); checkHead = "T"; } } } else { gvExamResult.Visible = false; } #endregion #region gvEducation DTO.ResponseService <DTO.ValidateLicense[]> result3 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 3); if (result3.DataResponse.Count() > 0) { gvEducation.DataSource = result3.DataResponse; gvEducation.DataBind(); gvEducation.Visible = true; // this.GridviewEducation = result3.DataResponse.ToList(); //Create Head Genaral if (gvExamResult.Controls.Count > 0) { //AddSuperHeader(gvEducation); } else { if (checkHead != "T") { AddSuperHeader(gvEducation); checkHead = "T"; } } } else { gvEducation.Visible = false; } #endregion #region gvTrainResult DTO.ResponseService <DTO.ValidateLicense[]> result4 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 4); if (result4.DataResponse.Count() > 0) { gvTrainResult.DataSource = result4.DataResponse; gvTrainResult.DataBind(); gvTrainResult.Visible = true; // this.GridviewTrainResult = result4.DataResponse.ToList(); //Create Head Genaral if (gvEducation.Controls.Count > 0) { //AddSuperHeader(gvTrainResult); } else { if (checkHead != "T") { AddSuperHeader(gvTrainResult); checkHead = "T"; } } } else { gvTrainResult.Visible = false; } #endregion #region gvOther DTO.ResponseService <DTO.ValidateLicense[]> result5 = biz.GetPropLiecense(this.LicenseTypeCode, this.PettionTypeCode, Convert.ToInt16(this.CurrentLicenseRenewTime), 5); if (result5.DataResponse.Count() > 0) { gvOther.DataSource = result5.DataResponse; gvOther.DataBind(); gvOther.Visible = true; // this.GridviewOther = result5.DataResponse.ToList(); //Create Head Genaral if (gvTrainResult.Controls.Count > 0) { //AddSuperHeader(gvOther); } else { if (checkHead != "T") { AddSuperHeader(gvOther); checkHead = "T"; } } } else { gvOther.Visible = false; } #endregion UpdatePanelSearch.Update(); MPDetailLicense.Show(); }
private void chkValidatePropLicenseApp(GridView gv, string mode) { LicenseBiz biz = new LicenseBiz(); foreach (GridViewRow row in gv.Rows) { Label lblID = (Label)row.FindControl("lblID"); Label lblItemName = (Label)row.FindControl("lblItemName"); Image impCorrect = (Image)row.FindControl("impCorrect"); Image impdisCorrect = (Image)row.FindControl("impdisCorrect"); //Single License if (mode.Equals(DTO.LicensePropMode.General.GetEnumValue().ToString())) { // var result = text.Where(l => l.Equals(lblItemName.Text.Trim())).FirstOrDefault(); if (gv.ID.Equals("gvGeneral")) { impCorrect.Visible = true; impdisCorrect.Visible = true; //1 บรรลุนิติภาวะ //6 มีภูมิลำเนาในประเทศไทย //7 ไม่เป็นคนวิกลจริตหรือจิตฟั่นเฟือนไม่สมประกอบ //8 ไม่เคยต้องโทษจำคุกโดยคำพิพากษาถึงที่สุดให้จำคุก ในความผิดเกี่ยวกับทรัพย์ที่กระทำโดยทุจริต เว้นแต่พ้นโทษมาแล้วไม่น้อยกว่าห้าปีก่อนวันขอรับใบอนุญาต //9 ไม่เป็นบุคคลล้มละลาย //11 ไม่เป็นตัวแทนประกันชีวิต //13 ไม่เคยถูกเพิกถอนใบอนุญาตเป็นตัวแทนประกันชีวิต หรือใบอนุญาตเป็นนายหน้าประกันชีวิต ระยะเวลาห้าปีก่อนวันขอรับใบอนุญาต switch (lblID.Text) { case "1": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "6": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "7": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "8": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "9": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "10": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "11": if (this.LicenseTypeCode.Equals("03")) { impCorrect.Visible = true; impdisCorrect.Visible = false; } else if (this.LicenseTypeCode.Equals("04")) { impCorrect.Visible = true; impdisCorrect.Visible = false; } else { impdisCorrect.Visible = true; impCorrect.Visible = false; } break; case "12": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "13": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "15": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "16": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "19": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "22": impCorrect.Visible = true; impdisCorrect.Visible = false; break; } UpdatePanelSearch.Update(); } else if (gv.ID.Equals("gvExamResult")) { //2 ผลสอบ impCorrect.Visible = true; impdisCorrect.Visible = true; switch (lblID.Text) { case "2": impCorrect.Visible = true; impdisCorrect.Visible = false; break; } UpdatePanelSearch.Update(); } else if (gv.ID.Equals("gvEducation")) { impCorrect.Visible = true; impdisCorrect.Visible = true; //3 สำเร็จการศึกษาไม่ต่ำกว่าปริญญาตรี วิชาการประกันชีวิตไม่ต่ำกว่าชั้นปริญญาตรีหรือเทียบเท่าไม่น้อยกว่า 6 หน่วยกิต switch (lblID.Text) { case "3": impdisCorrect.Visible = true; impCorrect.Visible = false; break; case "17": impCorrect.Visible = true; impdisCorrect.Visible = false; break; } UpdatePanelSearch.Update(); } else if (gv.ID.Equals("gvTrainResult")) { impCorrect.Visible = true; impdisCorrect.Visible = true; //4 ผลอบรม switch (lblID.Text) { case "4": impCorrect.Visible = true; impdisCorrect.Visible = false; break; } UpdatePanelSearch.Update(); } else if (gv.ID.Equals("gvOther")) { impCorrect.Visible = true; impdisCorrect.Visible = true; //5 รูปถ่าย //14 มีการชำระค่าธรรมเนียมค่าขอรับใบอนุญาต //18 มีการชำระค่าธรรมเนียมค่ขอต่ออายุใบอนุญาต switch (lblID.Text) { case "5": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "14": impCorrect.Visible = true; impdisCorrect.Visible = false; break; case "18": impCorrect.Visible = true; impdisCorrect.Visible = false; break; } UpdatePanelSearch.Update(); } } } }
private void Init() { LicenseBiz biz = new LicenseBiz(); #region Header Init List<PersonLicenseHead> headerls = new List<PersonLicenseHead>(); // TODO: Initialize to an appropriate value PersonLicenseHead headEnt = new PersonLicenseHead(); headEnt.APPROVE_COMPCODE = "111"; headEnt.APPROVED_BY = null; headEnt.APPROVED_DATE = null; headEnt.APPROVED_DOC = "W"; headEnt.COMP_CODE = null; headEnt.COMP_NAME = null; headEnt.FILENAME = null; headEnt.FLAG_LIC = null; headEnt.FLAG_REQ = null; headEnt.LICENSE_TYPE_CODE = "03"; headEnt.LOTS = 1; headEnt.MONEY = 200; headEnt.PAYMENT_NO = null; headEnt.PETITION_TYPE_CODE = "16"; headEnt.REQUEST_NO = null; headEnt.TRAN_DATE = Convert.ToDateTime("1/7/2557"); headEnt.UPLOAD_BY_SESSION = "140609145948540"; headEnt.UPLOAD_GROUP_NO = "140701152850898"; headerls.Add(headEnt); #endregion #region Detail Init List<PersonLicenseDetail> detaills = new List<PersonLicenseDetail>(); // TODO: Initialize to an appropriate value PersonLicenseDetail detailEnt = new PersonLicenseDetail(); detailEnt.ADDRESS_1 = "asdfasfdasf"; detailEnt.ADDRESS_2 = null; detailEnt.APPROVED = "W"; detailEnt.APPROVED_BY = null; detailEnt.APPROVED_DATE = null; detailEnt.AR_DATE = Convert.ToDateTime("1/1/0544"); detailEnt.AREA_CODE = "10"; detailEnt.CURRENT_ADDRESS_1 = "asdfasfdasf"; detailEnt.CURRENT_ADDRESS_2 = null; detailEnt.CURRENT_AREA_CODE = "10"; detailEnt.EMAIL = "*****@*****.**"; detailEnt.ERR_DESC = null; detailEnt.FEES = 200; detailEnt.HEAD_REQUEST_NO = null; detailEnt.ID_CARD_NO = "1589900053854"; detailEnt.LASTNAME = "มุ่งดี"; detailEnt.LICENSE_DATE = null; detailEnt.LICENSE_EXPIRE_DATE = null; detailEnt.LICENSE_NO = "5603007789"; detailEnt.NAMES = "เบญจมาส"; detailEnt.OLD_COMP_CODE = null; detailEnt.ORDERS = null; detailEnt.PAY_EXPIRE = Convert.ToDateTime("21/5/2558"); detailEnt.PRE_NAME_CODE = "2"; detailEnt.RENEW_TIMES = "1"; detailEnt.REQUEST_NO = null; detailEnt.SEQ_NO = "0001"; detailEnt.TITLE_NAME = "นางสาว"; detailEnt.UPLOAD_GROUP_NO = "140701152850898"; detaills.Add(detailEnt); #endregion #region UserProfile Init UserProfile userProfile = new UserProfile(); // TODO: Initialize to an appropriate value userProfile.AgentType = "Z"; userProfile.CompCode = null; userProfile.DepartmentCode = null; userProfile.DepartmentName = null; userProfile.DeptCode = null; userProfile.EmployeeCode = null; userProfile.EmployeeName = null; userProfile.Id = "140609145948540"; userProfile.IdCard = "1589900053854"; userProfile.IS_APPROVE = "Y"; userProfile.LastName = null; userProfile.LicenseNo = null; userProfile.LoginName = "1589900053854"; userProfile.LoginStatus = "0"; userProfile.MemberType = 1; userProfile.Name = "เบญจมาส มุ่งดี"; userProfile.OIC_EMP_NO = null; userProfile.OIC_User_Id = null; userProfile.OIC_User_Type = null; userProfile.PositionCode = null; userProfile.PositionName = null; userProfile.STATUS = "2"; userProfile.TitleName = null; userProfile.UserGroup = null; #endregion #region AttatchFileLicense Init List<AttatchFileLicense> files = new List<AttatchFileLicense>(); // TODO: Initialize to an appropriate value int count = 2; for (int i = 0; i < count; i++) { AttatchFileLicense file = new AttatchFileLicense(); if (i == 1) { file.ATTACH_FILE_PATH = "Temp\\140609145948540\\140701152905098_03.jpg"; file.ATTACH_FILE_TYPE = "03"; file.CREATED_BY = "1589900053854"; file.CREATED_DATE = Convert.ToDateTime("1/7/2557"); file.FILE_STATUS = "W"; file.GROUP_LICENSE_ID = "140701152850898"; file.ID_ATTACH_FILE = "140609145948540"; file.ID_CARD_NO = "1589900053854"; file.LICENSE_NO = null; file.REMARK = "hhh"; file.RENEW_TIME = null; file.UPDATED_BY = "1589900053854"; file.UPDATED_DATE = Convert.ToDateTime("1/7/2557"); } else { file.ATTACH_FILE_PATH = "Temp\\140609145948540\\140701153226031_65.jpg"; file.ATTACH_FILE_TYPE = "65"; file.CREATED_BY = "1589900053854"; file.CREATED_DATE = Convert.ToDateTime("1/7/2557"); file.FILE_STATUS = "W"; file.GROUP_LICENSE_ID = "140701153215473"; file.ID_ATTACH_FILE = "140609145948540"; file.ID_CARD_NO = "1589900053854"; file.LICENSE_NO = null; file.REMARK = ""; file.RENEW_TIME = null; file.UPDATED_BY = "1589900053854"; file.UPDATED_DATE = Convert.ToDateTime("1/7/2557"); } files.Add(file); } #endregion DTO.ResponseMessage<bool> resInsertLicense = biz.InsertPersonLicense(headerls.ToArray(), detaills.ToArray(), userProfile, files.ToArray()); if (resInsertLicense.ResultMessage == true) { lblRes.ForeColor = System.Drawing.Color.Green; lblRes.Text = Convert.ToString(resInsertLicense.ResultMessage); } else { lblRes.ForeColor = System.Drawing.Color.Red; lblRes.Text = resInsertLicense.ErrorMsg; } }
protected void btnPayment_Click(object sender, EventArgs e) { PaymentBiz biz = new PaymentBiz(); LicenseBiz bizLicense = new LicenseBiz(); string ref1 = string.Empty; string group = string.Empty; string headrequestNo = string.Empty; StringBuilder ChkUpload = new StringBuilder(); if (this.ucLicensePaymentY.GridPayment.Rows.Count <= 0) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = SysMessage.LicenseYNotFound; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } else { #region Get UploadGroupNo for (int i = 0; i < ucLicensePaymentY.GridPayment.Rows.Count; i++) { CheckBox chkDelete = (CheckBox)ucLicensePaymentY.GridPayment.Rows[i].Cells[0].FindControl("chkBxSelect"); if (chkDelete != null) { if (chkDelete.Checked) { HiddenField hf = (HiddenField)ucLicensePaymentY.GridPayment.Rows[i].Cells[0].FindControl("HiddenField1"); if (hf.Value != null) { //Get DTO.ResponseService <DTO.PersonLicenseTransaction> resD = bizLicense.GetLicenseDetailByUploadGroupNo(hf.Value); if ((resD.DataResponse != null) && (!resD.IsError)) { ///Get & Set SubGroupPayment var resLS = this.MasterLicense.lsLicensePayment.Where(ls => ls.uploadG == resD.DataResponse.UPLOAD_GROUP_NO).FirstOrDefault(); if (resLS == null) { this.MasterLicense.lsLicensePayment.Add(new DTO.SubGroupPayment { uploadG = resD.DataResponse.UPLOAD_GROUP_NO, LicenseNo = resD.DataResponse.LICENSE_NO, RenewTime = resD.DataResponse.RENEW_TIMES, seqNo = resD.DataResponse.SEQ_NO, PaymentType = resD.DataResponse.PETITION_TYPE_CODE }); this.MasterLicense.ListUploadGroupNo.Add(hf.Value); } } } } } } #endregion //ตรวจสอบรายการต่อใบสั่งจ่าย @1/7/2557 int getSumConfig = GetSumConfigViewBillPayment(); if (this.MasterLicense.ListUploadGroupNo.Count > getSumConfig) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = "กรุณาตรวจสอบจำนวนรายการใบอนุญาตที่ต้องการออกใบสั่งจ่าย"; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } #region สร้างใบสั่งจ่ายย่อย > NewCreatePayment DTO.ResponseService <string> res = biz.SetSubGroupSingleLicense(this.MasterLicense.lsLicensePayment.ToArray(), this.UserProfile.Id, this.UserProfile.Id, out ref1); if ((res.DataResponse != null) && (!res.IsError)) { this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowMessageSuccess = SysMessage.CreatePaymentSuccess; this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowModalSuccess(); this.MasterLicense.UpdatePanelLicense.Update(); group = ref1; ChkUpload.Append(group); ChkUpload.Append(" "); ChkUpload.Append(this.UserProfile.Id); //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + group + "')", true); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + ChkUpload.ToString() + "')", true); this.MasterLicense.lsLicensePayment.Clear(); this.MasterLicense.ListUploadGroupNo.Clear(); this.MasterLicense.PersonLicenseD.Clear(); this.MasterLicense.PersonLicenseH.Clear(); this.GetLicenseDetail(); } else { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } //this.MasterLicense.lsLicensePayment.Clear(); //this.MasterLicense.ListUploadGroupNo.Clear(); #endregion } }
protected void TabDetail_ActiveTabChanged(object sender, EventArgs e) { LicenseBiz biz = new LicenseBiz(); ViewState["ActiveTabIndex"] = TabDetail.ActiveTabIndex; if (Session["idCardNo"] != null) { var IDCard = Session["idCardNo"].ToString(); if (TabDetail.ActiveTabIndex == 0) { var res = biz.GetPersonalHistoryByIdCard(IDCard); if (res.IsError) { //UCModalError.ShowMessageError = res.ErrorMsg; //UCModalError.ShowModalError(); } else { var person = res.DataResponse; if (res.DataResponse != null) { if (!string.IsNullOrEmpty(person.FLNAME)) { txtFirstNameLastName.Text = person.FLNAME; } if (!string.IsNullOrEmpty(person.ID_CARD_NO)) { txtIdCard.Text = person.ID_CARD_NO; } if (!string.IsNullOrEmpty(person.SEX)) { if (person.SEX != "M") { txtSex.Text = Resources.propLicenseGroup_Female; } else { txtSex.Text = Resources.propLicenseGroup_Male; } } if (!string.IsNullOrEmpty(person.NATIONALITY)) { txtNationality.Text = person.NATIONALITY; } if (!string.IsNullOrEmpty(person.EDUCATION_NAME)) { txtEducation.Text = person.EDUCATION_NAME; } if (person.BIRTH_DATE.ToString() != null || person.BIRTH_DATE.ToString() != "") { txtBirthDay.Text = person.BIRTH_DATE.ToString("dd/MM/yyyy"); } if (!string.IsNullOrEmpty(person.ADDRESS1)) { txtCurrentAddress.Text = person.ADDRESS1; } if (!string.IsNullOrEmpty(person.PROVINCE)) { txtProvinceCurrentAddress.Text = person.PROVINCE; } if (!string.IsNullOrEmpty(person.AMPUR)) { txtDistrictCurrentAddress.Text = person.AMPUR; } if (!string.IsNullOrEmpty(person.TAMBON)) { txtParishCurrentAddress.Text = person.TAMBON; } if (!string.IsNullOrEmpty(person.ZIPCODE)) { txtPostcodeCurrentAddress.Text = person.ZIPCODE; } if (!string.IsNullOrEmpty(person.LOCAL_ADDRESS1)) { txtRegisterAddress.Text = person.LOCAL_ADDRESS1; } if (!string.IsNullOrEmpty(person.LOCAL_PROVINCE)) { txtProvinceRegisterAddress.Text = person.LOCAL_PROVINCE; } if (!string.IsNullOrEmpty(person.LOCAL_AMPUR)) { txtDistrictRegisterAddress.Text = person.LOCAL_AMPUR; } if (!string.IsNullOrEmpty(person.LOCAL_TAMBON)) { txtParishRegisterAddress.Text = person.LOCAL_TAMBON; } if (!string.IsNullOrEmpty(person.LOCAL_ZIPCODE)) { txtPostcodeRegisterAddress.Text = person.LOCAL_ZIPCODE; } EnableControl(); // UpdatePanelSearch.Update(); PopupDetail.Show(); } } } else if (TabDetail.ActiveTabIndex == 1) { var res = biz.GetExamHistoryByIdCard(IDCard); if (res.IsError) { //UCModalError.ShowMessageError = res.ErrorMsg; //UCModalError.ShowModalError(); } else { gvHistoryExam.DataSource = res.DataResponse; gvHistoryExam.DataBind(); gvHistoryExam.Visible = true; // UpdatePanelSearch.Update(); PopupDetail.Show(); } } else if (TabDetail.ActiveTabIndex == 2) { //var res = biz.GetTrainingHistoryBy(IDCard); var res = biz.GetTrainingHistoryBy(IDCard); if (res.IsError) { //UCModalError.ShowMessageError = res.ErrorMsg; //UCModalError.ShowModalError(); } else { gvHistoryTraining.DataSource = res.DataResponse; gvHistoryTraining.DataBind(); gvHistoryTraining.Visible = true; //UpdatePanelSearch.Update(); PopupDetail.Show(); } } //else if (TabDetail.ActiveTabIndex == 3) //{ // var res = biz.GetTrain_1_To_4_ByIdCard(IDCard); // if (res.IsError) // { // //UCModalError.ShowMessageError = res.ErrorMsg; // //UCModalError.ShowModalError(); // } // else // { // GvTraining.DataSource = res.DataResponse; // GvTraining.DataBind(); // // UpdatePanelSearch.Update(); // PopupDetail.Show(); // } //} //else if (TabDetail.ActiveTabIndex == 4) //{ // var res = biz.GetUnitLinkByIdCard(IDCard); // if (res.IsError) // { // //UCModalError.ShowMessageError = res.ErrorMsg; // //UCModalError.ShowModalError(); // } // else // { // gvUnitLink.DataSource = res.DataResponse; // gvUnitLink.DataBind(); // //UpdatePanelSearch.Update(); // PopupDetail.Show(); // } //} else if (TabDetail.ActiveTabIndex == 3) { //var res = biz.GetRenewLicneseByIdCard(IDCard); var res = biz.GetObtainLicenseByIdCard(IDCard); if (res.IsError) { //UCModalError.ShowMessageError = res.ErrorMsg; //UCModalError.ShowModalError(); } else { gvObtainLicense.DataSource = res.DataResponse; gvObtainLicense.DataBind(); gvObtainLicense.Visible = true; //UpdatePanelSearch.Update(); PopupDetail.Show(); } } PopupDetail.Show(); //UplPopUp.Update(); } else { } }
public void FirstTabDataBind(string IDCard) { LicenseBiz biz = new LicenseBiz(); var res = biz.GetPersonalHistoryByIdCard(IDCard); // if (res.DataResponse==null) // { // ucmodalerror.showmessageerror = res.errormsg; // ucmodalerror.showmodalerror(); //} if (res.DataResponse != null) { DTO.PersonalHistory person = res.DataResponse; if (res.DataResponse != null) { if (!string.IsNullOrEmpty(person.FLNAME)) { txtFirstNameLastName.Text = person.FLNAME; } if (!string.IsNullOrEmpty(person.ID_CARD_NO)) { txtIdCard.Text = person.ID_CARD_NO; } if (!string.IsNullOrEmpty(person.SEX)) { if (person.SEX != "M") { txtSex.Text = Resources.propLicenseGroup_Female; } else { txtSex.Text = Resources.propLicenseGroup_Male; } } if (!string.IsNullOrEmpty(person.NATIONALITY)) { txtNationality.Text = person.NATIONALITY; } if (!string.IsNullOrEmpty(person.EDUCATION_NAME)) { txtEducation.Text = person.EDUCATION_NAME; } if (person.BIRTH_DATE.ToString() != null || person.BIRTH_DATE.ToString() != "") { txtBirthDay.Text = person.BIRTH_DATE.ToString("dd/MM/yyyy"); } if (!string.IsNullOrEmpty(person.ADDRESS1)) { txtCurrentAddress.Text = person.ADDRESS1; } if (!string.IsNullOrEmpty(person.PROVINCE)) { txtProvinceCurrentAddress.Text = person.PROVINCE; } if (!string.IsNullOrEmpty(person.AMPUR)) { txtDistrictCurrentAddress.Text = person.AMPUR; } if (!string.IsNullOrEmpty(person.TAMBON)) { txtParishCurrentAddress.Text = person.TAMBON; } if (!string.IsNullOrEmpty(person.ZIPCODE)) { txtPostcodeCurrentAddress.Text = person.ZIPCODE; } if (!string.IsNullOrEmpty(person.LOCAL_ADDRESS1)) { txtRegisterAddress.Text = person.LOCAL_ADDRESS1; } if (!string.IsNullOrEmpty(person.LOCAL_PROVINCE)) { txtProvinceRegisterAddress.Text = person.LOCAL_PROVINCE; } if (!string.IsNullOrEmpty(person.LOCAL_AMPUR)) { txtDistrictRegisterAddress.Text = person.LOCAL_AMPUR; } if (!string.IsNullOrEmpty(person.LOCAL_TAMBON)) { txtParishRegisterAddress.Text = person.LOCAL_TAMBON; } if (!string.IsNullOrEmpty(person.LOCAL_ZIPCODE)) { txtPostcodeRegisterAddress.Text = person.LOCAL_ZIPCODE; } EnableControl(); ClearGridView(); } } else { this.ucLicDetailModelWarning.ShowMessageWarning = Resources.errorucLicenseDetail_001 + IDCard; this.ucLicDetailModelWarning.ShowModalWarning(); this.udpLicenseDetail.Update(); //return; PopupDetail.Hide(); } }
private void GetSelectedRecord() { LicenseBiz bizLicense = new LicenseBiz(); for (int i = 0; i < gvPayment.Rows.Count; i++) { CheckBox rb = (CheckBox)gvPayment.Rows[i].Cells[0].FindControl("chkSelect"); if (rb != null) { HiddenField hf = (HiddenField)gvPayment.Rows[i].Cells[0].FindControl("HiddenField1"); if (rb.Checked) { //HiddenField hf = (HiddenField)gvPayment.Rows[i].Cells[0].FindControl("HiddenField1"); if (hf != null) { this.MasterLicense.SelectedUploadGroupNo = hf.Value; if (this.MasterLicense.lsLicensePayment.Count > 0) { DTO.ResponseService <DTO.PersonLicenseTransaction[]> resLicense = bizLicense.getViewPersonLicense(this.MasterLicense.UserProfile.IdCard, "A"); if (resLicense.DataResponse != null) { DTO.PersonLicenseTransaction licenseD = resLicense.DataResponse.Where(gno => gno.UPLOAD_GROUP_NO == hf.Value).FirstOrDefault(); if (licenseD != null) { ///Get & Set SubGroupPayment this.MasterLicense.lsLicensePayment.Add(new DTO.SubGroupPayment { uploadG = licenseD.UPLOAD_GROUP_NO, LicenseNo = licenseD.LICENSE_NO, RenewTime = licenseD.RENEW_TIMES, seqNo = licenseD.SEQ_NO, PaymentType = licenseD.PETITION_TYPE_CODE }); } } } else { DTO.ResponseService <DTO.PersonLicenseTransaction[]> resLicense = bizLicense.getViewPersonLicense(this.MasterLicense.UserProfile.IdCard, "A"); if (resLicense.DataResponse != null) { DTO.PersonLicenseTransaction licenseD = resLicense.DataResponse.Where(gno => gno.UPLOAD_GROUP_NO == hf.Value).FirstOrDefault(); if (licenseD != null) { ///Get & Set SubGroupPayment this.MasterLicense.lsLicensePayment.Add(new DTO.SubGroupPayment { uploadG = licenseD.UPLOAD_GROUP_NO, LicenseNo = licenseD.LICENSE_NO, RenewTime = licenseD.RENEW_TIMES, seqNo = licenseD.SEQ_NO, PaymentType = licenseD.PETITION_TYPE_CODE }); } } //this.MasterLicense.ListUploadGroupNo.Add(this.MasterLicense.SelectedUploadGroupNo); } //this.MasterLicense.ListUploadGroupNo.Add(this.MasterLicense.SelectedUploadGroupNo); } break; } else { //HiddenField hf = (HiddenField)gvPayment.Rows[i].Cells[0].FindControl("HiddenField1"); if (hf != null) { this.MasterLicense.SelectedUploadGroupNo = hf.Value; this.MasterLicense.ListUploadGroupNo.Remove(this.MasterLicense.SelectedUploadGroupNo); } break; } } } }
protected void btnNext_Click(object sender, ImageClickEventArgs e) { LicenseBiz biz = new LicenseBiz(); DTO.ResponseMessage <bool> resInsert = new ResponseMessage <bool>(); if (rdPayment.Checked == true) { resInsert = this.MasterLicense.InsertLicense(); if (resInsert.ResultMessage == true) { this.MasterLicense.Step += 1; Response.Redirect("../License/LicensePayment.aspx?M=" + MasterLicense.Menu + "&S=" + MasterLicense.Step + ""); } else if ((resInsert.ResultMessage == false) || (resInsert.IsError)) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = resInsert.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } } else if (rdLicenseList.SelectedValue.Equals(Convert.ToString((int)DTO.PersonLicenses.New))) { this.MasterLicense.Menu = 1; this.MasterLicense.Step = 1; Session["CheckClearSession"] = "P"; this.MasterLicense.Redo = "1"; Response.Redirect("../License/NewLicense.aspx?M=" + MasterLicense.Menu + "&S=" + MasterLicense.Step + ""); } else if (rdLicenseList.SelectedValue.Equals(Convert.ToString((int)DTO.PersonLicenses.ReNew))) { this.MasterLicense.Menu = 2; this.MasterLicense.Step = 1; Session["CheckClearSession"] = "P"; this.MasterLicense.Redo = "1"; Response.Redirect("../License/RenewLicense.aspx?M=" + MasterLicense.Menu + "&S=" + MasterLicense.Step + ""); } else if (rdLicenseList.SelectedValue.Equals(Convert.ToString((int)DTO.PersonLicenses.ExpireReNew))) { this.MasterLicense.Menu = 3; this.MasterLicense.Step = 1; Session["CheckClearSession"] = "P"; this.MasterLicense.Redo = "1"; Response.Redirect("../License/ExpiredRenewLicense.aspx?M=" + MasterLicense.Menu + "&S=" + MasterLicense.Step + ""); } else if (rdLicenseList.SelectedValue.Equals(Convert.ToString((int)DTO.PersonLicenses.Other))) { this.MasterLicense.Menu = 4; this.MasterLicense.Step = 1; Session["CheckClearSession"] = "P"; this.MasterLicense.Redo = "1"; Response.Redirect("../License/LicenseReplace.aspx?M=" + MasterLicense.Menu + "&S=" + MasterLicense.Step + ""); } else { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = Resources.errorLicenseContinue_001; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } }
protected void btnPayment_Click(object sender, EventArgs e) { PaymentBiz biz = new PaymentBiz(); LicenseBiz bizLicense = new LicenseBiz(); string ref1 = string.Empty; string group = string.Empty; string headrequestNo = string.Empty; StringBuilder ChkUpload = new StringBuilder(); this.MasterLicense.lsLicensePayment.Clear(); if (this.gvLicenseD.Rows.Count <= 0) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = SysMessage.LicenseYNotFound; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); } else { #region Get UploadGroupNo for (int i = 0; i < gvLicenseD.Rows.Count; i++) { HiddenField hf = (HiddenField)gvLicenseD.Rows[i].Cells[0].FindControl("hdfGroupUpLoadNo"); if (hf.Value != null) { //Get PersonLicenseTransaction from List //var resD = this.CurrentSessionListDT.FirstOrDefault(idx => idx.UPLOAD_GROUP_NO.Equals(hf.Value)); var resD = this.SessionListDT.FirstOrDefault(idx => idx.UPLOAD_GROUP_NO.Equals(hf.Value)); if (resD != null) { ///Get & Set SubGroupPayment this.MasterLicense.lsLicensePayment.Add(new DTO.SubGroupPayment { RUN_NO = resD.RUN_NO, uploadG = resD.UPLOAD_GROUP_NO, LicenseNo = resD.LICENSE_NO, RenewTime = resD.RENEW_TIMES, seqNo = resD.SEQ_NO, PaymentType = resD.PETITION_TYPE_CODE }); this.MasterLicense.ListUploadGroupNo.Add(hf.Value); } } } #endregion #region สร้างใบสั่งจ่ายย่อย > NewCreatePayment DTO.ResponseService <string> res = biz.SetSubGroupSingleLicense(this.MasterLicense.lsLicensePayment.ToArray(), this.UserProfile.Id, this.UserProfile.Id, out ref1); if ((res.DataResponse != null) && (!res.IsError)) { this.PaymentStatus = true; this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowMessageSuccess = SysMessage.CreatePaymentSuccess; this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowModalSuccess(); this.MasterLicense.UpdatePanelLicense.Update(); group = ref1; ChkUpload.Append(group); ChkUpload.Append(" "); ChkUpload.Append(this.UserProfile.Id); GetAllLicense(); GetLicenseY(); //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + group + "')", true); } else { this.PaymentStatus = false; this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; //udpMain.Update(); } if (this.PaymentStatus == true) { ListPrintPayment.Add(group); var resPrint = biz.UpdatePrintGroupRequestNo(ListPrintPayment.ToArray()); //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + group + "')", true); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + ChkUpload.ToString() + "')", true); } #endregion } }
/// <summary> /// Open Popup for sort by SEQ_OF_GROUP /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <AUTHOR>Natta</AUTHOR> protected void btnSortPopup_Click(object sender, EventArgs e) { LicenseBiz bizLicense = new LicenseBiz(); this.SessionListDT = new List <DTO.PersonLicenseTransaction>(); this.CheckList = new List <bool>(); if (this.ucLicensePaymentY.GridPayment.Rows.Count <= 0) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = SysMessage.LicenseYNotFound; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); } else { #region Get UploadGroupNo for (int i = 0; i < ucLicensePaymentY.GridPayment.Rows.Count; i++) { CheckBox chkDelete = (CheckBox)ucLicensePaymentY.GridPayment.Rows[i].Cells[0].FindControl("chkBxSelect"); if (chkDelete != null) { this.CheckList.Add(chkDelete.Checked); if (chkDelete.Checked) { HiddenField hf = (HiddenField)ucLicensePaymentY.GridPayment.Rows[i].Cells[0].FindControl("HiddenField1"); if (hf.Value != null) { //Get DTO.ResponseService <DTO.PersonLicenseTransaction> resD = bizLicense.GetLicenseDetailByUploadGroupNo(hf.Value); if ((resD.DataResponse != null) && (!resD.IsError)) { ///Get & Set SubGroupPayment this.SessionListDT.Add(new DTO.PersonLicenseTransaction { UPLOAD_GROUP_NO = resD.DataResponse.UPLOAD_GROUP_NO, HEAD_REQUEST_NO = resD.DataResponse.HEAD_REQUEST_NO, FEES = resD.DataResponse.FEES, APPROVED_DOC = resD.DataResponse.APPROVED_DOC, PETITION_TYPE_CODE = resD.DataResponse.PETITION_TYPE_CODE, TRAN_DATE = resD.DataResponse.TRAN_DATE, SEQ_NO = resD.DataResponse.SEQ_NO }); //this.MasterLicense.ListUploadGroupNo.Add(hf.Value); } } } } } #endregion //ตรวจสอบรายการต่อใบสั่งจ่าย @1/7/2557 int getSumConfig = GetSumConfigViewBillPayment(); if (this.SessionListDT.Count > getSumConfig) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = "กรุณาตรวจสอบจำนวนรายการใบอนุญาตที่ต้องการออกใบสั่งจ่าย"; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } #region Open Popup and then add 'this.MasterLicense.lsLicensePayment' to gridview popup if (this.CheckList.Where(chk => chk == false).Count() == this.ucLicensePaymentY.GridPayment.Rows.Count) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = "กรุณาเลือกรายการก่อนออกใบสั่งจ่าย"; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); return; } else { //gvLicenseD.DataSource = this.SessionListDT; //this.LicenseNameConvertor(this.SessionListDT); gvLicenseD.DataSource = this.CreateIndex(this.SessionListDT); gvLicenseD.DataBind(); this.mdlLicenseD.Show(); } #endregion } }