public override int ChangePassword(int userId, string oldPassword, string newPassword, out string errmsg) { _objDataWrapper = new DbWrapper(Common.CnnString, CommandType.StoredProcedure); errmsg = ""; string Password = ""; var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo)); try { _objDataWrapper.AddParameter("@UserId", userId); _objDataWrapper.AddParameter("@UserOldPassword", objCrypto.Encrypt(oldPassword)); _objDataWrapper.AddParameter("@UserNewPassword", objCrypto.Encrypt(newPassword)); var ObjErrMsg = (SqlParameter)(_objDataWrapper.AddParameter("@ErrMsg", "", SqlDbType.VarChar, ParameterDirection.Output, 128)); _i = _objDataWrapper.ExecuteNonQuery("Aj_UserChangePassword"); if (ObjErrMsg != null && ObjErrMsg.Value != null) { errmsg = Convert.ToString(ObjErrMsg.Value); } } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex.ToString(); } const string addInfo = "Error while executing GetUserPassword in UserManager.cs :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } return(_i); }
public override int InsertCommonQuickQuery(QueryProperty objQuickQuery, out string errMsg, out int UserId) { errMsg = ""; UserId = 0; _objDataWrapper = new DbWrapper(Common.CnnString, CommandType.StoredProcedure); try { _objDataWrapper.AddParameter("@UserEmailId", objQuickQuery.UserEmailId); _objDataWrapper.AddParameter("@UserName", objQuickQuery.StudentName); _objDataWrapper.AddParameter("@UserMobile", objQuickQuery.UserMobileNo); _objDataWrapper.AddParameter("@UserPasseord", _objCrypto.Encrypt(objQuickQuery.UserMobileNo)); _objDataWrapper.AddParameter("@UserCity", objQuickQuery.StudentCityName); _objDataWrapper.AddParameter("@UserQuerySourceTypeId", QueryType.Com); _objDataWrapper.AddParameter("@UserCourseId", objQuickQuery.StudentCourseId); _objDataWrapper.AddParameter("@UserQuery", objQuickQuery.StudentQuery); var ObjerrMsg = (SqlParameter)(_objDataWrapper.AddParameter("@ErrMsg", "", SqlDbType.VarChar, ParameterDirection.Output, 128)); var ObjUserId = (SqlParameter)(_objDataWrapper.AddParameter("@UserId", SqlDbType.Int, ParameterDirection.Output)); _i = _objDataWrapper.ExecuteNonQuery("Aj_Proc_InsertUserQuery"); if (ObjerrMsg != null && ObjerrMsg.Value != null) { errMsg = Convert.ToString(ObjerrMsg.Value); } if (ObjUserId != null && ObjUserId.Value != null) { UserId = Convert.ToInt32(ObjUserId.Value); } } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex.ToString(); } const string addInfo = "Error while executing InsertCommonQuickQuery in Query.cs :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } return(_i); }
public override int UpdateUserInfo(UserRegistrationProperty objUserRegistrationProperty, int modifiedBy, out string errmsg) { _objDataWrapper = new DbWrapper(Common.CnnString, CommandType.StoredProcedure); errmsg = ""; var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo)); try { _objDataWrapper.AddParameter("@UserCityId", objUserRegistrationProperty.CityId); _objDataWrapper.AddParameter("@UserCountryId", objUserRegistrationProperty.CountryCode); _objDataWrapper.AddParameter("@UserPhone", objUserRegistrationProperty.PhoneNo); _objDataWrapper.AddParameter("@UserStateId", objUserRegistrationProperty.StateId); _objDataWrapper.AddParameter("@UserCatId", objUserRegistrationProperty.UserCategoryId); _objDataWrapper.AddParameter("@UserCorssAddrs", objUserRegistrationProperty.UserCorrespondenceAddress); _objDataWrapper.AddParameter("@UserEmailId", objUserRegistrationProperty.UserEmailid); _objDataWrapper.AddParameter("@UserFullName", objUserRegistrationProperty.UserFullName); _objDataWrapper.AddParameter("@UserPassword", objCrypto.Encrypt(objUserRegistrationProperty.UserPassword)); _objDataWrapper.AddParameter("@UserMobileNo", objUserRegistrationProperty.MobileNo); _objDataWrapper.AddParameter("@UserPerAddrs", objUserRegistrationProperty.UserPermanentAddress); _objDataWrapper.AddParameter("@UserPincode", objUserRegistrationProperty.UserPincode); _objDataWrapper.AddParameter("@UserStatus", objUserRegistrationProperty.UserStatus); _objDataWrapper.AddParameter("@SubUserId", objUserRegistrationProperty.UserSubId); _objDataWrapper.AddParameter("@UserCourseId", objUserRegistrationProperty.CourseId); _objDataWrapper.AddParameter("@UserGender", objUserRegistrationProperty.UserGender); _objDataWrapper.AddParameter("@UserDOB", objUserRegistrationProperty.UserDOB); _objDataWrapper.AddParameter("@UserFatherName", objUserRegistrationProperty.UserFatherName); _objDataWrapper.AddParameter("@CreatedBy", modifiedBy); var objerrMsg = (SqlParameter)(_objDataWrapper.AddParameter("@ErrMsg", "", SqlDbType.VarChar, ParameterDirection.Output, 128)); var objUserId = (SqlParameter)(_objDataWrapper.AddParameter("@UserId", objUserRegistrationProperty.UserId, SqlDbType.Int, ParameterDirection.Input)); _i = _objDataWrapper.ExecuteNonQuery("Aj_Proc_InsertUpdateUserDetails"); if (objerrMsg != null && objerrMsg.Value != null) { errmsg = Convert.ToString(objerrMsg.Value); } if (objUserId != null && objUserId.Value != null) { objUserRegistrationProperty.UserId = Convert.ToInt32(objUserId.Value); } } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex.ToString(); } const string addInfo = "Error while executing UpdateUserInfo in UserManager.cs :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } return(_i); }
protected void btnPayNow_Click(object sender, EventArgs e) { SecurePage _objSecurePage = new SecurePage(); _ObjCommon = new Common(); var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo)); MailTemplates objMailTemplates = new MailTemplates(); string formNumber = "ADMJ" + System.DateTime.Now.Year + _ObjCommon.CourseId.ToString() + _objSecurePage.LoggedInUserId.ToString(); ConsullingCourseAmount = lblCash.Text; string TransectionDetails = "You have selected the payment mode through Online Payment of" + " " + "Rs." + " " + lblCash.Text + "/- "; var UserDetails = UserManager.Instance.GetUserListById(_objSecurePage.LoggedInUserId); var sp = UserDetails.First(); UserRegistrationProperty _ObjUserRegistrationProperty = new UserRegistrationProperty { UserFullName = _objSecurePage.LoggedInUserName, UserGender = sp.UserGender, UserEmailid = _objSecurePage.LoggedInUserEmailId, MobileNo = _objSecurePage.LoggedInUserMobile, PhoneNo = sp.PhoneNo, UserId = _objSecurePage.LoggedInUserId, CourseId = sp.CourseId, UserCategoryId = _objSecurePage.LoggedInUserType, UserDOB = sp.UserDOB, UserStatus = true, UserPassword = sp.UserPassword, UserPincode = txtPincode.Text.Trim(), UserCorrespondenceAddress = txtAddress.Text.Trim() }; string ErrMsg = ""; int i = UserManagerProvider.Instance.UpdateUserInfo(_ObjUserRegistrationProperty, 1, out ErrMsg); var mail = new MailMessage { From = new MailAddress(ApplicationSettings.Instance.Email), Subject = "Direct Admission:Form Number" + formNumber }; var body = objMailTemplates.SendValidationMailForTheDirectAdmission("http://www.admissionjankari.com/", _objSecurePage.LoggedInUserName, formNumber, TransectionDetails); mail.Body = body; mail.To.Add(_objSecurePage.LoggedInUserEmailId); mail.Bcc.Add(ClsSingelton.bccDirectAdmission); Utils.SendMailMessageAsync(mail); libfuncs myUtility = new libfuncs(); Merchant_Id.Value = "M_shi18022_18022"; Amount.Value = lblCash.Text; Order_Id.Value = formNumber + DateTime.Now.ToString("hh:mm:ss"); Redirect_Url.Value = Utils.AbsoluteWebRoot + "ConformationPage.aspx?CID=" + objCrypto.Encrypt(_objSecurePage.LoggedInUserEmailId) + "&frmNumber=" + objCrypto.Encrypt(formNumber) + "&UID=" + objCrypto.Encrypt(_objSecurePage.LoggedInUserId.ToString()); string WorkingKey = ClsSingelton.WorkingKey.Trim(); Checksum.Value = myUtility.getchecksum(Merchant_Id.Value, Order_Id.Value, Amount.Value, Redirect_Url.Value, WorkingKey); billing_cust_name.Value = _objSecurePage.LoggedInUserName; billing_cust_address.Value = txtAddress.Text.Trim(); billing_cust_state.Value = txtState.Text; billing_cust_country.Value = "India"; billing_cust_tel.Value = _objSecurePage.LoggedInUserMobile; billing_cust_email.Value = _objSecurePage.LoggedInUserEmailId; delivery_cust_name.Value = ""; delivery_cust_address.Value = ""; delivery_cust_state.Value = ""; delivery_cust_country.Value = ""; delivery_cust_tel.Value = ""; billing_cust_city.Value = txtCity.Text; billing_zip_code.Value = txtPincode.Text.Trim(); delivery_cust_city.Value = ""; delivery_zip_code.Value = ""; _objConsulling = new Consulling(); i = _objConsulling.InsertUpdateUserTransctionalDetails(_objSecurePage.LoggedInUserId, formNumber); // Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", "PostDFormS();"); ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), Guid.NewGuid().ToString(), "PostDForm();", true); }
public async Task <List <T> > CreateDefaultAsync <T>(Guid identityWorkId, Guid instanceID) where T : BaseEntity { var employerRegistrations = new List <EmployerRegistration>(); var addressID = Guid.NewGuid(); employerRegistrations.Add(new EmployerRegistration() { ID = Guid.NewGuid(), Active = true, company = identityWorkId, Timestamp = DateTime.UtcNow, InstanceID = instanceID, Description = "OSCAR KALA HAAK", CreationDate = DateTime.Now, user = Guid.NewGuid(), Name = "EmplorerTest", StatusID = 1, Code = "R1723289120", RiskClass = "Risk", RiskClassFraction = 0.20m, AddressID = addressID, Address = new Schema.Address() { ID = addressID, Active = true, company = identityWorkId, Timestamp = DateTime.UtcNow, InstanceID = instanceID, Description = "Direccion Registro Patronal", CreationDate = DateTime.Now, user = Guid.NewGuid(), Name = "Direccion Registro Patronal", StatusID = 1, ExteriorNumber = "123", FederalEntity = "Jalisco", InteriorNumber = "145", Municipality = "Guadalajara", Reference = "Reference", Street = "Albert", Suburb = "Colomos", ZipCode = "44660", } }); var middlewareManager = new MiddlewareManager <EmployerRegistration>(new BaseRecordManager <EmployerRegistration>(), new EmployerRegistrationValidator()); await middlewareManager.CreateAsync(employerRegistrations, identityWorkId); var addressID1 = Guid.NewGuid(); var payrollCompanyConfiguration = new List <PayrollCompanyConfiguration>(); payrollCompanyConfiguration.Add(new PayrollCompanyConfiguration() { ID = Guid.NewGuid(), Active = true, company = identityWorkId, Timestamp = DateTime.UtcNow, InstanceID = instanceID, user = Guid.NewGuid(), Name = "Company Config", Description = "Configuration", StatusID = 1, AdjustmentPay = AdjustmentPay_16Days_Febrary.PayCalendarDays, CreationDate = DateTime.UtcNow, CurrentExerciseYear = DateTime.UtcNow.Year, CurrencyID = Guid.Parse("57B07610-ED2A-40F5-8093-FA3EAA38B41D"), //pesos DeleteDate = null, PaymentDays = 16m, PaymentPeriodicity = PaymentPeriodicity.Biweekly, PeriodInitialDate = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1), StartDate = new DateTime(DateTime.UtcNow.Year, 1, 1), RFC = "KAHO641101B39", SocialReason = "OSCAR KALA HAAK", CURP = "KAHO641101HDFLKS06", FiscalRegime = FiscalRegime.FiscalIncorporationPerson, SalaryZone = SalaryZone.ZoneA, NonDeducibleFactor = 0.25M, CurrentPeriod = 1, AddressID = addressID1, Address = new Schema.Address() { ID = addressID1, Active = true, company = identityWorkId, Timestamp = DateTime.UtcNow, InstanceID = instanceID, Description = "Direccion Registro Patronal", CreationDate = DateTime.Now, user = Guid.NewGuid(), Name = "Direccion Registro Patronal", StatusID = 1, ExteriorNumber = "123", FederalEntity = "Jalisco", InteriorNumber = "145", Municipality = "Guadalajara", Reference = "Reference", Street = "Albert", Suburb = "Colomos", ZipCode = "44660", } }); var middlewarePayrollCompanyConfigurationManager = new MiddlewareManager <PayrollCompanyConfiguration>(new BaseRecordManager <PayrollCompanyConfiguration>(), new PayrollCompanyConfigurationValidator()); await middlewarePayrollCompanyConfigurationManager.CreateAsync(payrollCompanyConfiguration, identityWorkId); var fileCER = File.ReadAllBytes(Path.Combine(AssemblyDirectory, "fiscal\\cfdi33nom12\\KAHO641101B39.cer")); var fileKEY = File.ReadAllBytes(Path.Combine(AssemblyDirectory, "fiscal\\cfdi33nom12\\KAHO641101B39.key")); var digitalSign = new DigitalSign.DigitalSign(); var employerFiscalInformations = new List <EmployerFiscalInformation>(); var clsCryptoToCreate = new ClsCrypto( identityWorkId.ToString().ToLower().Replace("-", ""), instanceID.ToString().ToLower().Replace("-", ""), instanceID.ToString().ToLower().Replace("-", "").Substring(0, 19)); var fileCerEncrypted = clsCryptoToCreate.Encrypt(Convert.ToBase64String(fileCER)); var fileKeyEncrypted = clsCryptoToCreate.Encrypt(Convert.ToBase64String(fileKEY)); var passEncrypted = StringCipher.Encrypt("12345678a"); employerFiscalInformations.Add(new EmployerFiscalInformation() { ID = Guid.NewGuid(), Active = true, company = identityWorkId, Timestamp = DateTime.UtcNow, InstanceID = instanceID, Description = "Emplorer FiscalInfoTest", CreationDate = DateTime.Now, user = Guid.NewGuid(), Name = "EmplorerFiscalInfoTest", RFC = payrollCompanyConfiguration.FirstOrDefault().RFC, StatusID = 1, CertificateCER = fileCerEncrypted, CertificateKEY = fileKeyEncrypted, CertificatePwd = passEncrypted, CertificateNumber = digitalSign.GetCertificateNumber(fileCER), StartDate = digitalSign.GetExpirationDate(fileCER).Item1, EndDate = digitalSign.GetExpirationDate(fileCER).Item2 }); var middlewareManagerFiscalInfo = new MiddlewareManager <EmployerFiscalInformation>(new BaseRecordManager <EmployerFiscalInformation>(), new EmployerFiscalInformationValidator()); await middlewareManagerFiscalInfo.CreateAsync(employerFiscalInformations, identityWorkId); return(employerRegistrations as List <T>); }
private void OnlinePayment() { var objSecurePage = new SecurePage(); _objCommon = new Common(); var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo)); var objMailTemplates = new MailTemplates(); var formNumber = "ADMJ" + System.DateTime.Now.Year + _objCommon.CourseId.ToString() + objSecurePage.LoggedInUserId.ToString(); string transectionDetails = "You have selected the payment mode through Online Payment of" + " " + "Rs." + " " + lblCash1.Text + "/- "; var userDetails = UserManagerProvider.Instance.GetUserListById(objSecurePage.LoggedInUserId); var sp = userDetails.First(); var objUserRegistrationProperty = new UserRegistrationProperty { UserFullName = objSecurePage.LoggedInUserName, UserGender = sp.UserGender, UserEmailid = objSecurePage.LoggedInUserEmailId, MobileNo = objSecurePage.LoggedInUserMobile, PhoneNo = sp.PhoneNo, UserId = objSecurePage.LoggedInUserId, CourseId = sp.CourseId, UserCategoryId = objSecurePage.LoggedInUserType, UserDOB = sp.UserDOB, UserStatus = true, UserPassword = sp.UserPassword, UserPincode = txtPincode.Text.Trim(), UserCorrespondenceAddress = txtAddress.Text.Trim() }; var errMsg = ""; var i = UserManagerProvider.Instance.UpdateUserInfo(objUserRegistrationProperty, 1, out errMsg); var mail = new MailMessage { From = new MailAddress(ApplicationSettings.Instance.Email), Subject = "Direct Admission:Form Number" + formNumber }; var amount = lblCash1.Text; var myUtility = new libfuncs(); Merchant_Id.Value = "M_shi18022_18022"; Amount.Value = amount; Order_Id.Value = formNumber + DateTime.Now.ToString("hh:mm:ss"); Redirect_Url.Value = Utils.AbsoluteWebRoot + "ConformationPage.aspx?CID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserEmailId) + "&frmNumber=" + objCrypto.Encrypt(formNumber) + "&UID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserId.ToString() + "&Amount=" + amount); var workingKey = ClsSingelton.WorkingKey.Trim(); Checksum.Value = myUtility.getchecksum(Merchant_Id.Value, Order_Id.Value, Amount.Value, Redirect_Url.Value, workingKey); billing_cust_name.Value = objSecurePage.LoggedInUserName; billing_cust_address.Value = txtAddress.Text.Trim(); billing_cust_state.Value = txtState.Text; billing_cust_country.Value = "India"; billing_cust_tel.Value = objSecurePage.LoggedInUserMobile; billing_cust_email.Value = objSecurePage.LoggedInUserEmailId; delivery_cust_name.Value = ""; delivery_cust_address.Value = ""; delivery_cust_state.Value = ""; delivery_cust_country.Value = ""; delivery_cust_tel.Value = ""; billing_cust_city.Value = txtCity.Text; billing_zip_code.Value = txtPincode.Text.Trim(); delivery_cust_city.Value = ""; delivery_zip_code.Value = ""; _objConsulling = new Consulling(); i = _objConsulling.InsertUpdateUserTransctionalDetails(objSecurePage.LoggedInUserId, formNumber); ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "YourUniqueScriptKey", "PostDForm();", true); }
private void OnlinePayment() { var objSecurePage = new SecurePage(); _objCommon = new Common(); var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo)); var objMailTemplates = new MailTemplates(); var formNumber = "ADMJ" + System.DateTime.Now.Year + _objCommon.CourseId.ToString() + objSecurePage.LoggedInUserId.ToString(); var userDetails = UserManagerProvider.Instance.GetUserListById(objSecurePage.LoggedInUserId); var sp = userDetails.First(); var objUserRegistrationProperty = new UserRegistrationProperty { UserFullName = objSecurePage.LoggedInUserName, UserGender = sp.UserGender, UserEmailid = objSecurePage.LoggedInUserEmailId, MobileNo = objSecurePage.LoggedInUserMobile, PhoneNo = sp.PhoneNo, UserId = objSecurePage.LoggedInUserId, CourseId = sp.CourseId, UserCategoryId = objSecurePage.LoggedInUserType, UserDOB = sp.UserDOB, UserStatus = true, UserPassword = sp.UserPassword, UserPincode = txtPincode.Text.Trim(), UserCorrespondenceAddress = txtAddress.Text.Trim() }; var errMsg = ""; int i = UserManagerProvider.Instance.UpdateUserInfo(objUserRegistrationProperty, 1, out errMsg); var myUtility = new libfuncs(); Merchant_Id.Value = "M_shi18022_18022"; var bookSeatPayment = ""; if (Request.QueryString["BookSeatPayment"] != null) { bookSeatPayment = objCrypto.Decrypt(Request.QueryString["BookSeatPayment"].ToString()); } Amount.Value = !string.IsNullOrEmpty(bookSeatPayment)?bookSeatPayment:"26100"; Order_Id.Value = formNumber + DateTime.Now.ToString("hh:mm:ss"); Redirect_Url.Value = "http://admissionjankari.com/ConformationPage.aspx?CID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserEmailId) + "&frmNumber=" + objCrypto.Encrypt(formNumber) + "&UID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserId.ToString()); var workingKey = ClsSingelton.WorkingKey.Trim(); Checksum.Value = myUtility.getchecksum(Merchant_Id.Value, Order_Id.Value, Amount.Value, Redirect_Url.Value, workingKey); billing_cust_name.Value = objSecurePage.LoggedInUserName; billing_cust_address.Value = txtAddress.Text.Trim(); billing_cust_state.Value = txtState.Text; billing_cust_country.Value = "India"; billing_cust_tel.Value = objSecurePage.LoggedInUserMobile; billing_cust_email.Value = objSecurePage.LoggedInUserEmailId; delivery_cust_name.Value = ""; delivery_cust_address.Value = ""; delivery_cust_state.Value = ""; delivery_cust_country.Value = ""; delivery_cust_tel.Value = ""; billing_cust_city.Value = txtCity.Text; billing_zip_code.Value = txtPincode.Text.Trim(); delivery_cust_city.Value = ""; delivery_zip_code.Value = ""; _objConsulling = new Consulling(); ScriptManager.RegisterStartupScript(this, GetType(), "YourUniqueScriptKey", "PostDForm();", true); }
private void OnlinePayment(string orderNumber) { var objSecurePage = new SecurePage(); _objCommon = new Common(); var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo)); var objMailTemplates = new MailTemplates(); string transactionDetails = "You have selected the payment mode through Online Payment of" + " " + "Rs." + " " + hdnAmount.Value + "/- "; var userDetails = UserManagerProvider.Instance.GetUserListById(objSecurePage.LoggedInUserId); var objCarProduct = new Common().GetProductForCart(0, Request["id"] == null ? orderNumber : null, Request["id"] != null ? Convert.ToInt32(Request["id"]) : 0); var mail = new MailMessage { From = new MailAddress(ApplicationSettings.Instance.Email), Subject = "Product Order Number:" + orderNumber }; var body = objMailTemplates.SendProductConfirmationMail(objSecurePage.LoggedInUserName, orderNumber, transactionDetails, objCarProduct.Tables[0]); mail.Body = body; mail.To.Add(objSecurePage.LoggedInUserEmailId); mail.Bcc.Add(ClsSingelton.bccDirectAdmission); Utils.SendMailMessageAsync(mail); var sp = userDetails.First(); var objUserRegistrationProperty = new UserRegistrationProperty { UserFullName = objSecurePage.LoggedInUserName, UserGender = sp.UserGender, UserEmailid = objSecurePage.LoggedInUserEmailId, MobileNo = objSecurePage.LoggedInUserMobile, PhoneNo = sp.PhoneNo, UserId = objSecurePage.LoggedInUserId, CourseId = sp.CourseId, UserCategoryId = objSecurePage.LoggedInUserType, UserDOB = sp.UserDOB, UserStatus = true, UserPassword = sp.UserPassword, UserPincode = txtPincode.Text.Trim(), UserCorrespondenceAddress = txtAddress.Text.Trim() }; var errMsg = ""; var i = UserManagerProvider.Instance.UpdateUserInfo(objUserRegistrationProperty, 1, out errMsg); var amount = hdnAmount.Value; var myUtility = new libfuncs(); Merchant_Id.Value = "M_shi18022_18022"; Amount.Value = amount; Order_Id.Value = orderNumber + DateTime.Now.ToString("hh:mm:ss"); Redirect_Url.Value = Request["id"] != null ? Utils.AbsoluteWebRoot + "account/paymentconfirmation.aspx?CID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserEmailId) + "&orderNumber=" + objCrypto.Encrypt(orderNumber) + "&UID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserId.ToString() + "&Amount=" + amount + "&id=" + Request["id"]) : Utils.AbsoluteWebRoot + "account/paymentconfirmation.aspx?CID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserEmailId) + "&orderNumber=" + objCrypto.Encrypt(orderNumber) + "&UID=" + objCrypto.Encrypt(objSecurePage.LoggedInUserId.ToString()); var workingKey = ClsSingelton.WorkingKey.Trim(); Checksum.Value = myUtility.getchecksum(Merchant_Id.Value, Order_Id.Value, Amount.Value, Redirect_Url.Value, workingKey); billing_cust_name.Value = objSecurePage.LoggedInUserName; billing_cust_address.Value = txtAddress.Text.Trim(); billing_cust_state.Value = txtState.Text; billing_cust_country.Value = "India"; billing_cust_tel.Value = objSecurePage.LoggedInUserMobile; billing_cust_email.Value = objSecurePage.LoggedInUserEmailId; delivery_cust_name.Value = ""; delivery_cust_address.Value = ""; delivery_cust_state.Value = ""; delivery_cust_country.Value = ""; delivery_cust_tel.Value = ""; billing_cust_city.Value = txtCity.Text; billing_zip_code.Value = txtPincode.Text.Trim(); delivery_cust_city.Value = ""; delivery_zip_code.Value = ""; _objConsulling = new Consulling(); ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "YourUniqueScriptKey", "PostDForm();", true); }
private async Task <EmployerFiscalInformationData> SaveFiscalInformationAsync(EmployerFiscalInformationData data) { //Decrypt cer and key files try { var employerFiscalInformations = new List <EmployerFiscalInformation>(); var digitalSign = new DigitalSign.DigitalSign(); var requiredData = getRequireData(); var clsCrypto = new ClsCrypto(requiredData.Ps, requiredData.IV, requiredData.Salt); data.cfb = clsCrypto.Decrypt(data.cfb).Replace("data:application/x-x509-ca-cert;base64,", String.Empty).Replace("data:application/octet-stream;base64,", String.Empty); data.kfb = clsCrypto.Decrypt(data.kfb).Replace("data:application/x-x509-ca-cert;base64,", String.Empty).Replace("data:application/octet-stream;base64,", String.Empty); if (!String.IsNullOrEmpty(data.cfb) && !String.IsNullOrEmpty(data.kfb)) { var fileCER = Convert.FromBase64String(data.cfb); var fileKEY = Convert.FromBase64String(data.kfb); //validate Cer and Key digitalSign.validateCerKEYContent(fileCER, fileKEY, data.pfb, data.RFC); var clsCryptoToCreate = new ClsCrypto( SessionModel.CompanyID.ToString().ToLower().Replace("-", ""), SessionModel.InstanceID.ToString().ToLower().Replace("-", ""), SessionModel.InstanceID.ToString().ToLower().Replace("-", "").Substring(0, 19)); var certificateCER = clsCryptoToCreate.Encrypt(data.cfb); var certificateKEY = clsCryptoToCreate.Encrypt(data.kfb); var certificatePwd = StringCipher.Encrypt(data.pfb); //Certificate number data.CertificateNumber = digitalSign.GetCertificateNumber(fileCER); //expiration date var resultExpirationDate = digitalSign.GetExpirationDate(fileCER); data.StartDate = resultExpirationDate.Item1.ToShortDateString(); data.ExpirationDate = resultExpirationDate.Item2.ToShortDateString(); employerFiscalInformations.Add(new EmployerFiscalInformation() { ID = data.ID == null ? Guid.NewGuid() : (Guid)data.ID, Active = true, company = SessionModel.CompanyID, Timestamp = DateTime.UtcNow, InstanceID = SessionModel.InstanceID, Description = $"InfoFiscal de {data.RFC}", CreationDate = DateTime.UtcNow, user = SessionModel.IdentityID, Name = "InfoFiscal", StatusID = 1, RFC = data.RFC, CertificateCER = certificateCER, CertificateKEY = certificateKEY, CertificatePwd = certificatePwd, CertificateNumber = data.CertificateNumber, StartDate = resultExpirationDate.Item1, EndDate = resultExpirationDate.Item2 }); if (data.ID != null) { await clientFiscal.UpdateAsync(employerFiscalInformations, SessionModel.CompanyID); } else { await clientFiscal.CreateAsync(employerFiscalInformations, SessionModel.CompanyID); } data.ID = employerFiscalInformations.FirstOrDefault().ID; } else { throw new CotorraException(3012, "3012", "Es necesario especificar el certificado y el key.", null); } } catch (Exception ex) { throw new CotorraException(3011, "3011", $"OcurriĆ³ un error al cargar el certificado: {ex.Message}", ex); } return(data); }