Пример #1
0
 public int?ForgotPasswordRegister(RegisterModel modelobj)
 {
     try
     {
         using (var paymentEntities = new BillPaymentEntities())
         {
             var forgotPassword = paymentEntities.table_Registration.FirstOrDefault(obj => obj.MobileNumber == modelobj.MobileNumber &&
                                                                                    obj.SecurityAnswer == modelobj.SecurityAnswer &&
                                                                                    obj.SecurityQuestion == modelobj.SecurityQuestion);
             if (forgotPassword != null)
             {
                 forgotPassword.NewPassword     = modelobj.NewPassword;
                 forgotPassword.ConfirmPassword = modelobj.ConfirmPassword;
                 var login = paymentEntities.table_Login.FirstOrDefault(obj => obj.MobileNumber == modelobj.MobileNumber);
                 login.ConfirmPassword = modelobj.ConfirmPassword;
                 paymentEntities.SaveChanges();
             }
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         return(null);
     }
     return(1);
 }
Пример #2
0
        public int?RegisterCustomerData(RegisterModel registerObj)
        {
            try
            {
                using (var paymentEntities = new BillPaymentEntities())
                {
                    var tabReg = new table_Registration();
                    tabReg.CustomerName     = registerObj.CustomerName;
                    tabReg.MobileNumber     = registerObj.MobileNumber;
                    tabReg.EmailID          = registerObj.EmailId;
                    tabReg.Plantype         = registerObj.Plantype;
                    tabReg.SecurityQuestion = registerObj.SecurityQuestion;
                    tabReg.SecurityAnswer   = registerObj.SecurityAnswer;
                    tabReg.NewPassword      = registerObj.NewPassword;
                    tabReg.ConfirmPassword  = registerObj.ConfirmPassword;
                    tabReg.Operator         = registerObj.Operator;
                    paymentEntities.table_Registration.Add(tabReg);

                    var tabLogin = new table_Login();
                    tabLogin.MobileNumber    = registerObj.MobileNumber;
                    tabLogin.ConfirmPassword = registerObj.ConfirmPassword;
                    paymentEntities.table_Login.Add(tabLogin);

                    if (registerObj.Plantype == "Prepaid")
                    {
                        var prePaid = new PrePaid();
                        prePaid.MobileNumber = registerObj.MobileNumber;
                        prePaid.Operator     = registerObj.Operator;
                        paymentEntities.PrePaids.Add(prePaid);
                    }
                    else if (registerObj.Plantype == "Postpaid")
                    {
                        var postPaid = new PostPaid();
                        postPaid.MobileNumber = registerObj.MobileNumber;
                        postPaid.Operator     = registerObj.Operator;
                        paymentEntities.PostPaids.Add(postPaid);
                    }

                    paymentEntities.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                return(null);
            }
            return(1);
        }
Пример #3
0
 public int?NetBanking(PaymentModel modelobj)
 {
     try
     {
         using (var paymentEntities = new BillPaymentEntities())
         {
             var debitandcredit = paymentEntities.debit_creditcard_table.FirstOrDefault(obj => obj.UserID == modelobj.UserID &&
                                                                                        obj.UserPassword == modelobj.UserPassword && obj.BankName == modelobj.BankName &&
                                                                                        obj.Balance > Convert.ToDecimal(modelobj.Balance));
             debitandcredit.Balance -= Convert.ToDecimal(modelobj.Amount);
             paymentEntities.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         return(null);
     }
     return(1);
 }
Пример #4
0
 public int?PaymentCreditCard(PaymentModel modelobj)
 {
     try
     {
         using (var paymentEntities = new BillPaymentEntities())
         {
             var debitandcredit = paymentEntities.debit_creditcard_table.FirstOrDefault(obj => obj.CardNumber == modelobj.CardNumber &&
                                                                                        obj.CVVNumber == modelobj.CVVNumber && obj.ExpiryDate == modelobj.ExpiryDate &&
                                                                                        obj.Balance > Convert.ToDecimal(modelobj.Balance));
             debitandcredit.Balance -= Convert.ToDecimal(modelobj.Amount);
             paymentEntities.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         return(null);
     }
     return(1);
 }