示例#1
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);
            }
        }