private void InitDataToGrid() { try { TotalRows = TotalRow(); BLL.LicenseBiz LBIZ = new BLL.LicenseBiz(); txtNumberGvSearch.Text = (txtTotalPage.Text == LastPage().ToString() ? txtNumberGvSearch.Text : "1"); int Page = int.Parse(txtNumberGvSearch.Text); DateTime dateStart = Convert.ToDateTime(txtApproveDate.Text.Trim()); DateTime dateEnd = Convert.ToDateTime(txtExpireDate.Text.Trim()); string LicenseType = ddlLicenseType.SelectedValue; string CompCode = GetCompCode(); var res = LBIZ.GetLicenseDetailByCriteria(dateStart, dateEnd, txtIdCardNo.Text.Trim(), txtNames.Text.Trim(), txtLastname.Text.Trim(), LicenseType, CompCode, Page, rowsPerPage(), false); if (res.DataResponse != null) { gvLicenseDetail.DataSource = res.DataResponse; } gvLicenseDetail.DataBind(); SetControlPage(); CheckPageSelectAll(); bool havaRow = gvLicenseDetail.Rows.Count > 0; CheckBox H = (CheckBox)gvLicenseDetail.HeaderRow.FindControl("headSelected") as CheckBox; H.Enabled = havaRow; btnDownloadZip.Visible = havaRow; lblTotalRows.Text = String.Format("จำนวน {0} รายการ", TotalRows); ctrGridView.Visible = true; } catch (Exception ex) { UCModalError.ShowMessageError = ex.Message; UCModalError.ShowModalError(); } }
protected void btnUload_Click(object sender, EventArgs e) { //Copy ด้านล่างไปใช้งาน var biz = new BLL.LicenseBiz(); //ใช้จริงให้ใช้ basepage.UploadTempPath string temp = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["UploadTempPath"]); string autoId = biz.GetAutoId(); string tempFolder = temp + autoId; Directory.CreateDirectory(tempFolder); string tempFile = tempFolder + @"\" + fUpload.FileName; fUpload.SaveAs(tempFile); //var res = biz.UploadData(autoId, tempFile, temp, @"~/UploadTemp/", "test", "", ""); //Copy ถึงตรงนี้ //var res = biz.ExtractFile(fUpload.PostedFile.FileName, temp); //gv.DataSource = res; //gv.DataBind(); }
private void GetLicenseVerify() { BLL.LicenseBiz biz = new BLL.LicenseBiz(); Func <string, string> GetCrit = anyString => { return(string.IsNullOrEmpty(anyString) ? string.Empty : anyString); }; string strLicenseType = GetCrit(ddlLicenseType.SelectedValue); if (!string.IsNullOrEmpty(txtStartDate.Text) && !string.IsNullOrEmpty(txtEndDate.Text)) { DateTime dtStartDate = Convert.ToDateTime(GetCrit(txtStartDate.Text)); DateTime dtEndDate = Convert.ToDateTime(GetCrit(txtEndDate.Text)); var ls = biz.GetLicenseVerifyByRequest(strLicenseType, dtStartDate, dtEndDate, UserProfile.CompCode); DataSet ds = ls.DataResponse; gvDetail.DataSource = ds; gvDetail.DataBind(); } else { UCModalError.ShowMessageError = SysMessage.PleaseSelectDate; UCModalError.ShowModalError(); } }
protected void btnDownloadZip_Click(object sender, EventArgs e) { try { if (lsLicenseDetail != null && lsLicenseDetail.Count > 0) { BLL.LicenseBiz LBIZ = new BLL.LicenseBiz(); var res = LBIZ.GenZipFileLicenseByIdCardNo(lsLicenseDetail, base.UserProfile.LoginName); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { lsLicenseDetail = null; PageCheckAll = null; InitDataToGrid(); String dirZip = res.DataResponse; Response.Redirect(LinkRedirect(dirZip), true); } } else { InitDataToGrid(); UCModalError.ShowMessageError = "กรุณาเลือกรายการ"; UCModalError.ShowModalError(); } } catch (Exception ex) { UCModalError.ShowMessageError = ex.Message; UCModalError.ShowModalError(); } }
protected void btnExportExcel2_Click(object sender, ImageClickEventArgs e) { try { int total = lblTotalrecord2.Text == "" ? 0 : lblTotalrecord2.Text.ToInt(); if (total > base.EXCEL_SIZE_Key) { UCModalError.ShowMessageError = SysMessage.ExcelSizeError; UCModalError.ShowModalError(); UpdatePanelSearch.Update(); } else { Dictionary <string, string> columns = new Dictionary <string, string>(); columns.Add("ลำดับ", "RUN_NO"); columns.Add("เลขบัตรประชาชน", "ID_CARD_NO"); columns.Add("หมายเลขกลุ่ม", "UPLOAD_GROUP_NO"); columns.Add("หมายเลข", "SEQ_NO"); columns.Add("วันที่พิจารณา", "APPROVED_DATE"); columns.Add("ผู้พิจารณา", "NAME"); BLL.LicenseBiz biz = new BLL.LicenseBiz(); export.CreateExcel(biz.GetListLicenseDetailVerify(Session["UploadGroupNoGv"].ToString(), "N", 1, base.EXCEL_SIZE_Key).DataResponse.Tables[0], columns, base.UserProfile); } } catch { } }
protected void BindPage3() { PAGE_SIZE = Convert.ToInt32(txtInputMaxrow3.Text); BLL.LicenseBiz biz = new BLL.LicenseBiz(); var resultPage = txtNumberGvSearch3.Text.ToInt(); var ls = biz.GetLicenseVerifyImgDetail(lblGroupIdGv2.Text, lblIdCardGV2.Text, "N", resultPage, PAGE_SIZE); gvUpload.DataSource = ls.DataResponse; gvUpload.DataBind(); }
protected void BindPage2() { PAGE_SIZE = Convert.ToInt32(txtInputMaxrow2.Text); BLL.LicenseBiz biz = new BLL.LicenseBiz(); var resultPage = txtNumberGvSearch2.Text.ToInt(); var ls = biz.GetListLicenseDetailVerify(Session["UploadGroupNoGv"].ToString(), "N", resultPage, PAGE_SIZE); gvDetail.DataSource = ls.DataResponse; gvDetail.DataBind(); }
private double TotalRow() { BLL.LicenseBiz LBIZ = new BLL.LicenseBiz(); DateTime dateStart = Convert.ToDateTime(txtApproveDate.Text.Trim()); DateTime dateEnd = Convert.ToDateTime(txtExpireDate.Text.Trim()); string LicenseType = ddlLicenseType.SelectedValue; string CompCode = GetCompCode(); var res = LBIZ.GetLicenseDetailByCriteria(dateStart, dateEnd, txtIdCardNo.Text.Trim(), txtNames.Text.Trim(), txtLastname.Text.Trim(), LicenseType, CompCode, 0, 0, true).DataResponse; return(res == null ? 0 : double.Parse(res.Tables[0].Rows[0][0].ToString())); }
protected void btnExportExcel_Click(object sender, ImageClickEventArgs e) { try { int total = lblTotalrecord.Text == "" ? 0 : lblTotalrecord.Text.ToInt(); if (total > base.EXCEL_SIZE_Key) { UCModalError.ShowMessageError = SysMessage.ExcelSizeError; UCModalError.ShowModalError(); UpdatePanelSearch.Update(); } else { Dictionary <string, string> columns = new Dictionary <string, string>(); columns.Add("ลำดับ", "RUN_NO"); columns.Add("เลขที่ใบคำขออนุญาต", "UPLOAD_GROUP_NO"); columns.Add("ชื่อไฟล์", "FILENAME"); columns.Add("วันที่นำส่ง", "TRAN_DATE"); columns.Add("รูปแบบการขอใบอนุญาต", "PETITION_TYPE_NAME"); columns.Add("ประเภทการขอใบอนุญาต", "LICENSE_TYPE_NAME"); columns.Add("รายการทั้งหมด", "LOTS"); List <HeaderExcel> header = new List <HeaderExcel>(); header.Add(new HeaderExcel { NameColumnsOne = "ประเภท ", ValueColumnsOne = ddlLicenseType.SelectedItem.Text }); header.Add(new HeaderExcel { NameColumnsOne = "ตั้งแต่วันที่ ", ValueColumnsOne = txtStartDate.Text, NameColumnsTwo = "ถึงวันที่ ", ValueColumnsTwo = txtEndDate.Text }); BLL.LicenseBiz biz = new BLL.LicenseBiz(); Func <string, string> GetCrit = anyString => { return(string.IsNullOrEmpty(anyString) ? string.Empty : anyString); }; string strLicenseType = GetCrit(ddlLicenseType.SelectedValue); DateTime dtStartDate = Convert.ToDateTime(GetCrit(txtStartDate.Text == "" ? "" : txtStartDate.Text)); DateTime dtEndDate = Convert.ToDateTime(GetCrit(txtEndDate.Text == "" ? "" : txtEndDate.Text)); export.CreateExcel(biz.GetResultLicenseVerifyHead(strLicenseType, dtStartDate, dtEndDate, base.UserProfile.CompCode, "N", 1, base.EXCEL_SIZE_Key).DataResponse.Tables[0], columns, header, base.UserProfile); } } catch { } }
protected void btnOverAllApprove_Click(object sender, EventArgs e) { var data = new List <DTO.SubmitLicenseVerify>(); if (gvDetail.Visible == true) { foreach (GridViewRow gr in gvDetail.Rows) { if (((CheckBox)gr.FindControl("chkSelectVerify")).Checked == true) { var strSeqNo = (Label)gr.FindControl("lblIDNumberGv"); var strUploadGroupNo = (Label)gr.FindControl("lblGroupIDNumberGv"); data.Add(new DTO.SubmitLicenseVerify { SeqNo = strSeqNo.Text, UploadGroupNo = strUploadGroupNo.Text, }); } } } if (data != null) { var biz = new BLL.LicenseBiz(); var res = biz.ApproveLicenseVerify(data, "Y", base.UserProfile.CompCode); if (res.IsError) { var errorMsg = res.ErrorMsg; UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { UCModalSuccess.ShowMessageSuccess = SysMessage.Approval; UCModalSuccess.ShowModalSuccess(); GetLicenseVerify(); pnlDetail.Visible = false; hdfGroupNumber.Value = string.Empty; hdfNumber.Value = string.Empty; } } }
protected void LoadDataToViewer() { string LicenseType = Request.QueryString["LicenseType"].ToString(); string LicenseName = Request.QueryString["LicenseName"].ToString(); DateTime?DateStart = null; DateTime?DateEnd = null; string StringDate = string.Empty; if (!string.IsNullOrEmpty(Request.QueryString["DateStart"].ToString()) && !string.IsNullOrEmpty(Request.QueryString["DateEnd"].ToString())) { DateStart = Convert.ToDateTime(Request.QueryString["DateStart"].ToString()); DateEnd = Convert.ToDateTime(Request.QueryString["DateEnd"].ToString()); StringDate = "วันที่ " + ((DateTime)DateStart).ToLongDateString() + " ถึง " + ((DateTime)DateEnd).ToLongDateString(); } try { BLL.LicenseBiz biz = new BLL.LicenseBiz(); var res = biz.GetTopCompanyMoveOut(LicenseType, DateStart, DateEnd); if (res.IsError) { Response.Write(res.ErrorMsg); } else if (res.DataResponse != null) { DataSet ds = res.DataResponse; DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { rpt.Load(Server.MapPath(base.ReportFilePath_Key + "RptTopCompanyMoveOut.rpt")); rpt.SetDataSource(dt); rpt.SetParameterValue("paramLicenseName", (!string.IsNullOrEmpty(LicenseName)) ? "ประเภทใบอนุญาต " + LicenseName : ""); rpt.SetParameterValue("paramDate", StringDate); cryViewer.ReportSource = rpt; } else { Response.Write("ไม่พบข้อมูลที่ค้นหา.."); } } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void BindPage() { PAGE_SIZE = Convert.ToInt32(txtInputMaxrow.Text); var biz = new BLL.LicenseBiz(); var resultPage = txtNumberGvSearch.Text.ToInt(); var res = new DTO.ResponseService <DataSet>(); if (base.UserProfile.MemberType == DTO.RegistrationType.OIC.GetEnumValue() || base.UserProfile.MemberType == DTO.RegistrationType.OICAgent.GetEnumValue()) { res = biz.GetListLicenseDetailAdminByCriteria(txtLicenseNumber.Text , ddlLicenseType.SelectedValue , Convert.ToDateTime(txtstartDate.Text) , Convert.ToDateTime(txttoDate.Text) , "" , "" , base.UserProfile , resultPage , PAGE_SIZE, "N"); } else { if (base.UserRegType == DTO.RegistrationType.General) { res = biz.GetListLicenseDetailByPersonal("", "", null, null, "", "", base.UserProfile, resultPage, PAGE_SIZE, false); } else { res = biz.GetListLicenseDetailByCriteria(txtLicenseNumber.Text , ddlLicenseType.SelectedValue , Convert.ToDateTime(txtstartDate.Text) , Convert.ToDateTime(txttoDate.Text) , "" , "" , base.UserProfile , resultPage , PAGE_SIZE, "N"); } } gvSearch.DataSource = res.DataResponse; gvSearch.DataBind(); }
protected void BindPage() { PAGE_SIZE = Convert.ToInt32(txtInputMaxrow.Text); BLL.LicenseBiz biz = new BLL.LicenseBiz(); var resultPage = txtNumberGvSearch.Text.ToInt(); Func <string, string> GetCrit = anyString => { return(string.IsNullOrEmpty(anyString) ? string.Empty : anyString); }; string strLicenseType = GetCrit(ddlLicenseType.SelectedValue); DateTime dtStartDate = Convert.ToDateTime(GetCrit(txtStartDate.Text == "" ? "" : txtStartDate.Text)); DateTime dtEndDate = Convert.ToDateTime(GetCrit(txtEndDate.Text == "" ? "" : txtEndDate.Text)); var ls = biz.GetResultLicenseVerifyHead(strLicenseType, dtStartDate, dtEndDate, base.UserProfile.CompCode, "N", resultPage, PAGE_SIZE); gvHead.DataSource = ls.DataResponse; gvHead.DataBind(); }
protected void btnSubmit_Click(object sender, EventArgs e) { ReceiveLicenseHeader rech = new ReceiveLicenseHeader(); var arrCom = ddlCompany.SelectedValue.Split('[', ']'); rech.IMPORT_DATETIME = DateTime.Now; rech.PETTITION_TYPE = ddlRequestLicenseType.SelectedValue; rech.LICENSE_TYPE_CODE = rech.LICENSE_TYPE = ddlLicenseType.SelectedValue; rech.COMP_CODE = arrCom[1]; rech.COMP_NAME = arrCom[0]; rech.SEND_DATE = DateTime.Today; rech.TOTAL_AGENT = 1; rech.TOTAL_FEE = txtFee.Text.ToDecimal(); ReceiveLicenseDetail recd = new ReceiveLicenseDetail(); recd.IMPORT_ID = rech.IMPORT_ID; recd.PETITION_TYPE = rech.PETTITION_TYPE; recd.COMP_CODE = rech.COMP_CODE; recd.SEQ = "0001"; recd.LICENSE_FEE = txtFee.Text.ToDecimal(); recd.LICENSE_NO = txtLicenseNumber.Text; recd.CITIZEN_ID = base.IdCard; recd.TITLE_NAME = base.UserProfile.TitleName; recd.NAME = base.UserProfile.Name; recd.SURNAME = base.UserProfile.LastName; AttatchFileLicense att = new AttatchFileLicense(); UserProfile a = new DTO.UserProfile(); BLL.LicenseBiz biz = new BLL.LicenseBiz(); var res = biz.InsertSingleReceiveLicense(rech, recd, base.UserProfile); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { UCModalSuccess.ShowMessageSuccess = SysMessage.SuccessInsertLicenseSingle; UCModalSuccess.ShowModalSuccess(); } }
protected void gvUpload_PageIndexChanging(object sender, GridViewPageEventArgs e) { var gr = (GridViewRow)((LinkButton)sender).NamingContainer; Label lblIDNumberGv = (Label)gr.FindControl("lblGroupIDNumberGv"); Label lblIDCardGv = (Label)gr.FindControl("lblIDCardGv"); BLL.LicenseBiz biz = new BLL.LicenseBiz(); var ls = biz.GetLicenseVerifyImgDetail(lblIDNumberGv.Text, lblIDCardGv.Text, "N", 1, 20); if (ls.IsError) { UCModalError.ShowMessageError = ls.ErrorMsg; UCModalError.ShowModalError(); } else { gvUpload.PageIndex = e.NewPageIndex; gvUpload.DataBind(); } }
protected void gvDetail_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { CheckBox chkSelectVerify = ((CheckBox)e.Row.FindControl("chkSelectVerify")); Label status = ((Label)e.Row.FindControl("lblStatus")); Label statusName = ((Label)e.Row.FindControl("lblStatusName")); Label lblIDCardG = ((Label)e.Row.FindControl("lblIDCardGv")); Label lblGroupIDNumberGv = ((Label)e.Row.FindControl("lblGroupIDNumberGv")); LinkButton viewImg = ((LinkButton)e.Row.FindControl("hplViewImg")); if (status != null && !string.IsNullOrEmpty(status.Text)) { if (status.Text == "N") { statusName.Text = Resources.propSysMessage_LicenseApproveN; } else if (status.Text == "Y") { statusName.Text = Resources.propSysMessage_LicenseApproveP; } else if (status.Text == "W") { statusName.Text = Resources.propSysMessage_LicenseApproveW; } else { statusName.Text = ""; } } BLL.LicenseBiz biz = new BLL.LicenseBiz(); var res = biz.GetLicenseVerifyImgDetail(lblGroupIDNumberGv.Text, lblIDCardG.Text, "N", 1, 20); if (res.DataResponse.ToList().Count <= 0) { viewImg.Text = string.Empty; } } }
protected void btnTestDownload_Click(object sender, EventArgs e) { string dic = Server.MapPath("~/UploadFile"); var biz = new BLL.LicenseBiz(); biz.DownloadLicenseZip(Response, DateTime.Today, dic); //List<string> list = new List<string>(); //list.Add(dic); //GetAllFiles(list, dic); //string folderName = string.Empty; //using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) //{ // zip.AlternateEncodingUsage = ZipOption.AsNecessary; // for (int i = 0; i < list.Count; i++) // { // DirectoryInfo dInfo = new DirectoryInfo(list[i]); // folderName += (i == 0 ? "" : "\\") + dInfo.Name; // zip.AddDirectoryByName(folderName); // foreach (string f in Directory.GetFiles(list[i])) // { // zip.AddFile(f, folderName); // } // } // Response.Clear(); // Response.BufferOutput = false; // string zipName = String.Format("Zip_{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss")); // Response.ContentType = "application/zip"; // Response.AddHeader("content-disposition", "attachment; filename=" + zipName); // zip.Save(Response.OutputStream); // Response.End(); //} }
private List <Renew> GetData() { DateTime startDate = new DateTime(); DateTime endDate = new DateTime(); if (!DateTime.TryParse(txtApproveDate.Text.Trim(), out startDate)) { return(null); } if (!DateTime.TryParse(txtExpireDate.Text.Trim(), out endDate)) { return(null); } DTO.ResponseService <DateTime[]> res = new DTO.ResponseService <DateTime[]>(); using (BLL.LicenseBiz licenseBiz = new BLL.LicenseBiz()) { DTO.RangeDateRequest request = new DTO.RangeDateRequest() { StartDate = startDate, EndDate = endDate }; res = licenseBiz.GetLicenseRequestOicApprove(request); } if (res.IsError) { return(null); } lstRenew = new List <Renew>(); foreach (DateTime item in res.DataResponse) { lstRenew.Add(new Renew() { RenewDate = item }); } return(lstRenew); }
protected void loadFile_Click(object sender, EventArgs e) { try { var gr = (GridViewRow)((LinkButton)sender).NamingContainer; String lblTransectionDateGv = ((Label)gr.FindControl("lblTransectionDateGv")).Text; DateTime requestDate = new DateTime(); if (!DateTime.TryParseExact(lblTransectionDateGv, "dd/MM/yyyy hh:mm:ss", new CultureInfo("th-TH"), DateTimeStyles.None, out requestDate)) { UCModalError.ShowMessageError = SysMessage.DateErrorFormat; UCModalError.ShowModalError(); return; } String dirZip = ""; using (BLL.LicenseBiz licenseBiz = new BLL.LicenseBiz()) { var res = licenseBiz.GenZipFileLicenseRequest(requestDate, base.UserProfile.LoginName); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); return; } dirZip = res.DataResponse; } //Download(CryptoBase64.Decryption(dirZip)); Response.Redirect(LinkRedirect(dirZip), true); // ToolkitScriptManager.RegisterClientScriptBlock(UpdatePanelSearch, UpdatePanelSearch.GetType(), "เอกสาร", @"<script type='text/javascript'> PopDownload('"+dirZip+@"'); <\script> ", true); //UpdatePanelSearch.Update(); } catch (Exception ex) { return; } }
protected void TabDetail_ActiveTabChanged(object sender, EventArgs e) { try { LicenseBiz biz = new BLL.LicenseBiz(); //Tab 1 = ประวัติการสอบ if (TabDetail.ActiveTabIndex == 0) { //var res = biz.GetExamHistoryByID(this.UserProfile.IdCard); if (this.MasterLicense.CurrentExamPerson != null) { gvHistoryExam.DataSource = this.MasterLicense.CurrentExamPerson; gvHistoryExam.DataBind(); } else { DTO.ResponseService <DTO.ExamHistory[]> res = biz.GetExamHistoryByIDWithCondition(this.UserProfile.IdCard, this.MasterLicense.LicenseTypeCode); if (res.IsError) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } else { gvHistoryExam.DataSource = res.DataResponse; gvHistoryExam.DataBind(); } } //udpMain.Update(); } //Tab 2 = ประวัติการอบรม else if (TabDetail.ActiveTabIndex == 1) { //Old //var res = biz.GetTrainingHistoryByID(this.UserProfile.IdCard); if (this.MasterLicense.CurrentTrainPerson != null) { gvHistoryTraining.DataSource = this.MasterLicense.CurrentTrainPerson; gvHistoryTraining.DataBind(); } else { DTO.ResponseService <DTO.TrainPersonHistory[]> res = biz.GetTrainingHistoryByIDWithCondition(this.UserProfile.IdCard, this.MasterLicense.LicenseTypeCode); if ((res.IsError) || (res.DataResponse == null)) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } else { gvHistoryTraining.DataSource = res.DataResponse; gvHistoryTraining.DataBind(); } } } //Tab 3 = คุณสมบัติ 7(1)-(3) else if (TabDetail.ActiveTabIndex == 2) { var res = biz.GetTrain_3_To_7_ByID(this.UserProfile.IdCard); if (res.IsError) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } else { gvTraining.DataSource = res.DataResponse; gvTraining.DataBind(); //udpMain.Update(); } } //Tab 4 = ประวัติการอบรม Unit Link else if (TabDetail.ActiveTabIndex == 3) { var res = biz.GetUnitLinkByIDWithCondition(this.UserProfile.IdCard, this.MasterLicense.LicenseTypeCode); if (res.IsError) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } else { gvUnitLink.DataSource = res.DataResponse; gvUnitLink.DataBind(); //udpMain.Update(); } } //this.ucPerSkills.GetPersonalSkill(this.ucPerSkills.LicenseTypeCode, this.ucPerSkills.PettionTypeCode, this.ucPerSkills.CurrentLicenseRenewTime); udpMain.Update(); } catch { ApplicationException ex = new ApplicationException(); this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = ex.Message; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); return; } }
public void InitTab(object sender, EventArgs e) { var biz = new BLL.LicenseBiz(); var gr = (GridViewRow)((LinkButton)sender).NamingContainer; var idCardNo = (Label)gr.FindControl("lblIDNumberGv"); this.IDCardNo = idCardNo.Text; var IDCard = this.IDCardNo; if (TabDetail.ActiveTabIndex == 0) { var res = biz.GetPersonalHistoryByIdCard(IDCard); // if (res!=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(); PopupDetail.Show(); } //else //{ // PopupDetail.Hide(); // this.ucLicDetailModelError.ShowMessageError = "ไม่พบข้อมูลของเลขบัตรประชาชน " + IDCard; // this.ucLicDetailModelError.ShowModalError(); // this.udpLicenseDetail.Update(); // return; //} } } if (TabDetail.ActiveTabIndex == 1) { var resExam = biz.GetExamHistoryByIdCard(IDCard); if (resExam.IsError) { //UCModalError.ShowMessageError = resExam.ErrorMsg; //UCModalError.ShowModalError(); } else { gvHistoryExam.DataSource = resExam.DataResponse; gvHistoryExam.DataBind(); gvHistoryExam.Visible = true; //UpdatePanelSearch.Update(); PopupDetail.Show(); } } if (TabDetail.ActiveTabIndex == 2) { var resTraining = biz.GetTrainingHistoryBy(IDCard); if (resTraining.IsError) { //UCModalError.ShowMessageError = resTraining.ErrorMsg; //UCModalError.ShowModalError(); } else { gvHistoryTraining.DataSource = resTraining.DataResponse; gvHistoryTraining.DataBind(); gvHistoryTraining.Visible = true; //UpdatePanelSearch.Update(); PopupDetail.Show(); } } //if (TabDetail.ActiveTabIndex == 3) //{ // var resTrain = biz.GetTrain_1_To_4_ByIdCard(IDCard); // if (resTrain.IsError) // { // //UCModalError.ShowMessageError = resTrain.ErrorMsg; // //UCModalError.ShowModalError(); // } // else // { // GvTraining.DataSource = resTrain.DataResponse; // GvTraining.DataBind(); // //UpdatePanelSearch.Update(); // PopupDetail.Show(); // } //} //if (TabDetail.ActiveTabIndex == 4) //{ // var resUnit = biz.GetUnitLinkByIdCard(IDCard); // if (resUnit.IsError) // { // //UCModalError.ShowMessageError = resUnit.ErrorMsg; // //UCModalError.ShowModalError(); // } // else // { // gvUnitLink.DataSource = resUnit.DataResponse; // gvUnitLink.DataBind(); // //UpdatePanelSearch.Update(); // PopupDetail.Show(); // } //} if (TabDetail.ActiveTabIndex == 3) { var resRequest = biz.GetObtainLicenseByIdCard(IDCard); if (resRequest.IsError) { //UCModalError.ShowMessageError = resRequest.ErrorMsg; //UCModalError.ShowModalError(); } else { gvObtainLicense.DataSource = resRequest.DataResponse; gvObtainLicense.DataBind(); gvObtainLicense.Visible = true; //UpdatePanelSearch.Update(); PopupDetail.Show(); } } }
protected void hplViewDoc_Click(object sender, EventArgs e) { pnlAttach.Visible = false; var gv = (GridViewRow)((LinkButton)sender).NamingContainer; var strNumber = (Label)gv.FindControl("lblIDNumberGv"); var strGroupNumber = (Label)gv.FindControl("lblGroupIDNumberGv"); var status = (Label)gv.FindControl("lblStatus"); hdfNumber.Value = strNumber.Text; hdfGroupNumber.Value = strGroupNumber.Text; var biz = new BLL.LicenseBiz(); var res = biz.GetLicenseVerifyDetail(strGroupNumber.Text, strNumber.Text); pnlDetail.Visible = true; txtFirstName.Text = res.DataResponse.NAMES == "" ? "" : res.DataResponse.NAMES; txtLastName.Text = res.DataResponse.LASTNAME == "" ? "" : res.DataResponse.LASTNAME; txtIDNumber.Text = res.DataResponse.ID_CARD_NO == "" ? "" : res.DataResponse.ID_CARD_NO; txtTitle.Text = res.DataResponse.TITLE_NAME == "" ? "" : res.DataResponse.TITLE_NAME; txtDateLicense.Text = Convert.ToString(res.DataResponse.LICENSE_DATE) == "" ? "" : string.Format("{0:dd/MM/yyyy}", res.DataResponse.LICENSE_DATE); txtExpireDate.Text = Convert.ToString(res.DataResponse.LICENSE_EXPIRE_DATE) == "" ? "" : string.Format("{0:dd/MM/yyyy}", res.DataResponse.LICENSE_EXPIRE_DATE); txtNumberLicense.Text = res.DataResponse.LICENSE_NO == "" ? "" : res.DataResponse.LICENSE_NO; txtEmail.Text = res.DataResponse.EMAIL == "" ? "" : res.DataResponse.EMAIL; txtTimeMove.Text = res.DataResponse.RENEW_TIMES == "" ? "" : res.DataResponse.RENEW_TIMES; txtCompCode.Text = res.DataResponse.OLD_COMP_CODE == "" ? "" : res.DataResponse.OLD_COMP_CODE; txtFee.Text = Convert.ToString(res.DataResponse.FEES) == "" ? "" : Convert.ToString(res.DataResponse.FEES); txtCurrentAddress.Text = res.DataResponse.CURRENT_ADDRESS == "" ? "" : res.DataResponse.CURRENT_ADDRESS; txtRegisterAddress.Text = res.DataResponse.LOCAL_ADDRESS == "" ? "" : res.DataResponse.LOCAL_ADDRESS; txtDateAccept.Text = Convert.ToString(res.DataResponse.AR_DATE) == "" ? "" : Convert.ToString(res.DataResponse.AR_DATE); var message = SysMessage.DefaultSelecting; BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz(); ddlProvinceCurrentAddress.SelectedValue = res.DataResponse.CURRENT_PROVINCE_CODE; var lsPC = dataCenter.GetAmpur(message, ddlProvinceCurrentAddress.SelectedValue); BindToDDL(ddlDistrictCurrentAddress, lsPC); foreach (var item in lsPC) { if (item.Id == res.DataResponse.CURRENT_AMPUR_CODE) { ddlDistrictCurrentAddress.SelectedValue = res.DataResponse.CURRENT_AMPUR_CODE; } } var lsTC = dataCenter.GetTumbon(message, ddlProvinceCurrentAddress.SelectedValue, ddlDistrictCurrentAddress.SelectedValue); BindToDDL(ddlParishCurrentAddress, lsTC); foreach (var item in lsTC) { if (item.Id == res.DataResponse.CURRENT_TUMBON_CODE) { ddlParishCurrentAddress.SelectedValue = res.DataResponse.CURRENT_TUMBON_CODE; } } ddlProvinceRegisterAddress.SelectedValue = res.DataResponse.LOCAL_PROVINCE_CODE; var lsPR = dataCenter.GetAmpur(message, ddlProvinceRegisterAddress.SelectedValue); BindToDDL(ddlDistrictRegisterAddress, lsPR); foreach (var item in lsPR) { if (item.Id == res.DataResponse.LOCAL_AMPUR_CODE) { ddlDistrictRegisterAddress.SelectedValue = res.DataResponse.LOCAL_AMPUR_CODE; } } var lsTR = dataCenter.GetTumbon(message, ddlProvinceRegisterAddress.SelectedValue, ddlDistrictRegisterAddress.SelectedValue); BindToDDL(ddlParishRegisterAddress, lsTR); foreach (var item in lsTR) { if (item.Id == res.DataResponse.LOCAL_TUMBON_CODE) { ddlParishRegisterAddress.SelectedValue = res.DataResponse.LOCAL_TUMBON_CODE; } } UpdatePanelSearch.Update(); var HeaderApprove = biz.GetVerifyHeadByUploadGroupNo(strGroupNumber.Text); if (res.DataResponse.APPROVED == "Y") { rblApprove.SelectedValue = "Y"; } else if (res.DataResponse.APPROVED == "N") { rblApprove.SelectedValue = "N"; } else if (res.DataResponse.APPROVED == "W") { rblApprove.ClearSelection(); } }
private void GetExamTrain() { LicenseBiz biz = new BLL.LicenseBiz(); DTO.ResponseService <DTO.ExamHistory[]> resExam = biz.GetExamHistoryByIDWithCondition(this.UserProfile.IdCard, this.MasterLicense.LicenseTypeCode); DTO.ResponseService <DTO.TrainPersonHistory[]> resTrain = biz.GetTrainingHistoryByIDWithCondition(this.UserProfile.IdCard, this.MasterLicense.LicenseTypeCode); //DTO.ResponseService<DataSet> resTrain = biz.GetTrainingHistoryBy(this.UserProfile.IdCard); //DataTable dtTrain = resTrain.DataResponse.Tables[0]; //DataRow resultRow = resTrain.DataResponse.Tables["dd"].AsEnumerable().Where(row => row.Field<string>("DECODE") == "ผ่าน").FirstOrDefault(); #region Func Func <string, string, string> dateCompare = delegate(string input, string t) { DateTime currDate = DateTime.Now; DateTime expDate = Convert.ToDateTime(input); string currDateFormat = String.Format("{0:dd/MM/yyy}", currDate).ToString(); string exphDateFormat = String.Format("{0:dd/MM/yyy}", expDate).ToString(); DateTime currTime = DateTime.Parse(currDateFormat); DateTime expTime = DateTime.Parse(exphDateFormat); int resCompare = DateTime.Compare(expTime, currTime); if (t.Equals("exam")) { //expTime < CurrentTime if (resCompare == -1) { input = SysMessage.ExamResultF; } //expTime == CurrentTime if (resCompare == 0) { input = SysMessage.ExamResultF; } //expTime > CurrentTime if (resCompare == 1) { input = resExam.DataResponse[0].EXAM_RESULT; } } else if (t.Equals("train")) { //expTime < CurrentTime if (resCompare == -1) { input = SysMessage.TrainResultF; } //expTime == CurrentTime if (resCompare == 0) { input = SysMessage.TrainResultF; } //expTime > CurrentTime if (resCompare == 1) { input = resTrain.DataResponse[0].STATUS; } } return(input); }; #endregion if ((resExam.IsError) || (resTrain.IsError)) { this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = resExam.ErrorMsg; this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError(); this.MasterLicense.UpdatePanelLicense.Update(); return; } else if ((resExam.DataResponse != null) && (resTrain.DataResponse != null)) { this.MasterLicense.CurrentExamPerson = resExam.DataResponse.ToList(); this.MasterLicense.CurrentTrainPerson = resTrain.DataResponse.ToList(); if ((resExam.DataResponse.Count() > 0) && (resTrain.DataResponse.Count() > 0)) { if (!string.IsNullOrEmpty(resExam.DataResponse[0].EXAM_RESULT)) { //lblResExam.Text = resExam.DataResponse[0].EXAM_RESULT; this.curResultExam = resExam.DataResponse[0].EXAM_RESULT; } else if (string.IsNullOrEmpty(resExam.DataResponse[0].EXAM_RESULT)) { //lblResExam.Text = Resources.propLicenseValidate_ResExam; this.curResultExam = Resources.propLicenseValidate_ResExam; } //lblResTrain.Text = dateCompare(String.Format("{0:dd/MM/yyyy}", resTrain.DataResponse[0].TRAIN_DATE_EXP), "train"); this.curResultTrain = dateCompare(String.Format("{0:dd/MM/yyyy}", resTrain.DataResponse[0].TRAIN_DATE_EXP), "train"); gvHistoryExam.DataSource = resExam.DataResponse; gvHistoryExam.DataBind(); } else if ((resExam.DataResponse.Count() == 0) && (resTrain.DataResponse.Count() == 0)) { //btnNext.Enabled = false; //pnlNext.Enabled = false; btnNext.Enabled = true; pnlNext.Enabled = true; gvHistoryExam.DataSource = resExam.DataResponse; gvHistoryExam.DataBind(); } else { if (resExam.DataResponse.Count() == 0) { //lblResExam.Text = Resources.propLicenseValidate_ResExam; this.curResultExam = Resources.propLicenseValidate_ResExam; //btnNext.Enabled = false; //pnlNext.Enabled = false; btnNext.Enabled = true; pnlNext.Enabled = true; } if (resExam.DataResponse.Count() > 0) { //lblResExam.Text = resExam.DataResponse[0].EXAM_RESULT; this.curResultExam = resExam.DataResponse[0].EXAM_RESULT; } if (resTrain.DataResponse.Count() == 0) { //lblResTrain.Text = Resources.propLicenseValidate_ResTrain; this.curResultTrain = Resources.propLicenseValidate_ResTrain; //btnNext.Enabled = false; //pnlNext.Enabled = false; btnNext.Enabled = true; pnlNext.Enabled = true; } if (resTrain.DataResponse.Count() > 0) { //lblResTrain.Text = resTrain.DataResponse[0].STATUS; this.curResultTrain = resTrain.DataResponse[0].STATUS; } gvHistoryExam.DataSource = resExam.DataResponse; gvHistoryExam.DataBind(); } } }
protected void btnExportExcel_Click(object sender, ImageClickEventArgs e) { try { int total = lblTotalrecord.Text == "" ? 0 : lblTotalrecord.Text.ToInt(); if (total > base.EXCEL_SIZE_Key) { UCModalError.ShowMessageError = SysMessage.ExcelSizeError; UCModalError.ShowModalError(); UpdatePanelSearch.Update(); } else { ExportBiz export = new ExportBiz(); Dictionary <string, string> columns = new Dictionary <string, string>(); columns.Add("ลำดับที่", "RUN_NO"); columns.Add("เลขบัตรประชาชน", "ID_CARD_NO"); columns.Add("ชื่อ", "NAMES"); columns.Add("นามสกุล", "LASTNAME"); columns.Add("ประเภทคำขอ", "PETITION_NAME"); columns.Add("ประเภทใบอนุญาต", "LICENSE_TYPE_NAME"); columns.Add("เลขที่อนุญาต", "LICENSE_NO"); columns.Add("วันที่อนุญาต", "LICENSE_DATE"); columns.Add("วันที่หมดอายุ", "LICENSE_EXPIRE_DATE"); columns.Add("สถานะ", "APPROVED"); List <HeaderExcel> header = new List <HeaderExcel>(); header.Add(new HeaderExcel { NameColumnsOne = "เลขที่อนุญาต ", ValueColumnsOne = txtLicenseNumber.Text, NameColumnsTwo = "ประเภทใบอนุญาต ", ValueColumnsTwo = ddlLicenseType.SelectedItem.Text }); header.Add(new HeaderExcel { NameColumnsOne = "ตั้งแต่วันที่ ", ValueColumnsOne = txtstartDate.Text, NameColumnsTwo = "ถึงวันที่ ", ValueColumnsTwo = txttoDate.Text }); if (base.UserProfile.MemberType == DTO.RegistrationType.OIC.GetEnumValue() || base.UserProfile.MemberType == DTO.RegistrationType.OICAgent.GetEnumValue()) { var biz = new BLL.LicenseBiz(); var res = new DTO.ResponseService <DataSet>(); res = biz.GetListLicenseDetailAdminByCriteria(txtLicenseNumber.Text , ddlLicenseType.SelectedValue , Convert.ToDateTime(txtstartDate.Text) , Convert.ToDateTime(txttoDate.Text) , "" , "" , base.UserProfile , 1 , base.EXCEL_SIZE_Key, "N"); export.CreateExcel(res.DataResponse.Tables[0], columns, header, base.UserProfile); } else { var biz = new BLL.LicenseBiz(); var res = new DTO.ResponseService <DataSet>(); res = biz.GetListLicenseDetailByCriteria(txtLicenseNumber.Text , ddlLicenseType.SelectedValue , Convert.ToDateTime(txtstartDate.Text) , Convert.ToDateTime(txttoDate.Text) , "" , "" , base.UserProfile , 1 , base.EXCEL_SIZE_Key, "N"); //export.CreateExcel(res.DataResponse,columns); export.CreateExcel(res.DataResponse.Tables[0], columns, header, base.UserProfile); } } } catch { } }
private void BindDataSingle() { PAGE_SIZE = PAGE_SIZE_Key; maxBefore = txtInputMaxrow.Text; if ((txtInputMaxrow.Text != Convert.ToString(PAGE_SIZE) && txtInputMaxrow.Text != "" && Convert.ToInt32(txtInputMaxrow.Text) != 0)) { txtInputMaxrow.Text = maxBefore; } else if (txtInputMaxrow.Text == "" || Convert.ToInt32(txtInputMaxrow.Text) == 0) { txtInputMaxrow.Text = Convert.ToString(PAGE_SIZE); } PAGE_SIZE = Convert.ToInt32(txtInputMaxrow.Text); txtNumberGvSearch.Text = "1"; var resultPage = txtNumberGvSearch.Text.ToInt(); var resCount = new DTO.ResponseService <DataSet>(); var res = new DTO.ResponseService <DataSet>(); var biz = new BLL.LicenseBiz(); resCount = biz.GetListLicenseDetailByPersonal("", "", null, null, "", "", base.UserProfile, resultPage, PAGE_SIZE, true); res = biz.GetListLicenseDetailByPersonal("", "", null, null, "", "", base.UserProfile, resultPage, PAGE_SIZE, false); DataSet ds = resCount.DataResponse; DataTable dt = ds.Tables[0]; DataRow dr = dt.Rows[0]; int rowcount = Convert.ToInt32(dr["rowcount"].ToString()); double dblPageCount = (double)((decimal)rowcount / PAGE_SIZE); TotalPages = (int)Math.Ceiling(dblPageCount); txtTotalPage.Text = Convert.ToString(TotalPages); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { gvSearch.DataSource = res.DataResponse; gvSearch.DataBind(); if (TotalPages > 1) { txtNumberGvSearch.Visible = true; lblParaPage.Visible = true; txtTotalPage.Visible = true; btnNextGvSearch.Visible = true; btnPreviousGvSearch.Visible = false; btngo.Visible = true; txtInputMaxrow.Visible = true; lblHeadInputMaxrow.Visible = true; lblHeadTotal.Visible = true; lblTotalrecord.Visible = true; lblEndTotal.Visible = true; lblTotalrecord.Text = dr["rowcount"].ToString(); } else if (TotalPages == 1) { txtNumberGvSearch.Visible = true; lblParaPage.Visible = true; txtTotalPage.Visible = true; btnNextGvSearch.Visible = false; btnPreviousGvSearch.Visible = false; btngo.Visible = true; lblTotalrecord.Text = dr["rowcount"].ToString(); txtInputMaxrow.Visible = true; lblHeadInputMaxrow.Visible = true; lblHeadTotal.Visible = true; lblTotalrecord.Visible = true; lblEndTotal.Visible = true; } else if (TotalPages == 0) { txtNumberGvSearch.Visible = true; lblParaPage.Visible = true; txtTotalPage.Visible = true; btnNextGvSearch.Visible = false; btnPreviousGvSearch.Visible = false; btngo.Visible = true; lblTotalrecord.Text = "0"; txtTotalPage.Text = "1"; txtInputMaxrow.Visible = true; lblHeadInputMaxrow.Visible = true; lblHeadTotal.Visible = true; lblTotalrecord.Visible = true; lblEndTotal.Visible = true; } divDetail.Visible = true; UpdatePanelSearch.Update(); } }
private void GetLicenseHeadVerify() { PAGE_SIZE = PAGE_SIZE_Key; maxBefore = txtInputMaxrow.Text; if ((txtInputMaxrow.Text != Convert.ToString(PAGE_SIZE) && txtInputMaxrow.Text != "" && Convert.ToInt32(txtInputMaxrow.Text) != 0)) { txtInputMaxrow.Text = maxBefore; } else if (txtInputMaxrow.Text == "" || Convert.ToInt32(txtInputMaxrow.Text) == 0) { txtInputMaxrow.Text = Convert.ToString(PAGE_SIZE); } PAGE_SIZE = Convert.ToInt32(txtInputMaxrow.Text); txtNumberGvSearch.Text = "1"; var resultPage = txtNumberGvSearch.Text.ToInt(); BLL.LicenseBiz biz = new BLL.LicenseBiz(); Func <string, string> GetCrit = anyString => { return(string.IsNullOrEmpty(anyString) ? string.Empty : anyString); }; string strLicenseType = GetCrit(ddlLicenseType.SelectedValue); if (!string.IsNullOrEmpty(txtStartDate.Text) && !string.IsNullOrEmpty(txtEndDate.Text)) { DateTime dtStartDate = Convert.ToDateTime(GetCrit(txtStartDate.Text == "" ? "" : txtStartDate.Text)); DateTime dtEndDate = Convert.ToDateTime(GetCrit(txtEndDate.Text == "" ? "" : txtEndDate.Text)); var lsCount = biz.GetResultLicenseVerifyHead(strLicenseType, dtStartDate, dtEndDate, base.UserProfile.CompCode, "Y", resultPage, PAGE_SIZE); DataSet ds = lsCount.DataResponse; DataTable dt = ds.Tables[0]; var ls = biz.GetResultLicenseVerifyHead(strLicenseType, dtStartDate, dtEndDate, base.UserProfile.CompCode, "N", resultPage, PAGE_SIZE); DataSet dsls = ls.DataResponse; gvHead.DataSource = dsls; gvHead.DataBind(); if (dt.Rows.Count == 0) { txtNumberGvSearch.Visible = true; lblParaPage.Visible = true; txtTotalPage.Visible = true; btnNextGvSearch.Visible = false; btnPreviousGvSearch.Visible = false; txtTotalPage.Text = "1"; btngo.Visible = true; lblTotalrecord.Text = "0"; txtInputMaxrow.Visible = true; lblHeadInputMaxrow.Visible = true; lblHeadTotal.Visible = true; lblTotalrecord.Visible = true; lblEndTotal.Visible = true; } else { DataRow dr = dt.Rows[0]; int rowcount = Convert.ToInt32(dr["TOTAL"].ToString()); double dblPageCount = (double)((decimal)rowcount / PAGE_SIZE); TotalPages = (int)Math.Ceiling(dblPageCount); txtTotalPage.Text = Convert.ToString(TotalPages); if (TotalPages == 0) { txtNumberGvSearch.Visible = true; lblParaPage.Visible = true; txtTotalPage.Visible = true; btnNextGvSearch.Visible = false; btnPreviousGvSearch.Visible = false; btngo.Visible = true; lblTotalrecord.Text = dr["TOTAL"].ToString(); txtInputMaxrow.Visible = true; lblHeadInputMaxrow.Visible = true; lblHeadTotal.Visible = true; lblTotalrecord.Visible = true; lblEndTotal.Visible = true; } else if (TotalPages > 1) { txtNumberGvSearch.Visible = true; lblParaPage.Visible = true; txtTotalPage.Visible = true; btnNextGvSearch.Visible = true; btngo.Visible = true; lblTotalrecord.Text = dr["TOTAL"].ToString(); txtInputMaxrow.Visible = true; lblHeadInputMaxrow.Visible = true; lblHeadTotal.Visible = true; lblTotalrecord.Visible = true; lblEndTotal.Visible = true; //btnExportExcel.Visible = true; } else if (TotalPages == 1) { txtNumberGvSearch.Visible = true; lblParaPage.Visible = true; txtTotalPage.Visible = true; btngo.Visible = true; lblTotalrecord.Text = dr["TOTAL"].ToString(); txtInputMaxrow.Visible = true; lblHeadInputMaxrow.Visible = true; lblHeadTotal.Visible = true; lblTotalrecord.Visible = true; lblEndTotal.Visible = true; // btnExportExcel.Visible = true; } UpdatePanelSearch.Update(); } } else { UCModalError.ShowMessageError = SysMessage.PleaseSelectDate; UCModalError.ShowModalError(); } }
private void BindPersonByIDCard() { var biz = new BLL.LicenseBiz(); var res = biz.GetPersonalHistoryByIdCard(base.UserProfile.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(); } } }
protected void TabDetail_ActiveTabChanged(object sender, EventArgs e) { var biz = new BLL.LicenseBiz(); var IDCard = this.IdCardNo; if (TabDetail.ActiveTabIndex == 0) { BindPersonByIDCard(); } else if (TabDetail.ActiveTabIndex == 1) { var res = biz.GetExamHistoryByIdCard(base.UserProfile.IdCard); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { gvHistoryExam.DataSource = res.DataResponse; gvHistoryExam.DataBind(); UpdatePanelSearch.Update(); } } else if (TabDetail.ActiveTabIndex == 2) { var res = biz.GetTrainingHistoryBy(base.UserProfile.IdCard); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { gvHistoryTraining.DataSource = res.DataResponse; gvHistoryTraining.DataBind(); UpdatePanelSearch.Update(); } } else if (TabDetail.ActiveTabIndex == 3) { var res = biz.GetTrain_1_To_4_ByIdCard(base.UserProfile.IdCard); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { GvTraining.DataSource = res.DataResponse; GvTraining.DataBind(); UpdatePanelSearch.Update(); } } else if (TabDetail.ActiveTabIndex == 4) { var res = biz.GetUnitLinkByIdCard(base.UserProfile.IdCard); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { gvUnitLink.DataSource = res.DataResponse; gvUnitLink.DataBind(); UpdatePanelSearch.Update(); } } else if (TabDetail.ActiveTabIndex == 5) { var res = biz.GetRequestLicenseByIdCard(base.UserProfile.IdCard); if (res.IsError) { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } else { gvObtainLicense.DataSource = res.DataResponse; gvObtainLicense.DataBind(); UpdatePanelSearch.Update(); } } }
private void BindGridImageAccount(string strIDNumberGv, string strIdCard) { pnlAttach.Visible = true; PAGE_SIZE = PAGE_SIZE_Key; txtNumberGvSearch3.Text = "1"; maxBefore = txtInputMaxrow3.Text; if ((txtInputMaxrow3.Text != Convert.ToString(PAGE_SIZE) && txtInputMaxrow3.Text != "" && Convert.ToInt32(txtInputMaxrow3.Text) != 0)) { txtInputMaxrow3.Text = maxBefore; } else if (txtInputMaxrow3.Text == "" || Convert.ToInt32(txtInputMaxrow3.Text) == 0) { txtInputMaxrow3.Text = Convert.ToString(PAGE_SIZE); } PAGE_SIZE = Convert.ToInt32(txtInputMaxrow3.Text); BLL.LicenseBiz biz = new BLL.LicenseBiz(); var resultPage = txtNumberGvSearch3.Text.ToInt(); var lsCount = biz.GetLicenseVerifyImgDetail(lblGroupIdGv2.Text, lblIdCardGV2.Text, "Y", resultPage, PAGE_SIZE); double dblPageCount = (double)((decimal)lsCount.DataResponse.Count() / PAGE_SIZE); TotalPages = (int)Math.Ceiling(dblPageCount); txtTotalPage3.Text = Convert.ToString(TotalPages); var ls = biz.GetLicenseVerifyImgDetail(lblGroupIdGv2.Text, lblIdCardGV2.Text, "N", resultPage, PAGE_SIZE); gvUpload.DataSource = ls.DataResponse; gvUpload.DataBind(); if (ls.IsError) { UCModalError.ShowMessageError = ls.ErrorMsg; UCModalError.ShowModalError(); } else { if (TotalPages == 0) { btnPreviousGvSearch3.Visible = false; btnNextGvSearch3.Visible = false; txtNumberGvSearch3.Visible = true; lblParaPage3.Visible = true; txtTotalPage3.Visible = true; btngo3.Visible = true; txtInputMaxrow3.Visible = true; lblHeadInputMaxrow3.Visible = true; lblHeadTotal3.Visible = true; lblTotalrecord3.Visible = true; lblEndTotal3.Visible = true; lblTotalrecord3.Text = "0"; txtTotalPage3.Text = "1"; } else if (TotalPages == 1) { txtNumberGvSearch3.Visible = true; lblParaPage3.Visible = true; txtTotalPage3.Visible = true; btnPreviousGvSearch3.Visible = false; btnNextGvSearch3.Visible = false; btngo3.Visible = true; txtInputMaxrow3.Visible = true; lblHeadInputMaxrow3.Visible = true; lblHeadTotal3.Visible = true; lblTotalrecord3.Visible = true; lblEndTotal3.Visible = true; lblTotalrecord3.Text = Convert.ToString(lsCount.DataResponse.Count()); } else if (TotalPages > 1) { txtNumberGvSearch3.Visible = true; lblParaPage3.Visible = true; txtTotalPage3.Visible = true; btnNextGvSearch3.Visible = true; btnPreviousGvSearch3.Visible = false; btngo3.Visible = true; txtInputMaxrow3.Visible = true; lblHeadInputMaxrow3.Visible = true; lblHeadTotal3.Visible = true; lblTotalrecord3.Visible = true; lblEndTotal3.Visible = true; lblTotalrecord3.Text = Convert.ToString(lsCount.DataResponse.Count()); } } }
protected void BindGv2() { divDetail.Visible = true; PAGE_SIZE = PAGE_SIZE_Key; txtNumberGvSearch2.Text = "1"; maxBefore = txtInputMaxrow2.Text; if ((txtInputMaxrow2.Text != Convert.ToString(PAGE_SIZE) && txtInputMaxrow2.Text != "" && Convert.ToInt32(txtInputMaxrow2.Text) != 0)) { txtInputMaxrow2.Text = maxBefore; } else if (txtInputMaxrow2.Text == "" || Convert.ToInt32(txtInputMaxrow2.Text) == 0) { txtInputMaxrow2.Text = Convert.ToString(PAGE_SIZE); } PAGE_SIZE = Convert.ToInt32(txtInputMaxrow2.Text); var resultPage = txtNumberGvSearch2.Text.ToInt(); BLL.LicenseBiz biz = new BLL.LicenseBiz(); var resCount = biz.GetListLicenseDetailVerify(Session["UploadGroupNoGv"].ToString(), "Y", resultPage, PAGE_SIZE); DataSet ds = resCount.DataResponse; DataTable dt = ds.Tables[0]; DataRow dr = dt.Rows[0]; int rowcount = Convert.ToInt32(dr["rowcount"].ToString()); double dblPageCount = (double)((decimal)rowcount / PAGE_SIZE); TotalPages = (int)Math.Ceiling(dblPageCount); txtTotalPage2.Text = Convert.ToString(TotalPages); var ls = biz.GetListLicenseDetailVerify(Session["UploadGroupNoGv"].ToString(), "N", resultPage, PAGE_SIZE); gvDetail.DataSource = ls.DataResponse; gvDetail.DataBind(); pnlDetail.Visible = false; pnlAttach.Visible = false; if (ls.IsError) { UCModalError.ShowMessageError = ls.ErrorMsg; UCModalError.ShowModalError(); } else { if (TotalPages > 1) { txtNumberGvSearch2.Visible = true; lblParaPage2.Visible = true; txtTotalPage2.Visible = true; btnNextGvSearch2.Visible = true; btnPreviousGvSearch2.Visible = false; btngo2.Visible = true; txtInputMaxrow2.Visible = true; lblHeadInputMaxrow2.Visible = true; lblHeadTotal2.Visible = true; lblTotalrecord2.Visible = true; lblEndTotal2.Visible = true; lblTotalrecord2.Text = dr["rowcount"].ToString(); } else if (TotalPages == 1) { txtNumberGvSearch2.Visible = true; lblParaPage2.Visible = true; txtTotalPage2.Visible = true; btnNextGvSearch2.Visible = false; btnPreviousGvSearch2.Visible = false; btngo2.Visible = true; txtInputMaxrow2.Visible = true; lblHeadInputMaxrow2.Visible = true; lblHeadTotal2.Visible = true; lblTotalrecord2.Visible = true; lblEndTotal2.Visible = true; lblTotalrecord2.Text = dr["rowcount"].ToString(); } if (TotalPages == 0) { txtNumberGvSearch2.Visible = true; lblParaPage2.Visible = true; txtTotalPage2.Visible = true; btnNextGvSearch2.Visible = false; btnPreviousGvSearch2.Visible = false; btngo2.Visible = true; txtInputMaxrow2.Visible = true; lblHeadInputMaxrow2.Visible = true; lblHeadTotal2.Visible = true; lblTotalrecord2.Visible = true; lblEndTotal2.Visible = true; lblTotalrecord2.Text = "0"; txtTotalPage2.Text = "1"; } } // Session["UploadGroupNoGv"] = Session["UploadGroupNoGv"].ToString(); }