Example #1
0
        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);
        }
Example #2
0
        // Method to Bind The User Details if User Want to make the payment
        protected void GetUserDetails(string courseId, string userId)
        {
            var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo));

            _objCommon = new Common();
            var objSecurePage = new SecurePage();

            try
            {
                courseId            = objCrypto.Decrypt(courseId);
                userId              = objCrypto.Decrypt(userId);
                _objCommon.CourseId = Convert.ToInt16(courseId);
                var userDetails = UserManagerProvider.Instance.GetUserListById(Convert.ToInt32(userId)).FirstOrDefault();
                if (userDetails != null)
                {
                    objSecurePage.LoggedInUserEmailId = userDetails.UserEmailid;
                    objSecurePage.LoggedInUserId      = userDetails.UserId;
                    objSecurePage.LoggedInUserMobile  = userDetails.MobileNo;
                    objSecurePage.LoggedInUserName    = userDetails.UserFullName;
                    objSecurePage.LoggedInUserType    = userDetails.UserCategoryId;
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.ToString();
                }
                const string addInfo = "Error while executing GetUserDetails in PaymentOptions.aspx for user :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
        }
Example #3
0
        private void UpdateUserTransctionalDetails(string euserEmailId, string efrmNumber, string euserId)
        {
            var objCrypto        = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo));
            var objConsulling    = new Consulling();
            var objMailTemplates = new MailTemplates();
            var objSecure        = new SecurePage();

            euserEmailId = euserEmailId.Replace(" ", "+");
            string emailId = Convert.ToString(objCrypto.Decrypt(euserEmailId));

            try
            {
                euserId = euserId.Replace(" ", "+");
                string userId    = Convert.ToString(objCrypto.Decrypt(euserId));
                string frmNumber = efrmNumber.Replace(" ", "+");
                frmNumber = Convert.ToString(objCrypto.Decrypt(frmNumber));
                int i;
                i = objConsulling.InsertUpdateUserTransctionalDetails(Convert.ToInt32(userId), frmNumber, true, "online", "PNB", Convert.ToString(frmNumber +
                                                                                                                                                  DateTime.Now.ToString(
                                                                                                                                                      "hh:mm:ss")), Request.QueryString["Amount"] != null ? objCrypto.Decrypt(Request.QueryString["Amount"]) : "26100");
                if (i > 0)
                {
                    var userDetails = UserManagerProvider.Instance.GetUserListById(Convert.ToInt32(userId));
                    var sp          = userDetails.First();
                    objSecure.LoggedInUserEmailId = emailId;
                    objSecure.LoggedInUserId      = sp.UserId;
                    objSecure.LoggedInUserName    = Common.GetStringProperCase(sp.UserFullName);
                    objSecure.LoggedInUserType    = sp.UserCategoryId;
                    objSecure.LoggedInUserMobile  = sp.MobileNo;
                    lblName.Text = Common.GetStringProperCase(sp.UserFullName);
                    var mail = new MailMessage
                    {
                        From    = new MailAddress(ApplicationSettings.Instance.Email),
                        Subject = "AdmissionJankari:Direct Admission Payment confirmation for form number:" + frmNumber
                    };
                    var body = objMailTemplates.MailBodyForPaymentConformation("http://www.admissionjankari.com/", sp.UserFullName, frmNumber, "Online", Convert.ToString(frmNumber + DateTime.Now.ToString("hh:mm:ss")));
                    mail.Body = body;
                    mail.To.Add(emailId);
                    mail.Bcc.Add(ClsSingelton.bccDirectAdmission);
                    Utils.SendMailMessageAsync(mail);
                    sucessMsg.Visible = true;
                }
                else
                {
                    failureMsg.Visible = true;
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                failureMsg.Visible = true;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.ToString();
                }
                const string addInfo = "Error while executing UpdateUserTransctionalDetails in PaymentConformation.aspx for user :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
        }
