protected void btnOk_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtUserName.Text) && !string.IsNullOrEmpty(txtPassword.Text)) { BLL.PersonBiz biz = new BLL.PersonBiz(); var res = biz.UserAuthen(txtUserName.Text, txtPassword.Text, false, ""); if (res.IsError) { UCModalPopupError.ShowMessageError = res.ErrorMsg; UCModalPopupError.ShowModalError(); UpdatePanelForgetPassword.Update(); return; } else { if (ViewState["filepath"] != null) { Response.Redirect(String.Format("~/UserControl/ViewFile.aspx?targetImage={0}", CryptoBase64.Encryption(ViewState["filepath"].ToString()))); } return; } } else { UCModalPopupError.ShowMessageError = SysMessage.PleaseInputFill; UCModalPopupError.ShowModalError(); UpdatePanelForgetPassword.Update(); } }
protected void btnOk_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtUserName.Text) && !string.IsNullOrEmpty(txtConfirmEmail.Text)) { BLL.PersonBiz biz = new BLL.PersonBiz(); var res = biz.ForgetPasswordRequest(txtUserName.Text, txtConfirmEmail.Text); if (res.IsError) { UCModalPopupError.ShowMessageError = res.ErrorMsg; UCModalPopupError.ShowModalError(); UpdatePanelForgetPassword.Update(); return; } else { txtConfirmEmail.Text = ""; txtUserName.Text = ""; UCModalPopupSuccess.ShowMessageSuccess = SysMessage.ConfirmChangePasswordMail; UCModalPopupSuccess.ShowModalSuccess(); UpdatePanelForgetPassword.Update(); return; } } else { UCModalPopupError.ShowMessageError = SysMessage.PleaseInputFill; UCModalPopupError.ShowModalError(); UpdatePanelForgetPassword.Update(); } }
public void EditPersonal(DTO.MemberType memberType, DTO.PersonTemp personal) { var biz = new BLL.PersonBiz(); String res = ucAttachFileControl1.ValidDocRequire(); if (String.IsNullOrEmpty(res)) { var final = biz.SetPersonTemp(personal, ucAttachFileControl1.AttachFiles.Where(p => p.FILE_STATUS != "A").ConvertToPersonAttatchFiles().ToArray()); if ((final.IsError) || (final.ResultMessage == false)) { UCModalError.ShowMessageError = final.ErrorMsg; UCModalError.ShowModalError(); } else if (final.ResultMessage == true) { UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess; UCModalSuccess.ShowModalSuccess(); btnClose.Visible = true; btnCancel.Visible = false; btnOk.Visible = false; //Response.Redirect("~/BankPage.aspx"); } } else { ModelError.ShowMessageError = res; ModelError.ShowModalError(); } }
private void InitData() { BLL.PersonBiz biz = new BLL.PersonBiz(); var res = biz.GetById(this.UserProfile.Id); if (!res.IsError) { var person = res.DataResponse; ddlTitle.SelectedValue = person.PRE_NAME_CODE; txtFirstName.Text = person.NAMES; txtLastName.Text = person.LASTNAME; txtIDNumber.Text = person.ID_CARD_NO; txtBirthDay.Text = person.BIRTH_DATE.Value.ToString("dd MMMM yyyy"); rblSex.SelectedValue = person.SEX; ddlNationality.SelectedValue = person.NATIONALITY; ddlEducation.SelectedValue = person.EDUCATION_CODE; txtEmail.Text = person.EMAIL; txtTel.Text = person.LOCAL_TELEPHONE; txtMobilePhone.Text = person.TELEPHONE; txtCurrentAddress.Text = person.ADDRESS_1; var message = SysMessage.DefaultSelecting; BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz(); ddlProvinceCurrentAddress.SelectedValue = person.PROVINCE_CODE; var lsPC = dataCenter.GetAmpur(message, ddlProvinceCurrentAddress.SelectedValue); BindToDDL(ddlDistrictCurrentAddress, lsPC); ddlDistrictCurrentAddress.SelectedValue = person.AREA_CODE; var lsTC = dataCenter.GetTumbon(message, ddlProvinceCurrentAddress.SelectedValue, ddlDistrictCurrentAddress.SelectedValue); BindToDDL(ddlParishCurrentAddress, lsTC); ddlParishCurrentAddress.SelectedValue = person.TUMBON_CODE; txtPostcodeCurrentAddress.Text = person.ZIP_CODE; txtRegisterAddress.Text = person.LOCAL_ADDRESS1; ddlProvinceRegisterAddress.SelectedValue = person.LOCAL_PROVINCE_CODE; var lsPR = dataCenter.GetAmpur(message, ddlProvinceRegisterAddress.SelectedValue); BindToDDL(ddlDistrictRegisterAddress, lsPR); ddlDistrictRegisterAddress.SelectedValue = person.LOCAL_AREA_CODE; var lsTR = dataCenter.GetTumbon(message, ddlProvinceRegisterAddress.SelectedValue, ddlDistrictRegisterAddress.SelectedValue); BindToDDL(ddlParishRegisterAddress, lsTR); ddlParishRegisterAddress.SelectedValue = person.TUMBON_CODE; txtPostcodeRegisterAddress.Text = person.LOCAL_ZIPCODE; } else { var errorMsg = res.ErrorMsg; AlertMessage.ShowAlertMessage(string.Empty, errorMsg); } }
private void GetAttatchFiles() { var biz = new BLL.PersonBiz(); string personID = this.PersonID; DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetAttatchFileByPersonId(personID); var list = res.DataResponse.ToList(); ucAttachFileControl1.AttachFiles = list.ConvertToAttachFilesView(); }
protected void btnEditSubmit_Click(object sender, EventArgs e) { var biz = new BLL.PersonBiz(); PersonTemp item = new PersonTemp(); item.ID = this.UserProfile.Id; item.COMP_CODE = ddlPlaceGroup.SelectedValue; item.MEMBER_TYPE = this.MememberTypePlaceGroup; item.ID_CARD_NO = txtIDNumber.Text; item.PRE_NAME_CODE = ddlTitle.SelectedValue; item.NAMES = txtFirstName.Text; item.LASTNAME = txtLastName.Text; item.SEX = rblSex.SelectedValue; item.EMAIL = txtEmail.Text; item.LOCAL_TELEPHONE = txtPlaceGroupTel.Text; item.TELEPHONE = txtTel.Text; item.ADDRESS_1 = txtAddress.Text; item.PROVINCE_CODE = ddlProvince.SelectedValue; item.AREA_CODE = ddlDistrict.SelectedValue; item.TUMBON_CODE = ddlParish.SelectedValue; item.ZIP_CODE = txtPostcode.Text; item.CREATED_BY = "agdoi"; item.CREATED_DATE = DateTime.Now; item.UPDATED_BY = "agdoi"; item.UPDATED_DATE = DateTime.Now; string firstName = item.NAMES; string lastName = txtLastName.Text; var final = biz.SetPersonTemp(item, this.PersonAttachFiles.ToArray()); if (final.IsError) { UCModalError.ShowMessageError = final.ErrorMsg; UCModalError.ShowModalError(); } ClearControl(); UCModalError.Visible = false; UCModalSuccess.Visible = false; MasterPage.SetUsername(firstName, lastName); string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../Register/Reg_Place_Group.aspx?Mode=V')"; ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Alert, true); }
private void GetAttatchFiles() { var biz = new BLL.PersonBiz(); string personID = this.UserProfile.Id; DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetUserProfileAttatchFileByPersonId(personID); var list = res.DataResponse.ToList(); this.MasterPage.AttachFileControl.AttachFiles = list.ConvertToAttachFilesView(); }
private void GetLoadDataToControl(DTO.Registration asscoent) { BLL.DataCenterBiz dcbiz = new BLL.DataCenterBiz(); BLL.PersonBiz biz = new BLL.PersonBiz(); BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz(); var res = biz.GetUserProfileById(this.MasterPage.UserProfile.Id); this.MasterPage.AttachFileControl.RegisterationId = this.MasterPage.UserProfile.Id; this.MasterPage.AttachFileControl.CurrentUser = this.UserProfile.LoginName; this.MasterPage.RegistrationId = asscoent.ID; if (!asscoent.MEMBER_TYPE.Equals(DTO.MemberType.Association.GetEnumValue().ToString())) { MasterPage.ModelError.ShowMessageError = SysMessage.UserMissMatchRegitrationData; MasterPage.ModelError.ShowModalError(); } txtAssociationRegister.Text = asscoent.COMP_CODE; ddlTitle.SelectedValue = asscoent.PRE_NAME_CODE; txtFirstName.Text = asscoent.NAMES; txtLastName.Text = asscoent.LASTNAME; txtIDCard.Text = asscoent.ID_CARD_NO; txtIDCard.Enabled = false; rblSex.Text = asscoent.SEX; txtAssociationTel.Text = LocalTelephoneNumberHelper.GetPhoneNumber(asscoent.LOCAL_TELEPHONE); txtAssociationTelExt.Text = LocalTelephoneNumberHelper.GetExtenNumber(asscoent.LOCAL_TELEPHONE); txtTel.Text = LocalTelephoneNumberHelper.GetPhoneNumber(asscoent.TELEPHONE); txtTelExt.Text = LocalTelephoneNumberHelper.GetExtenNumber(asscoent.TELEPHONE); txtEmail.Text = asscoent.EMAIL; txtEmail.Enabled = false; UcAddress.TextBoxAddress.Text = asscoent.ADDRESS_1; UcAddress.TextBoxPostCode.Text = asscoent.ZIP_CODE; //var strName = dcbiz.GetAssociateNameById(asscoent.COMP_CODE); DTO.ResponseService <DTO.ASSOCIATION> strName = dcbiz.GetInsuranceAssociateNameByID(asscoent.COMP_CODE); if (strName.DataResponse != null) { txtAssociation.Text = strName.DataResponse.ASSOCIATION_NAME + " " + "[" + asscoent.COMP_CODE + "]"; } else { txtAssociation.Text = "Name[Null]" + " " + "[" + asscoent.COMP_CODE + "]"; } this.MasterPage.TextBoxResultReg.Text = asscoent.APPROVE_RESULT; UcAddress.SelectDropDownStep(asscoent.PROVINCE_CODE, asscoent.AREA_CODE, asscoent.TUMBON_CODE); }
protected void btnOkSubmit_Click(object sender, EventArgs e) { var biz = new BLL.PersonBiz(); string personID = this.PersonID; var res = biz.GetPersonTemp(personID); PersonTemp item = new PersonTemp(); if (res != null) { item.ID = res.DataResponse.ID; item.MEMBER_TYPE = res.DataResponse.MEMBER_TYPE; item.COMP_CODE = res.DataResponse.COMP_CODE; item.PRE_NAME_CODE = res.DataResponse.PRE_NAME_CODE; item.NAMES = res.DataResponse.NAMES; item.LASTNAME = res.DataResponse.LASTNAME; item.SEX = res.DataResponse.SEX; item.ID_CARD_NO = res.DataResponse.ID_CARD_NO; item.BIRTH_DATE = res.DataResponse.BIRTH_DATE; item.EDUCATION_CODE = res.DataResponse.EDUCATION_CODE; item.NATIONALITY = res.DataResponse.NATIONALITY; item.EMAIL = res.DataResponse.EMAIL; item.LOCAL_TELEPHONE = res.DataResponse.LOCAL_TELEPHONE; item.TELEPHONE = res.DataResponse.TELEPHONE; //ขาด 2 ตัว //txtIDOicBeforeReg.Text = //txtIDMemberNumberAfterReg.Text = //ขาด 2 ตัว item.ADDRESS_1 = res.DataResponse.ADDRESS_1; item.PROVINCE_CODE = res.DataResponse.PROVINCE_CODE; item.AREA_CODE = res.DataResponse.AREA_CODE; item.TUMBON_CODE = res.DataResponse.TUMBON_CODE; item.LOCAL_ADDRESS1 = res.DataResponse.LOCAL_ADDRESS1; item.LOCAL_PROVINCE_CODE = res.DataResponse.PROVINCE_CODE; item.LOCAL_AREA_CODE = res.DataResponse.LOCAL_AREA_CODE; item.LOCAL_TUMBON_CODE = res.DataResponse.LOCAL_TUMBON_CODE; item.STATUS = ddlStatus.SelectedValue; } var final = biz.EditPerson(item); //ถ้าเกิด Error อะไรให้มาทำในที่นี่ Tob 12022013 if (final.IsError) { Response.Write(final.ErrorMsg); } AlertMessage.ShowAlertMessage(string.Empty, SysMessage.SaveSucess); }
//View Mode public DTO.Person GetPersonal() { BLL.PersonBiz regBiz = new BLL.PersonBiz(); var res = regBiz.GetById(UserProfile.Id); if (res.IsError) { ModelError.ShowMessageError = res.ErrorMsg; ModelError.ShowModalError(); } this.PersonId = res.DataResponse.ID; return(res.DataResponse); }
public void GetAttatchFiles() { var biz = new BLL.PersonBiz(); DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetUserProfileAttatchFileByPersonId(PersonId); var list = res.DataResponse.ToList(); ucAttachFileControl1.AttachFiles = list.ConvertToAttachFilesView(); UpdatePanelUpload.Update(); }
private void GetReport() { //string ReportFolder = base.ReportFilePath_Key; BLL.PersonBiz biz = new BLL.PersonBiz(); //var res = biz.GetStatisticResetPassword(txtIDCard.Text, txtName.Text, txtLastName.Text); ReportDocument rpt = new ReportDocument(); //rpt.Load(Server.MapPath(ReportFolder + "RptPayment.rpt")); //DataTable dt = res.DataResponse.Tables.Count > 0 ? res.DataResponse.Tables[0] : null; //rpt.DataDefinition.FormulaFields["Username"].Text = "'" + base.UserProfile.Name + "'"; //rpt.SetDataSource(dt); BindReport(rpt); }
//View Mode private void GetLastPerson() { BLL.PersonBiz personBiz = new BLL.PersonBiz(); var res = personBiz.GetById(MasterPage.UserProfile.Id); if (res.IsError) { MasterPage.ModelError.ShowMessageError = res.ErrorMsg; MasterPage.ModelError.ShowModalError(); } MasterPage.PersonId = res.DataResponse.ID; GetLoadDataToControl(res.DataResponse); MasterPage.GetAttatchFiles(); }
private void GetAttatchFiles() { var biz = new BLL.PersonBiz(); string personID = this.PersonID; DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetAttatchFileByPersonId(personID); var list = res.DataResponse.ToList(); this.AttachFiles = list; gvUpload.DataSource = list; gvUpload.DataBind(); }
private void GetAttatchFiles() { var biz = new BLL.PersonBiz(); string personID = this.PersonID; DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetAttatchFileEditByPersonId(personID); var list = res.DataResponse.ToList(); this.AttachFiles = list; ucAttachFileControl1.AttachFiles = this.AttachFiles.OrderBy(a => a.ATTACH_FILE_TYPE).ToList().ConvertToAttachFilesView(); UpdatePanelEdit.Update(); }
//Edit Mode public DTO.PersonTemp GetPersonTemp() { BLL.PersonBiz regBiz = new BLL.PersonBiz(); var res = regBiz.GetPersonTemp(UserProfile.Id); if (res.IsError) { ModelError.ShowMessageError = res.ErrorMsg; ModelError.ShowModalError(); } this.PersonId = res.DataResponse.ID; //Assign CreateDate this.CreateDateTemp = res.DataResponse.CREATED_DATE; return(res.DataResponse); }
public void EditCompany(DTO.MemberType memberType, DTO.PersonTemp personal) { //var biz = new BLL.PersonBiz(); //DTO.ResponseMessage<bool> res = ucAttachFileControl1.DocRequire(); //if (res.ResultMessage == true) //{ // var final = biz.SetPersonTemp(personal, ucAttachFileControl1.AttachFiles.Where(p => p.FILE_STATUS != "A").ConvertToPersonAttatchFiles().ToArray()); // if (final.IsError) // { // UCModalError.ShowMessageError = final.ErrorMsg; // UCModalError.ShowModalError(); // } //} //else if ((res.ResultMessage == false) || (res.IsError)) //{ // ModelError.ShowMessageError = SysMessage.FileRequire + res.ErrorMsg; // ModelError.ShowModalError(); //} var biz = new BLL.PersonBiz(); String res = ucAttachFileControl1.ValidDocRequire(); if (String.IsNullOrEmpty(res)) { var final = biz.SetPersonTemp(personal, ucAttachFileControl1.AttachFiles.Where(p => p.FILE_STATUS != "A").ConvertToPersonAttatchFiles().ToArray()); if ((final.IsError) || (final.ResultMessage == false)) { UCModalError.ShowMessageError = final.ErrorMsg; UCModalError.ShowModalError(); } else if (final.ResultMessage == true) { UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess; UCModalSuccess.ShowModalSuccess(); btnClose.Visible = true; btnCancel.Visible = false; btnOk.Visible = false; } } else { ModelError.ShowMessageError = res; ModelError.ShowModalError(); } }
//Edit Mode private void GetPersonTemp() { BLL.PersonBiz personBiz = new BLL.PersonBiz(); var res = personBiz.GetPersonTemp(MasterPage.UserProfile.Id); if (res.IsError) { MasterPage.ModelError.ShowMessageError = res.ErrorMsg; MasterPage.ModelError.ShowModalError(); } MasterPage.PersonId = res.DataResponse.ID; GetLoadTempDataToControl(res.DataResponse); MasterPage.GetAttatchFiles(); //Assign CreateDate MasterPage.CreateDateTemp = res.DataResponse.CREATED_DATE; }
private void GetAttatchFiles() { var biz = new BLL.PersonBiz(); string personID = this.UserProfile.Id; DTO.ResponseService <DTO.PersonAttatchFile[]> res = biz.GetAttatchFileByPersonId(personID); var list = res.DataResponse.ToList(); if (this.DataAction == DTO.DataActionMode.Edit) { this.PersonAttachFiles = list; } gvUpload.DataSource = list; gvUpload.DataBind(); }
private void InitData() { BLL.PersonBiz biz = new BLL.PersonBiz(); var res = biz.GetUserProfileById(this.UserProfile.Id); BLL.DataCenterBiz dtbiz = new BLL.DataCenterBiz(); if (!res.IsError) { var person = res.DataResponse; ddlPlaceGroup.SelectedValue = person.COMP_CODE; ddlTitle.SelectedValue = person.PRE_NAME_CODE; txtFirstName.Text = person.NAMES; txtLastName.Text = person.LASTNAME; txtIDNumber.Text = person.ID_CARD_NO; txtIDNumber.Enabled = false; rblSex.Text = person.SEX; txtTel.Text = person.TELEPHONE; txtPlaceGroupTel.Text = person.LOCAL_TELEPHONE; txtEmail.Text = person.EMAIL; txtEmail.Enabled = false; txtAddress.Text = person.ADDRESS_1; txtPostcode.Text = person.ZIP_CODE; var message = SysMessage.DefaultSelecting; BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz(); ddlProvince.SelectedValue = person.PROVINCE_CODE; var lsPC = dataCenter.GetAmpur(message, ddlProvince.SelectedValue); BindToDDL(ddlDistrict, lsPC); ddlDistrict.SelectedValue = person.AREA_CODE; var lsTC = dataCenter.GetTumbon(message, ddlProvince.SelectedValue, ddlDistrict.SelectedValue); BindToDDL(ddlParish, lsTC); ddlParish.SelectedValue = person.TUMBON_CODE; } else { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } }
private void GetLoadDataToControl(DTO.Registration companyent) { BLL.DataCenterBiz dcbiz = new BLL.DataCenterBiz(); BLL.PersonBiz biz = new BLL.PersonBiz(); BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz(); var res = biz.GetUserProfileById(this.MasterPage.UserProfile.Id); this.MasterPage.AttachFileControl.RegisterationId = this.MasterPage.UserProfile.Id; this.MasterPage.AttachFileControl.CurrentUser = this.UserProfile.LoginName; this.MasterPage.RegistrationId = companyent.ID; if (!companyent.MEMBER_TYPE.Equals(DTO.MemberType.Insurance.GetEnumValue().ToString())) { MasterPage.ModelError.ShowMessageError = SysMessage.UserMissMatchRegitrationData; MasterPage.ModelError.ShowModalError(); } rblSex.SelectedValue = companyent.SEX;//milk txtCompanyRegister.Text = companyent.COMP_CODE; ddlTitle.SelectedValue = companyent.PRE_NAME_CODE; txtFirstName.Text = companyent.NAMES; txtLastName.Text = companyent.LASTNAME; txtIDNumber.Text = companyent.ID_CARD_NO; txtIDNumber.Enabled = false; txtCompanyTel.Text = LocalTelephoneNumberHelper.GetPhoneNumber(companyent.LOCAL_TELEPHONE); txtCompanyTelExt.Text = LocalTelephoneNumberHelper.GetExtenNumber(companyent.LOCAL_TELEPHONE); txtTel.Text = LocalTelephoneNumberHelper.GetPhoneNumber(companyent.TELEPHONE); txtTelExt.Text = LocalTelephoneNumberHelper.GetExtenNumber(companyent.TELEPHONE); txtEmail.Text = companyent.EMAIL; txtEmail.Enabled = false; UcAddress.TextBoxAddress.Text = companyent.ADDRESS_1; UcAddress.TextBoxPostCode.Text = companyent.ZIP_CODE; var strName = dcbiz.GetCompanyNameById(companyent.COMP_CODE); txtCompany.Text = strName; this.MasterPage.TextBoxResultReg.Text = companyent.APPROVE_RESULT; UcAddress.SelectDropDownStep(companyent.PROVINCE_CODE, companyent.AREA_CODE, companyent.TUMBON_CODE); }
private void PersonSearch(Int32 pageIndex, Int32 pageSize) { using (BLL.PersonBiz bizPerson = new BLL.PersonBiz()) { var ls = bizPerson.GetPersonTempEditByCriteria(txtFirstName.Text, txtLastName.Text, null, null, txtIDCard.Text, ddlSearchMemberType.SelectedValue, txtEmail.Text, "", ddlSearchStatus.SelectedValue, pageIndex, pageSize, "2"); if (ls.DataResponse != null && ls.DataResponse.Tables.Count > 0) { gvSearchOfficerOIC.DataSource = ls.DataResponse.Tables[0]; gvSearchOfficerOIC.DataBind(); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { //InsertMode(); if (FileSign.FileName != "") { if (Path.GetExtension(FileSign.FileName) != ".png") { this.MasterSite.ModelError.ShowMessageError = Resources.errorReg_OIC_001; this.MasterSite.ModelError.ShowModalError(); return; //UCModalError.ShowMessageError = Resources.errorReg_OIC_001; //UCModalError.ShowModalError(); //return; } } using (BLL.PersonBiz biz = new BLL.PersonBiz()){ var res = biz.UpdateOIC(UserProfile.Id, txtOICUserName.Text, ddlAntecedent.SelectedValue, txtFirstName.Text, txtLastName.Text, rblSex.SelectedValue, UserProfile.MemberType.ToString(), FileSign.FileBytes); if (res.IsError) { this.MasterSite.ModelError.ShowMessageError = res.ErrorMsg; this.MasterSite.ModelError.ShowModalError(); //UCModalError.ShowMessageError = res.ErrorMsg; //UCModalError.ShowModalError(); } else { this.MasterSite.ModelSuccess.ShowMessageSuccess = SysMessage.SuccessEditTypeOIC; this.MasterSite.ModelSuccess.ShowModalSuccess(); //UCModalSuccess.ShowMessageSuccess = SysMessage.SuccessEditTypeOIC; //UCModalSuccess.ShowModalSuccess(); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["renew"] != null) { String _renew = Request.QueryString["renew"].ToString(); String decrty = Utils.CryptoBase64.Decryption(_renew); String[] results = decrty.Split('|'); if (results.Length == 7) { String username = results[0]; String oldpass = results[2]; String newpass = results[4]; String email = results[6]; BLL.PersonBiz personBiz = new BLL.PersonBiz(); var res = personBiz.RenewPassword(username, email, oldpass, newpass); if (res.IsError) { } Response.Redirect(PageList.Home); } } } catch (Exception) { Response.Redirect(PageList.Home); } }
private void GetAfterReg() { var biz = new BLL.PersonBiz(); string personID = this.PersonID; var res = biz.GetPersonTemp(personID); if (res != null) { string memberType = res.DataResponse.MEMBER_TYPE; this.MemberTypeSession = memberType; GetMembeTypeAfter(memberType); string compCode = res.DataResponse.COMP_CODE; GetCompanyByIdAfter(compCode); int title = Convert.ToInt32(res.DataResponse.PRE_NAME_CODE); GetTitleAfter(title); if (res.DataResponse.NAMES != null) { txtFirstNameAfterReg.Text = res.DataResponse.NAMES; } else { txtFirstNameAfterReg.Text = "-"; } if (res.DataResponse.LASTNAME != null) { txtLastNameAfterReg.Text = res.DataResponse.LASTNAME; } else { txtLastNameAfterReg.Text = "-"; } if (res.DataResponse.SEX != null) { rblSexAfterReg.SelectedValue = res.DataResponse.SEX; } else { rblSexAfterReg.SelectedIndex = 0; } if (res.DataResponse.ID_CARD_NO != null) { txtIDNumberAfterReg.Text = res.DataResponse.ID_CARD_NO; } else { txtIDNumberAfterReg.Text = "-"; } if (res.DataResponse.BIRTH_DATE != null) { txtBirthDayAfterReg.CssClass = "txt"; txtBirthDayAfterReg.Text = res.DataResponse.BIRTH_DATE.Value.ToString("dd MMMM yyyy"); } else { txtBirthDayAfterReg.CssClass = "txt"; txtBirthDayAfterReg.Text = "-"; } string education = res.DataResponse.EDUCATION_CODE; GetEducationAfter(education); string Nationality = res.DataResponse.NATIONALITY; GetNationalityAfter(Nationality); if (res.DataResponse.EMAIL != null) { txtEmailAfterReg.Text = res.DataResponse.EMAIL; } else { txtEmailAfterReg.Text = "-"; } if (res.DataResponse.LOCAL_TELEPHONE != null) { txtTelAfterReg.Text = res.DataResponse.LOCAL_TELEPHONE; } else { txtTelAfterReg.Text = "-"; } if (res.DataResponse.TELEPHONE != null) { txtMobilePhoneAfterReg.Text = res.DataResponse.TELEPHONE; } else { txtMobilePhoneAfterReg.Text = "-"; } //txtIDOicBeforeReg.Text = //txtIDMemberNumberAfterReg.Text = if (res.DataResponse.ADDRESS_1 != null) { txtCurrentAddressAfterReg.Text = res.DataResponse.ADDRESS_1; } else { txtCurrentAddressAfterReg.Text = "-"; } string province = res.DataResponse.PROVINCE_CODE; GetProvinceCurrentAddressAfter(province); string ampur = res.DataResponse.AREA_CODE; GetAmpurCurrentAddressAfter(province, ampur); string tumbon = res.DataResponse.TUMBON_CODE; GetTumbonCurrentAddressAfter(province, ampur, tumbon); if (res.DataResponse.LOCAL_ADDRESS1 != null) { txtRegisterAddressAfterReg.Text = res.DataResponse.LOCAL_ADDRESS1; } else { txtRegisterAddressAfterReg.Text = "-"; } string localProvince = res.DataResponse.LOCAL_PROVINCE_CODE; GetProvinceRegisterAddressAfter(localProvince); string localampur = res.DataResponse.LOCAL_AREA_CODE; GetAmpurRegisterAddressAfter(localProvince, localampur); string localtumbon = res.DataResponse.LOCAL_TUMBON_CODE; GetTumbonRegisterAddressAfter(localProvince, localampur, localtumbon); if (res.DataResponse.ZIP_CODE != null) { txtZipCodeCurrentAddressAfterReg.Text = res.DataResponse.ZIP_CODE; } else //milk { txtZipCodeCurrentAddressAfterReg.Text = "-"; } if (res.DataResponse.LOCAL_ZIPCODE != null) { txtZipCodeRegisterAddressAfterReg.Text = res.DataResponse.LOCAL_ZIPCODE; } else//milk { txtZipCodeRegisterAddressAfterReg.Text = "-"; } //if ((res.DataResponse.AGENT_TYPE != "") && (res.DataResponse.AGENT_TYPE != null)) //{ // ddlAgentTypeAfter.SelectedValue = res.DataResponse.AGENT_TYPE; //} //else if ((res.DataResponse.AGENT_TYPE == "") || (res.DataResponse.AGENT_TYPE == null)) //{ // ListItem ddlList = new ListItem("", "", true); // ddlList.Selected = true; // ddlAgentTypeAfter.Items.Add(ddlList); //} } else { UCModalError.ShowMessageError = res.ErrorMsg; UCModalError.ShowModalError(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetTitleName(); // แก้ไขข้อมูล (เจ้าหน้าที่ คปภ.) lblRegisterOfficer.Text = "แก้ไขข้อมูลผู้ใช้ระบบ (" + GetMemberTypeOIC(UserProfile.MemberType.ToString()).Name + ")"; using (BLL.PersonBiz biz = new BLL.PersonBiz()) { var res = biz.GetById(UserProfile.Id); if (res.DataResponse != null) { DTO.Person person = res.DataResponse; txtOICUserName.Text = UserProfile.OIC_User_Id; txtIDNumber.Text = UserProfile.OIC_EMP_NO; txtMemberType.Text = GetMemberTypeOIC(UserProfile.MemberType.ToString()).Name; ddlAntecedent.SelectedValue = person.PRE_NAME_CODE; txtFirstName.Text = person.NAMES; txtLastName.Text = person.LASTNAME; rblSex.SelectedValue = person.SEX; if (Request.QueryString["Mode"] != null) { String mode = Request.QueryString["Mode"].Trim(); if (mode == "V") { lblRegisterOfficer.Text = "ข้อมูลผู้ใช้ระบบ (" + GetMemberTypeOIC(UserProfile.MemberType.ToString()).Name + ")"; txtOICUserName.Enabled = false; txtIDNumber.Enabled = false; txtMemberType.Enabled = false; ddlAntecedent.Enabled = false; txtFirstName.Enabled = false; txtLastName.Enabled = false; rblSex.Enabled = false; btnSubmit.Visible = false; btnCancel.Visible = false; FileSign.Visible = false; lblDescription.Visible = false; if (person.MEMBER_TYPE == "5") { lblSign.Visible = true; //if (person.IMG_SIGN != null) //{ string base64String = biz.GetOicPersonSignImg(person.ID).DataResponse.Signture; // Convert.ToBase64String(person.IMG_SIGN, 0, person.IMG_SIGN.Length); if (!String.IsNullOrEmpty(base64String)) { ImgSign.ImageUrl = "data:image/png;base64," + base64String; } //} } else { lblSign.Visible = false; ImgSign.Visible = false; } } } else { if (person.MEMBER_TYPE == "5") { lblSign.Visible = true; ImgSign.Visible = false; FileSign.Visible = true; lblDescription.Visible = true; } else { ImgSign.Visible = false; FileSign.Visible = false; lblSign.Visible = false; lblDescription.Visible = false; } } } } } }
protected void btnOk_Click(object sender, EventArgs e) { BLL.RegistrationBiz biz = new BLL.RegistrationBiz(); BLL.PersonBiz bizPerson = new BLL.PersonBiz(); var detail = biz.GetRegistrationsByCriteria(txtFirstName.Text, txtLastName.Text, null, null, txtIDNumber.Text, null, txtEmail.Text, null, Session["RegStatus"].ToString(), 1, 20, "2"); DataSet ds = detail.DataResponse; #region Get MemberType From Control @Nattapong string RegMemType = string.Empty; if (txtMemberType.Text != "") { switch (txtMemberType.Text) { case "บุคคลทั่วไป": RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue()); break; case "บุคคลทั่วไป/ตัวแทน/นายหน้า": RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue()); break; case "บริษัทประกัน": RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue()); break; case "บริษัท": RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue()); break; case "สมาคม": RegMemType = Convert.ToString((int)DTO.MemberType.Association.GetEnumValue()); break; } } #endregion if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; var id = dt.AsEnumerable().Select(s => s.Field <string>("ID")); List <string> ls = new List <string>(); for (int i = 0; i < dt.Rows.Count; i++) { string strID = Convert.ToString(dt.Rows[i]["ID"]); ls.Add(strID); } if (ddlStatusApproval.SelectedValue.Equals("2")) { //var res = biz.RegistrationApprove(ls, "อนุมัติกลุ่ม"); string userid = UserProfile.Id; var res = biz.RegistrationApprove(ls, txtResultReg.Text, userid, RegMemType); if (res.IsError) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { //UCModalSuccess.ShowMessageSuccess = "ทำรายการเรียบร้อย"; //UCModalSuccess.ShowModalSuccess(); ////Response.Redirect("~/Register/regSearchOfficerOIC.aspx"); //btnOk.Enabled = false; //btnCancel.Text = "ย้อนกลับ"; string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess); ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true); } } else if (ddlStatusApproval.SelectedValue.Equals("3")) { //string userid = UserProfile.Id; string userid = Session["PersonalIDCard"].ToString(); var res = biz.RegistrationNotApprove(ls, txtResultReg.Text.ToString(), userid); if (res.IsError) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { //UCModalSuccess.ShowMessageSuccess = "ทำรายการเรียบร้อย"; //UCModalSuccess.ShowModalSuccess(); ////Response.Redirect("~/Register/regSearchOfficerOIC.aspx"); //btnOk.Enabled = false; //btnCancel.Text = "ย้อนกลับ"; string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess); ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true); } } else if (ddlStatusApproval.SelectedValue.Equals("")) { UCModalError1.ShowMessageError = Resources.errorEdit_Reg_Person_004; UCModalError1.ShowModalError(); } } }
private void InitData() { try { string IDCard = Request.QueryString["IDCard"].Trim(); string FirstName = Request.QueryString["FirstName"].Trim(); string LastName = Request.QueryString["LastName"].Trim(); string Click = Request.QueryString["Click"]; BLL.PersonBiz biz = new BLL.PersonBiz(); var res = biz.GetStatisticResetPassword(IDCard, FirstName, LastName); DataTable dt = res.DataResponse.Tables.Count > 0 ? res.DataResponse.Tables[0] : null; // string MemberType = MemberType_Temp.ToString(); string ReportFolder = base.ReportFilePath_Key; string PDF_Temp = base.PDFPath_Temp_Key; string PDF_OIC = base.PDFPath_OIC_Key; //string FileNameInput = "RcpReport_Temp.pdf"; //string FileNameOutput = "RcpReport.pdf"; if (Click == "Print") { if (base.UserProfile.MemberType == DTO.RegistrationType.OIC.GetEnumValue()) { //ReportDocument rpt = new ReportDocument(); rpt.Load(Server.MapPath(ReportFolder + "RptStatisticPassword.rpt")); rpt.DataDefinition.FormulaFields["UserName"].Text = String.Format("'{0}'", base.UserProfile.Name); rpt.SetDataSource(dt); rpt.SetParameterValue("datethai", DateTime.Now.ToShortDateString()); CRYreport.ReportSource = rpt; #region Comment //rpt.ExportToDisk(ExportFormatType.PortableDocFormat, Server.MapPath(ReportFolder + "RptStatisticPassword.pdf")); //BindReport(rpt); //downloadexcel(rpt); //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_OIC + FileNameOutput), FileMode.Create, FileAccess.Write, FileShare.None)) //{ // PdfReader reader = new PdfReader(input); // PdfEncryptor.Encrypt(reader, output, true, "", "", PdfWriter.AllowPrinting); // // PdfEncryptor.Encrypt(reader, output, true, "test", "test", 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_OIC + 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 } } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void btnOkSubmit_Click(object sender, EventArgs e) { var biz = new BLL.PersonBiz(); string personID = this.PersonID; var res = biz.GetPersonTemp(personID); string userid = UserProfile.Id; PersonTemp item = new PersonTemp(); if (res.DataResponse != null) { item.ID = res.DataResponse.ID; item.MEMBER_TYPE = res.DataResponse.MEMBER_TYPE; item.COMP_CODE = res.DataResponse.COMP_CODE; item.PRE_NAME_CODE = res.DataResponse.PRE_NAME_CODE; item.NAMES = res.DataResponse.NAMES; item.LASTNAME = res.DataResponse.LASTNAME; item.SEX = res.DataResponse.SEX; item.ID_CARD_NO = res.DataResponse.ID_CARD_NO; item.BIRTH_DATE = res.DataResponse.BIRTH_DATE; item.EDUCATION_CODE = res.DataResponse.EDUCATION_CODE; item.NATIONALITY = res.DataResponse.NATIONALITY; item.EMAIL = res.DataResponse.EMAIL; item.LOCAL_TELEPHONE = res.DataResponse.LOCAL_TELEPHONE; item.TELEPHONE = res.DataResponse.TELEPHONE; //ขาด 2 ตัว //txtIDOicBeforeReg.Text = //txtIDMemberNumberAfterReg.Text = //ขาด 2 ตัว item.ADDRESS_1 = res.DataResponse.ADDRESS_1; item.PROVINCE_CODE = res.DataResponse.PROVINCE_CODE; item.AREA_CODE = res.DataResponse.AREA_CODE; item.TUMBON_CODE = res.DataResponse.TUMBON_CODE; item.LOCAL_ADDRESS1 = res.DataResponse.LOCAL_ADDRESS1; item.LOCAL_PROVINCE_CODE = res.DataResponse.PROVINCE_CODE; item.LOCAL_AREA_CODE = res.DataResponse.LOCAL_AREA_CODE; item.LOCAL_TUMBON_CODE = res.DataResponse.LOCAL_TUMBON_CODE; item.CREATED_DATE = res.DataResponse.CREATED_DATE; item.ZIP_CODE = res.DataResponse.ZIP_CODE; item.LOCAL_ZIPCODE = res.DataResponse.LOCAL_ZIPCODE; item.STATUS = ddlStatus.SelectedValue; item.APPROVE_RESULT = txtResultReg.Text; item.APPROVED_BY = userid; item.AGENT_TYPE = res.DataResponse.AGENT_TYPE; } if (res.DataResponse == null) { this.UCModalError.ShowMessageError = res.ErrorMsg; this.UCModalError.ShowModalError(); return; } if (ddlStatus.SelectedValue.Equals("5")) { item.STATUS = DTO.PersonDataStatus.Approve.GetEnumValue().ToString(); item.APPROVE_RESULT = txtResultReg.Text; var final = biz.EditPerson(item); //ถ้าเกิด Error อะไรให้มาทำในที่นี่ Tob 12022013 if (final.IsError) { //Response.Write(final.ErrorMsg); UCModalError.ShowMessageError = final.ErrorMsg; UCModalError.ShowModalError(); } else { string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess); ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true); } } else if (ddlStatus.SelectedValue.Equals("6") && res.DataResponse.STATUS == DTO.PersonDataStatus.WaitForApprove.GetEnumValue().ToString()) { item.APPROVE_RESULT = txtResultReg.Text; var final = biz.EditPerson(item); //ถ้าเกิด Error อะไรให้มาทำในที่นี่ Tob 12022013 if (final.IsError) { //Response.Write(final.ErrorMsg); UCModalError.ShowMessageError = final.ErrorMsg; UCModalError.ShowModalError(); } else { string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess); ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true); } } //else if (ddlStatus.SelectedValue.Equals("6")) //{ // List<String> persons = new List<string>() { item.ID }; // var final = biz.PersonNotApprove(persons); // if (final.IsError) // { // UCModalError.ShowMessageError = final.ErrorMsg; // UCModalError.ShowModalError(); // } // else // { // string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx')", SysMessage.SaveSucess); // ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true); // } //} else if (ddlStatus.SelectedValue.Equals("")) { UCModalError.ShowMessageError = Resources.errorEdit_Reg_Person_004; UCModalError.ShowModalError(); } //var final = biz.EditPerson(item); ////ถ้าเกิด Error อะไรให้มาทำในที่นี่ Tob 12022013 //if (final.IsError) //{ // //Response.Write(final.ErrorMsg); // UCModalError.ShowMessageError = final.ErrorMsg; // UCModalError.ShowModalError(); //} //AlertMessage.ShowAlertMessage(string.Empty, SysMessage.SaveSucess); }
private void GetAfterReg() { var biz = new BLL.PersonBiz(); string personID = this.PersonID; var res = biz.GetPersonTemp(personID); if (res != null) { string memberType = res.DataResponse.MEMBER_TYPE; GetMembeTypeAfter(memberType); string compCode = res.DataResponse.COMP_CODE; GetCompanyByIdAfter(compCode); int title = Convert.ToInt32(res.DataResponse.PRE_NAME_CODE); GetTitleAfter(title); if (res.DataResponse.NAMES != null) { txtFirstNameAfterReg.Text = res.DataResponse.NAMES; } else { txtFirstNameAfterReg.Text = "-"; } if (res.DataResponse.LASTNAME != null) { txtLastNameAfterReg.Text = res.DataResponse.LASTNAME; } else { txtLastNameAfterReg.Text = "-"; } if (res.DataResponse.SEX != null) { rblSexAfterReg.SelectedValue = res.DataResponse.SEX; } else { rblSexAfterReg.SelectedIndex = 0; } if (res.DataResponse.ID_CARD_NO != null) { txtIDNumberAfterReg.Text = res.DataResponse.ID_CARD_NO; } else { txtIDNumberAfterReg.Text = "-"; } if (res.DataResponse.BIRTH_DATE != null) { txtBirthDayAfterReg.Text = res.DataResponse.BIRTH_DATE.Value.ToString("dd MMMM yyyy"); } else { txtBirthDayAfterReg.Text = "-"; } string education = res.DataResponse.EDUCATION_CODE; GetEducationAfter(education); string Nationality = res.DataResponse.NATIONALITY; GetNationalityAfter(Nationality); if (res.DataResponse.EMAIL != null) { txtEmailAfterReg.Text = res.DataResponse.EMAIL; } else { txtEmailAfterReg.Text = "-"; } if (res.DataResponse.LOCAL_TELEPHONE != null) { txtTelAfterReg.Text = res.DataResponse.LOCAL_TELEPHONE; } else { txtTelAfterReg.Text = "-"; } if (res.DataResponse.TELEPHONE != null) { txtMobilePhoneAfterReg.Text = res.DataResponse.TELEPHONE; } else { txtMobilePhoneAfterReg.Text = "-"; } //txtIDOicBeforeReg.Text = //txtIDMemberNumberAfterReg.Text = if (res.DataResponse.ADDRESS_1 != null) { txtCurrentAddressAfterReg.Text = res.DataResponse.ADDRESS_1; } else { txtCurrentAddressAfterReg.Text = "-"; } string province = res.DataResponse.PROVINCE_CODE; GetProvinceCurrentAddressAfter(province); string ampur = res.DataResponse.AREA_CODE; GetAmpurCurrentAddressAfter(province, ampur); string tumbon = res.DataResponse.TUMBON_CODE; GetTumbonCurrentAddressAfter(province, ampur, tumbon); if (res.DataResponse.LOCAL_ADDRESS1 != null) { txtRegisterAddressAfterReg.Text = res.DataResponse.LOCAL_ADDRESS1; } else { txtRegisterAddressAfterReg.Text = "-"; } string localProvince = res.DataResponse.LOCAL_PROVINCE_CODE; GetProvinceRegisterAddressAfter(localProvince); string localampur = res.DataResponse.LOCAL_AREA_CODE; GetAmpurRegisterAddressAfter(localProvince, localampur); string localtumbon = res.DataResponse.LOCAL_TUMBON_CODE; GetTumbonRegisterAddressAfter(localProvince, localampur, localtumbon); } }