Example #4
0
        private List <UserRegistrationProperty> BindUserListObject(DataTable datatable)
        {
            var userListObject = new List <UserRegistrationProperty>();
            var objCrypto      = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo));

            try
            {
                if (datatable.Rows.Count > 0)
                {
                    for (var j = 0; j < datatable.Rows.Count; j++)
                    {
                        var objUserProperty = new UserRegistrationProperty
                        {
                            CityId                    = (datatable.Rows[j]["AjCityId"] is DBNull)?0:Convert.ToInt32(datatable.Rows[j]["AjCityId"]),
                            CityName                  = (datatable.Rows[j]["AjCityName"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjCityName"]),
                            CountryCode               = (datatable.Rows[j]["AjCountryId"] is DBNull) ? 0 : Convert.ToInt32(datatable.Rows[j]["AjCountryId"]),
                            CountryName               = (datatable.Rows[j]["AjCountryName"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjCountryName"]),
                            PhoneNo                   = (datatable.Rows[j]["AjUserPhoneNo"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserPhoneNo"]),
                            MobileNo                  = (datatable.Rows[j]["AjUserMobile"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserMobile"]),
                            StateId                   = (datatable.Rows[j]["AjStateId"] is DBNull) ? 0 : Convert.ToInt32(datatable.Rows[j]["AjStateId"]),
                            StateName                 = (datatable.Rows[j]["AjStateName"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjStateName"]),
                            UserCategoryId            = (datatable.Rows[j]["AjUserCategoryId"] is DBNull) ? 0 : Convert.ToInt32(datatable.Rows[j]["AjUserCategoryId"]),
                            UserCategoryName          = (datatable.Rows[j]["AjUserCategoryName"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserCategoryName"]),
                            UserCorrespondenceAddress = (datatable.Rows[j]["AjUserMailingAddress"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserMailingAddress"]),
                            UserEmailid               = (datatable.Rows[j]["AjUserEmail"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserEmail"]),
                            UserFullName              = (datatable.Rows[j]["AjUserFullName"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserFullName"]),
                            UserId                    = (datatable.Rows[j]["AjUserId"] is DBNull) ? 0 : Convert.ToInt32(datatable.Rows[j]["AjUserId"]),
                            UserPermanentAddress      = (datatable.Rows[j]["AjUserPermanentAddress"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserPermanentAddress"]),
                            UserPincode               = (datatable.Rows[j]["AjUserPincode"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserPincode"]),
                            CourseId                  = (datatable.Rows[j]["AjCourseId"] is DBNull) ? 0 : Convert.ToInt32(datatable.Rows[j]["AjCourseId"]),
                            CourseName                = (datatable.Rows[j]["AjCourseName"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjCourseName"]),
                            UserGender                = (datatable.Rows[j]["AjUserGender"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserGender"]),
                            UserDOB                   = (datatable.Rows[j]["AjUserDOB"] is DBNull) ? System.DateTime.Now : Convert.ToDateTime(datatable.Rows[j]["AjUserDOB"]),
                            UserPassword              = objCrypto.Decrypt((datatable.Rows[j]["AjUserPassword"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserPassword"])),

                            UserImage             = (datatable.Rows[j]["AjUserImage"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjUserImage"]),
                            ApplicationFormNumber = datatable.Columns.Contains("AjStudentFormNumber")?((datatable.Rows[j]["AjStudentFormNumber"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjStudentFormNumber"])):null,

                            StudentPaymentStatus = datatable.Columns.Contains("AjStudentPaymentStatus") ? ((datatable.Rows[j]["AjStudentPaymentStatus"] is DBNull) ? null : Convert.ToString(datatable.Rows[j]["AjStudentPaymentStatus"])) : null,
                            UserStatus           = datatable.Columns.Contains("AjUserStatus") ? ((datatable.Rows[j]["AjUserStatus"] is DBNull) ? false : Convert.ToBoolean(datatable.Rows[j]["AjUserStatus"])) : false,
                        };
                        userListObject.Add(objUserProperty);
                    }
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.ToString();
                }
                const string addInfo = "Error while executing BindUserCategoryListObject in UserManager.cs  :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
            return(userListObject);
        }
Example #5
0
        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);
        }
Example #6
0
        private (byte[], byte[], string) Crypto(CancelPayrollStampingParams cancelPayrollStampingParams, string certificateCER,
                                                string certificateKey, string certPassword)
        {
            var clsCryptoToCreate = new ClsCrypto(
                cancelPayrollStampingParams.IdentityWorkID.ToString().ToLower().Replace("-", ""),
                cancelPayrollStampingParams.InstanceID.ToString().ToLower().Replace("-", ""),
                cancelPayrollStampingParams.InstanceID.ToString().ToLower().Replace("-", "").Substring(0, 19));
            var certificatebytesCER  = Convert.FromBase64String(clsCryptoToCreate.Decrypt(certificateCER));
            var certificatebytesKEY  = Convert.FromBase64String(clsCryptoToCreate.Decrypt(certificateKey));
            var certPasswordToResult = StringCipher.Decrypt(certPassword);

            return(certificatebytesCER, certificatebytesKEY, certPasswordToResult);
        }
Example #7
0
        public override string GetUserPassword(string emailId, 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("@UserEmailId", emailId);
                var ObjErrMsg =
                    (SqlParameter)(_objDataWrapper.AddParameter("@ErrMsg", "", SqlDbType.VarChar, ParameterDirection.Output, 128));
                var objPassword =
                    (SqlParameter)(_objDataWrapper.AddParameter("@Password", "", SqlDbType.VarChar, ParameterDirection.Output, 64));
                _i = _objDataWrapper.ExecuteNonQuery("Aj_Proc_GetUserPassword");
                if (ObjErrMsg != null && ObjErrMsg.Value != null)
                {
                    errmsg = Convert.ToString(ObjErrMsg.Value);
                }
                if (objPassword != null && objPassword.Value != null)
                {
                    Password = Convert.ToString(objPassword.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(!string.IsNullOrEmpty(Password)? objCrypto.Decrypt(Password):"");
        }
Example #8
0
        private void UpdateUserTransctionalDetails(string euserEmailId, string orderNumb, string euserId, string id = null)
        {
            var objSecurePage    = new SecurePage();
            var objCrypto        = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo));
            var objMailTemplates = new MailTemplates();
            var objSecure        = new SecurePage();

            euserEmailId = euserEmailId.Replace(" ", "+");
            string emailId = Convert.ToString(objCrypto.Decrypt(euserEmailId));

            try
            {
                euserId = euserId.Replace(" ", "+");
                string userId      = Convert.ToString(objCrypto.Decrypt(euserId));
                string orderNumber = orderNumb.Replace(" ", "+");
                orderNumber = Convert.ToString(objCrypto.Decrypt(orderNumber));
                var i = new Common().UpdateOrderIdForProduct(objSecurePage.LoggedInUserId, false, Request["id"] != null ? null : orderNumber,
                                                             "Online",
                                                             Request["id"] != null ? Convert.ToInt32(Request["id"]) : 0);
                if (i > 0)
                {
                    var userDetails = UserManagerProvider.Instance.GetUserListById(Convert.ToInt32(userId));
                    var sp          = userDetails.First();
                    objSecure.LoggedInUserEmailId = emailId;
                    objSecure.LoggedInUserId      = sp.UserId;
                    objSecure.LoggedInUserName    = Common.GetStringProperCase(sp.UserFullName);
                    objSecure.LoggedInUserType    = sp.UserCategoryId;
                    objSecure.LoggedInUserMobile  = sp.MobileNo;
                    lblName.Text = Common.GetStringProperCase(sp.UserFullName);
                    var mail = new MailMessage
                    {
                        From    = new MailAddress(ApplicationSettings.Instance.Email),
                        Subject = "AdmissionJankari:Product Payment confirmation for order number:" + orderNumber
                    };
                    var objCarProduct = new Common().GetProductForCart(0, id == null?orderNumber:null,
                                                                       id == null ? 0 : Convert.ToInt32(id));
                    var body = objMailTemplates.SendProductConfirmationMailAfterSuccess(objSecurePage.LoggedInUserName,
                                                                                        orderNumber,
                                                                                        objCarProduct.Tables[0],
                                                                                        "Online");
                    mail.Body = body;
                    mail.To.Add(emailId);
                    mail.Bcc.Add(ClsSingelton.bccDirectAdmission);
                    Utils.SendMailMessageAsync(mail);
                    sucessMsg.Visible = true;
                }
                else
                {
                    failureMsg.Visible = true;
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                failureMsg.Visible = true;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.ToString();
                }
                const string addInfo =
                    "Error while executing UpdateUserTransctionalDetails in PaymentConformation.aspx for user :: -> ";
                var objPub = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
        }
Example #9
0
        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 string BindPaymentAmount(int courseId)
        //{
        //    Consulling _objConsulling = new Consulling();
        //    var amount = "";
        //    try
        //    {
        //        amount = _objConsulling.GetPayemntAmountAccordingToCourse(courseId);
        //    }
        //    catch (Exception ex)
        //    {
        //        var err = ex.Message;
        //        if (ex.InnerException != null)
        //        {
        //            err = err + " :: Inner Exception :- " + ex.ToString();
        //        }
        //        const string addInfo = "Error while executing BindPaymentAmount in UcCollegeBranchEvent.aspx  :: -> ";
        //        var objPub = new ClsExceptionPublisher();
        //        objPub.Publish(err, addInfo);
        //    }
        //    return amount;
        //}
        protected void BtnRegisterClick(object sender, EventArgs e)
        {
            MailTemplates _objmailTemplete = new MailTemplates();

            _objSecurePage = new SecurePage();

            try
            {
                _objUserRegistrationProperty = new UserRegistrationProperty
                {
                    UserFullName   = txtEventUser.Text.Trim(),
                    UserEmailid    = txtEmailIdEvent.Text.Trim(),
                    MobileNo       = txtMobileEvent.Text.Trim(),
                    UserCategoryId = Convert.ToInt16(Usertype.Student),
                    CourseId       = CourseId,
                    UserPassword   = txtMobileEvent.Text.Trim()
                };
                var errMsg = "";
                var result = UserManagerProvider.Instance.InsertUserInfo(_objUserRegistrationProperty, Convert.ToInt16(Usertype.Student), out errMsg);
                if (result > 0)
                {
                    var mail = new MailMessage
                    {
                        From    = new MailAddress(ApplicationSettings.Instance.Email),
                        Subject = "AdmissionJankari: Registation mail "
                    };
                    var body = _objmailTemplete.MailBodyForRegistation(txtEventUser.Text, txtEmailIdEvent.Text, txtMobileEvent.Text);
                    mail.Body = body;
                    mail.To.Add(_objUserRegistrationProperty.UserEmailid);
                    Utils.SendMailMessageAsync(mail);
                    var result1 = UserManagerProvider.Instance.GetUserListByEmailId(txtEmailIdEvent.Text.Trim());

                    var mail1 = new MailMessage
                    {
                        From    = new MailAddress(ApplicationSettings.Instance.Email),
                        Subject = "AdmissionJankari: Event attending by user-" + txtEventUser.Text
                    };
                    var body1 = _objmailTemplete.MailToAdminRegardingEventAttendingByStudent(txtEventUser.Text, txtEmailIdEvent.Text, txtMobileEvent.Text, CollegeName, hdnCollegeEvent.Value, hdnCollegeDate.Value);
                    mail1.Body = body1;
                    mail1.To.Add(ClsSingelton.donationMailId);
                    Utils.SendMailMessageAsync(mail1);

                    if (result1.Count > 0)
                    {
                        var query1 = result1.First();
                        _objSecurePage.LoggedInUserId      = query1.UserId;
                        _objSecurePage.LoggedInUserType    = query1.UserCategoryId;
                        _objSecurePage.LoggedInUserEmailId = query1.UserEmailid;
                        _objSecurePage.LoggedInUserName    = query1.UserFullName;
                        _objSecurePage.LoggedInUserMobile  = query1.MobileNo;
                        var collegeInsert = new Consulling().InsertStudentCollegePrefrance(_objSecurePage.LoggedInUserId, CollegeName, CourseId);
                        var cityInsert    = new Consulling().InsertStudentCityPrefrance(_objSecurePage.LoggedInUserId, CityName);
                        var objCrypto     = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo));
                        //  var amount = BindPaymentAmount(CourseId);
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>EventMessage();</script>", false);
                        //Response.Redirect("/PaymentOptions.aspx?BookSeatPayment=" + objCrypto.Encrypt(amount));
                    }
                }
                else
                {
                    var result1 = UserManagerProvider.Instance.GetUserListByEmailId(txtEmailIdEvent.Text.Trim());

                    if (result1.Count > 0)
                    {
                        var query1 = result1.First();
                        _objSecurePage.LoggedInUserId      = query1.UserId;
                        _objSecurePage.LoggedInUserType    = query1.UserCategoryId;
                        _objSecurePage.LoggedInUserEmailId = query1.UserEmailid;
                        _objSecurePage.LoggedInUserName    = query1.UserFullName;
                        _objSecurePage.LoggedInUserMobile  = query1.MobileNo;

                        var collegeInsert = new Consulling().InsertStudentCollegePrefrance(_objSecurePage.LoggedInUserId, CollegeName, CourseId);
                        var cityInsert    = new Consulling().InsertStudentCityPrefrance(_objSecurePage.LoggedInUserId, CityName);
                        var objCrypto     = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo));
                        // var amount = BindPaymentAmount(CourseId);
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>EventMessage();</script>", false);
                        // Response.Redirect("/PaymentOptions.aspx?BookSeatPayment=" + objCrypto.Encrypt(amount));
                    }
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.InnerException.Message;
                }
                const string addInfo = "Error while executing BtnRegisterClick in UcCollegeBranchEvent.ascx  :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
        }
Example #11
0
        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);
        }
Example #12
0
    public static void Create_Snapshot()
    {
        object authenticate = null;
        object mvarsError   = null;
        object memberOF     = null;
        object mstr         = null;
        object f            = null;
        //oCont)
        string appstr        = null;
        string govstr        = null;
        string strc          = null;
        string strDepartment = null;

        ActiveDs.IADsUser         oUser      = default(ActiveDs.IADsUser);
        ActiveDs.IADsContainer    oContainer = default(ActiveDs.IADsContainer);
        ActiveDs.IADsOpenDSObject dso        = default(ActiveDs.IADsOpenDSObject);
        string xas  = null;
        string appl = null;

        string[] a         = null;
        string[] temparray = null;
        string   tempstr   = null;

        string[] aGovernment    = null;
        object   entry          = null;
        int      temporaryDate2 = 0;
        int      date2          = 0;
        int      i       = 0;
        int      y       = 0;
        int      mcount  = 0;
        object   mmax    = null;
        string   strApps = null;
        string   strGovt = null;
        int      UCount  = 0;

        Microsoft.VisualBasic.Collection colGovernment   = new Microsoft.VisualBasic.Collection();
        Microsoft.VisualBasic.Collection colApplications = new Microsoft.VisualBasic.Collection();
        string        memberOFS = "";
        SqlConnection cnVIP_EXP = new SqlConnection();

        cnVIP_EXP.ConnectionString = My.Settings.VIP_EXPANDEDConnectionString;

        SqlConnection cnADS2 = new SqlConnection();
        SqlConnection cnADS  = new SqlConnection();

        cnADS.ConnectionString  = My.Settings.AdsConnectionString;
        cnADS2.ConnectionString = My.Settings.AdsConnectionString;

        SqlCommand cmdADS2 = new SqlCommand("AD_SNAPSHOT_ALL_INSERT", cnADS);
        SqlCommand cmdADS3 = new SqlCommand("AD_SNAPSHOT_ALL_DELETE_ALL", cnADS);
        SqlCommand cmdADS4 = new SqlCommand("GetPROVDescription", cnADS2);
        SqlCommand cmdADS5 = new SqlCommand("GetSNAMEDept", cnADS2);

        cmdADS2.CommandType = CommandType.StoredProcedure;
        cmdADS3.CommandType = CommandType.StoredProcedure;
        cmdADS4.CommandType = CommandType.StoredProcedure;
        cmdADS5.CommandType = CommandType.StoredProcedure;

        SqlParameter pUCount          = new SqlParameter("@UCount", SqlDbType.BigInt);
        SqlParameter pPersalnr        = new SqlParameter("@PersalNr", SqlDbType.VarChar, 8);
        SqlParameter pAccountNr       = new SqlParameter("@AccountNr", SqlDbType.VarChar, 9);
        SqlParameter pNatProv         = new SqlParameter("@NatProv ", SqlDbType.VarChar, 20);
        SqlParameter pVote            = new SqlParameter("@Vote", SqlDbType.VarChar, 55);
        SqlParameter pDeptCode        = new SqlParameter("@DeptCode", SqlDbType.VarChar, 9);
        SqlParameter pEMail           = new SqlParameter("@EMail", SqlDbType.VarChar, 150);
        SqlParameter pCell            = new SqlParameter("@Cell", SqlDbType.VarChar, 20);
        SqlParameter pPhone           = new SqlParameter("@Phone", SqlDbType.VarChar, 20);
        SqlParameter pFirstName       = new SqlParameter("@FirstName", SqlDbType.VarChar, 20);
        SqlParameter pLastname        = new SqlParameter("@Lastname", SqlDbType.VarChar, 40);
        SqlParameter pApplMember      = new SqlParameter("@ApplMember", SqlDbType.VarChar, 500);
        SqlParameter pDeptMember      = new SqlParameter("@DeptMember", SqlDbType.VarChar, 4000);
        SqlParameter pDepartment      = new SqlParameter("@Department", SqlDbType.VarChar, 10);
        SqlParameter pAccountDisabled = new SqlParameter("@AccountDisabled", SqlDbType.SmallInt);
        SqlParameter pLOGIS           = new SqlParameter("@LOGIS", SqlDbType.SmallInt);
        SqlParameter pHR         = new SqlParameter("@HR", SqlDbType.SmallInt);
        SqlParameter pFINANCIALS = new SqlParameter("@FINANCIALS", SqlDbType.SmallInt);
        SqlParameter pGFS        = new SqlParameter("@GFS", SqlDbType.SmallInt);
        SqlParameter pDPSA       = new SqlParameter("@DPSA", SqlDbType.SmallInt);
        SqlParameter pSNAME      = new SqlParameter("@SNAME", SqlDbType.VarChar, 9);

        ClsCrypto enc = new ClsCrypto();

        dso        = Interaction.GetObject("LDAP:");
        oContainer = dso.OpenDSObject("LDAP://" + My.Settings.IP_ADDRESS_PRD + "/" + My.Settings.AD_USERS_PRD, My.Settings.ADSMasterUsername_PRD, enc.Dekodeer128(My.Settings.ADSMasterPassword_PRD.ToString), 0);
        cnADS.Open();
        cmdADS3.ExecuteNonQuery();

        foreach (oUser in oContainer)
        {
            UCount       += 1;
            pUCount.Value = UCount;
            mcount        = mcount + 1;
            switch (Strings.LCase(oUser.Class))
            {
            case "user":

                if ((Strings.Trim(oUser.SAMaccountname) != null))
                {
                    frmMain.tsADPosition.Text = oUser.samaccountname;
                    pSNAME.Value = oUser.Department.ToLower.ToString.Trim + "";
                    cmdADS5.Parameters.Add(pSNAME);
                    cnADS2.Open();
                    pVote.Value = cmdADS5.ExecuteScalar().ToString() + "";
                    cnADS2.Close();
                    cmdADS5.Parameters.Remove(pSNAME);

                    // ERROR: Not supported in C#: OnErrorStatement

                    pAccountNr.Value = oUser.SAMaccountname.ToString.Trim + "";
                    cmdADS4.Parameters.Add(pSNAME);
                    cnADS2.Open();
                    pNatProv.Value = cmdADS4.ExecuteScalar().ToString() + "";
                    cnADS2.Close();
                    cmdADS4.Parameters.Remove(pSNAME);

                    pDeptCode.Value = pSNAME.Value + "";

                    if (Information.IsDBNull(Strings.Trim(oUser.EmailAddress)))
                    {
                        pEMail.Value = "No Email";
                    }
                    else
                    {
                        pEMail.Value = oUser.EmailAddress.ToLower.Trim + "";
                    }

                    if (Information.IsDBNull(Convert.ToString(oUser.TelephoneMobile)) | (oUser.TelephoneMobile == null))
                    {
                        pCell.Value = "No Mobile";
                    }
                    else
                    {
                        pCell.Value = Strings.Replace(Strings.Replace(Convert.ToString(oUser.TelephoneMobile), "(", ""), ")", "");
                    }

                    if (Information.IsDBNull(Convert.ToString(oUser.TelephoneNumber)))
                    {
                        pPhone.Value = "No TelephoneNumber";
                    }
                    else
                    {
                        pPhone.Value = Strings.Replace(Strings.Replace(oUser.TelephoneNumber.ToString, "(", ""), ")", "") + "";
                    }

                    if (Information.IsDBNull(oUser.FirstName))
                    {
                        pFirstName.Value = "No Firstname";
                    }
                    else
                    {
                        pFirstName.Value = oUser.FirstName.Trim + "";
                    }

                    if (Information.IsDBNull(oUser.LastName))
                    {
                        pLastname.Value = "No LastName";
                    }
                    else
                    {
                        pLastname.Value = oUser.LastName.Trim + "";
                    }

                    memberOF = oUser.GetEx("MemberOf");

                    if (Err().Number == -2147463155)
                    {
                        colApplications.Add("INVALID USER");
                        colGovernment.Add("INVALID USER");
                        pLOGIS.Value      = 0;
                        pDPSA.Value       = 0;
                        pGFS.Value        = 0;
                        pHR.Value         = 0;
                        pFINANCIALS.Value = 0;
                    }
                    else
                    {
                        // Start with the new structure.
                        memberOFS = "";

                        foreach (object entry_loopVariable in memberOF)
                        {
                            entry = entry_loopVariable;
                            //Clear collections

                            if ((Strings.InStr(1, Strings.UCase(entry), "GOVERNMENT") > 0 | Strings.InStr(1, Strings.UCase(entry), "VUL TS USERS") > 0 | Strings.InStr(1, Strings.UCase(entry), "APPLICATION") > 0) & Strings.InStr(1, Strings.UCase(entry), "CN=") > 0)
                            {
                                entry = Strings.Replace(Strings.Replace(entry, "OU=", ""), "CN=", "");

                                temparray = Strings.Split(entry, ",");
                                tempstr   = Strings.Replace(temparray[0], "_ACCESS_ALL", "");
                                tempstr   = Strings.Replace(tempstr, "_ALL_ACCESS", "");
                                tempstr   = Strings.Replace(tempstr, "_SEC32", "");

                                if (Strings.InStr(1, Strings.UCase(entry), "GOVERNMENT") > 0)
                                {
                                    colGovernment.Add(tempstr);
                                }
                                else if (Strings.InStr(1, Strings.UCase(entry), "APPLICATION") > 0 | Strings.InStr(1, Strings.UCase(entry), "VUL TS USERS") > 0)
                                {
                                    memberOFS = memberOFS + " " + tempstr + "";
                                    colApplications.Add(tempstr);
                                }
                            }
                        }

                        pLOGIS.Value      = (Strings.InStr(1, memberOFS, "LOGIS.") > 0 ? 1 : 0);
                        pDPSA.Value       = (Strings.InStr(1, memberOFS, "DPSA.") > 0 ? 1 : 0);
                        pGFS.Value        = (Strings.InStr(1, memberOFS, "GFS.") > 0 ? 1 : 0);
                        pHR.Value         = (Strings.InStr(1, memberOFS, "HR.") > 0 ? 1 : 0);
                        pFINANCIALS.Value = (Strings.InStr(1, memberOFS, "FINANCIALS.") > 0 ? 1 : 0);
                    }

                    strApps = "";
                    for (y = 1; y <= colApplications.Count(); y++)
                    {
                        if (Strings.Len(strApps) == 0)
                        {
                            strApps = colApplications[y];
                        }
                        else
                        {
                            strApps = strApps + "," + colApplications[y] + "";
                        }
                    }

                    if (Strings.Len(Strings.Trim(strApps)) == 0)
                    {
                        strApps = "INVALID USER";
                    }
                    pApplMember.Value = strApps;

                    strGovt = "";
                    for (y = 1; y <= colGovernment.Count(); y++)
                    {
                        if (Strings.Len(strGovt) == 0)
                        {
                            strGovt = colGovernment[y];
                        }
                        else
                        {
                            strGovt = strGovt + "," + colGovernment[y] + "";
                        }
                    }
                    pDeptMember.Value = strGovt;
                    strDepartment     = "";
                    strDepartment     = oUser.Department + "";
                    if (Strings.Len(Strings.Trim(strDepartment)) == 0)
                    {
                        pDepartment.Value = "No Department";
                    }
                    else
                    {
                        pDepartment.Value = oUser.Department + "";
                    }
                    if ((Convert.ToString(oUser.AccountDisabled)).ToUpper().Trim() == "TRUE")
                    {
                        pAccountDisabled.Value = 1;
                    }
                    else
                    {
                        pAccountDisabled.Value = 0;
                    }
                    //pAccountDisabled.Value = CStr(oUser.AccountDisabled)

                    cmdADS2.Parameters.Add(pAccountNr);
                    cmdADS2.Parameters.Add(pNatProv);
                    cmdADS2.Parameters.Add(pVote);
                    cmdADS2.Parameters.Add(pDeptCode);
                    cmdADS2.Parameters.Add(pEMail);
                    cmdADS2.Parameters.Add(pCell);
                    cmdADS2.Parameters.Add(pPhone);
                    cmdADS2.Parameters.Add(pFirstName);
                    cmdADS2.Parameters.Add(pLastname);
                    cmdADS2.Parameters.Add(pApplMember);
                    cmdADS2.Parameters.Add(pDeptMember);
                    cmdADS2.Parameters.Add(pDepartment);
                    cmdADS2.Parameters.Add(pAccountDisabled);
                    cmdADS2.Parameters.Add(pLOGIS);
                    cmdADS2.Parameters.Add(pHR);
                    cmdADS2.Parameters.Add(pFINANCIALS);
                    cmdADS2.Parameters.Add(pGFS);
                    cmdADS2.Parameters.Add(pDPSA);
                    cmdADS2.Parameters.Add(pUCount);
                    //cmdADS2.Parameters.Add(pAccCreated)
                    //cmdADS2.Parameters.Add(pAccModified)


                    //**************************

                    cmdADS2.ExecuteNonQuery();

                    //**************************
                    cmdADS2.Parameters.Remove(pAccountNr);
                    cmdADS2.Parameters.Remove(pNatProv);
                    cmdADS2.Parameters.Remove(pVote);
                    cmdADS2.Parameters.Remove(pDeptCode);
                    cmdADS2.Parameters.Remove(pEMail);
                    cmdADS2.Parameters.Remove(pCell);
                    cmdADS2.Parameters.Remove(pPhone);
                    cmdADS2.Parameters.Remove(pFirstName);
                    cmdADS2.Parameters.Remove(pLastname);
                    cmdADS2.Parameters.Remove(pApplMember);
                    cmdADS2.Parameters.Remove(pDeptMember);
                    cmdADS2.Parameters.Remove(pDepartment);
                    cmdADS2.Parameters.Remove(pAccountDisabled);
                    cmdADS2.Parameters.Remove(pLOGIS);
                    cmdADS2.Parameters.Remove(pHR);
                    cmdADS2.Parameters.Remove(pFINANCIALS);
                    cmdADS2.Parameters.Remove(pGFS);
                    cmdADS2.Parameters.Remove(pDPSA);

                    colGovernment.Clear();
                    colApplications.Clear();
                }

                break;
            }

            Err().Clear();
        }

        frmMain.tsADPosition.Text = "";
CloseMe:

        goto cleanup;
err_handler:

        mvarsError = "{ADS4.authenticate} authenticate: (" + Err().Number + ") " + Err().Description;
        Err().Clear();
        authenticate = false;
cleanup:

        oUser           = null;
        memberOF        = null;
        oContainer      = null;
        oUser           = null;
        dso             = null;
        colGovernment   = null;
        colApplications = null;
        cnADS.Close();
        cnADS = null;
    }
Example #13
0
        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);
        }
        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>);
        }
Example #15
0
        public override bool DoLogin(string emailId, string password, out int userTypeId, out int userId, out string userName, out string landingPage, out string mobileNo, out bool canCreateUser, out string errmsg, out bool userStatus)
        {
            _objDataWrapper = new DbWrapper(Common.CnnString, CommandType.StoredProcedure);
            var objCrypto = new ClsCrypto(ClsSecurity.GetPasswordPhrase(Common.PassPhraseOne, Common.PassPhraseTwo));

            errmsg        = "";
            userTypeId    = 0;
            userName      = "";
            landingPage   = "";
            mobileNo      = "";
            userId        = 0;
            userStatus    = false;
            canCreateUser = false;
            string pwd = "";

            try
            {
                _objDataWrapper.AddParameter("@UserEmailId", emailId);
                var objUserStatus =
                    (SqlParameter)(_objDataWrapper.AddParameter("@UserStatus", "", SqlDbType.Bit, ParameterDirection.Output));
                var ObjErrMsg =
                    (SqlParameter)(_objDataWrapper.AddParameter("@ErrMsg", "", SqlDbType.VarChar, ParameterDirection.Output, 128));
                var ObjPassword =
                    (SqlParameter)(_objDataWrapper.AddParameter("@UserPassword", "", SqlDbType.VarChar, ParameterDirection.Output, 128));
                var ObjUserName =
                    (SqlParameter)(_objDataWrapper.AddParameter("@UserName", "", SqlDbType.VarChar, ParameterDirection.Output, 64));
                var ObjUseId =
                    (SqlParameter)(_objDataWrapper.AddParameter("@UserId", "", SqlDbType.Int, ParameterDirection.Output));
                var ObjUseTypeId =
                    (SqlParameter)(_objDataWrapper.AddParameter("@UserTypeId", "", SqlDbType.Int, ParameterDirection.Output));
                var ObjCanCreateUser =
                    (SqlParameter)(_objDataWrapper.AddParameter("@CanCreateUser", "", SqlDbType.Bit, ParameterDirection.Output));
                var ObjUserMobile =
                    (SqlParameter)(_objDataWrapper.AddParameter("@UserMobileNo", "", SqlDbType.VarChar, ParameterDirection.Output, 32));
                var ObjUserLandingPage =
                    (SqlParameter)(_objDataWrapper.AddParameter("@LandingPage", "", SqlDbType.VarChar, ParameterDirection.Output, 256));


                _i = _objDataWrapper.ExecuteNonQuery("Aj_Proc_DoLogin");

                if (ObjErrMsg != null && ObjErrMsg.Value != null)
                {
                    errmsg = Convert.ToString(ObjErrMsg.Value);
                }
                if (ObjPassword != null && ObjPassword.Value != null)
                {
                    pwd = Convert.ToString(ObjPassword.Value);
                }

                if (ObjUserName != null && ObjUserName.Value != null)
                {
                    userName = Convert.ToString(ObjUserName.Value);
                }
                if (ObjUseId != null && ObjUseId.Value != null)
                {
                    userId = Convert.ToInt32(ObjUseId.Value);
                }
                if (ObjUseTypeId != null && ObjUseTypeId.Value != null)
                {
                    userTypeId = Convert.ToInt32(ObjUseTypeId.Value);
                }
                if (ObjCanCreateUser != null && ObjCanCreateUser.Value != null)
                {
                    canCreateUser = Convert.ToBoolean(ObjCanCreateUser.Value);
                }
                if (ObjUserMobile != null && ObjUserMobile.Value != null)
                {
                    mobileNo = Convert.ToString(ObjUserMobile.Value);
                }
                if (ObjUserLandingPage != null && ObjUserLandingPage.Value != null)
                {
                    landingPage = Convert.ToString(ObjUserLandingPage.Value);
                }
                if (objUserStatus != null && objUserStatus.Value != null)
                {
                    userStatus = Convert.ToBoolean(objUserStatus.Value);
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.ToString();
                }
                const string addInfo = "Error while executing DoLogin in UserManager.cs  :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
            if (userId > 0)
            {
                pwd = objCrypto.Decrypt(pwd);
                if (pwd.Equals(password))
                {
                    return(true);
                }
                else
                {
                    errmsg = "Re-check your password.";
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
        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);
        }
Example #17
0
        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);
        }