Пример #1
0
 public int SaveOneTimeFee(OneTimeFee FeeModel)
 {
     try
     {
         var feexists = dbContext.OneTimeFees.Where(o => o.PhoneNumber == FeeModel.PhoneNumber).FirstOrDefault();
         if (feexists == null)
         {
             dbContext.OneTimeFees.Add(FeeModel);
             dbContext.SaveChanges();
             return(100);
         }
         else
         {
             feexists.Fee                    = FeeModel.Fee;
             feexists.Date                   = FeeModel.Date;
             feexists.Status                 = FeeModel.Status;
             feexists.FeeTransactionNo       = FeeModel.FeeTransactionNo;
             dbContext.Entry(feexists).State = System.Data.Entity.EntityState.Modified;
             dbContext.SaveChanges();
             return(100);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Update One Time Fee";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Пример #2
0
 public int SaveProfessionalDetails(ProfessionalDetail ProfessionModel)
 {
     try
     {
         var existscount = dbContext.ProfessionalDetails.Where(b => b.PhoneNumber == ProfessionModel.PhoneNumber).FirstOrDefault();
         if (existscount == null)
         {
             dbContext.ProfessionalDetails.Add(ProfessionModel);
             dbContext.SaveChanges();
             return(100);
         }
         else
         {
             return(200);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Save Professional Details";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Пример #3
0
 public int CheckUser(string PhoneNumber)
 {
     try
     {
         var userexists = dbContext.Registers.Where(p => p.PhoneNumber == PhoneNumber).FirstOrDefault();
         if (userexists != null)
         {
             userexists.Status = "Hold";
             dbContext.Entry(userexists).State = System.Data.Entity.EntityState.Modified;
             dbContext.SaveChanges();
             return(200);
         }
         else
         {
             return(300);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Register-Check User";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Пример #4
0
 public int VerifyLoan(string PhoneNumber)
 {
     try
     {
         string PhoneNo    = PhoneNumber;
         var    loanexists = dbContext.LoanDetails.Where(l => l.PhoneNumber == PhoneNo && (l.LoanStatus == "Active" || l.LoanStatus == "Pending")).Count();
         if (loanexists == 0)
         {
             return(300);
         }
         else
         {
             return(200);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Verify Loan";
         int error = objError.InsertError(model);
         throw;
     }
 }
Пример #5
0
 public int UpdateSelfie(SelfieDocument SelfieModel)
 {
     try
     {
         var documentexists = dbContext.SelfieDocuments.Where(d => d.PhoneNumber == SelfieModel.PhoneNumber).FirstOrDefault();
         if (documentexists == null)
         {
             dbContext.SelfieDocuments.Add(SelfieModel);
             dbContext.SaveChanges();
             return(100);
         }
         else
         {
             return(200);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Update Selfie";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Пример #6
0
 public int SaveLoanDetails(LoanDetail LoanModel)
 {
     try
     {
         var loanexists = dbContext.LoanDetails.Where(l => l.PhoneNumber == LoanModel.PhoneNumber && l.LoanStatus == "Active").FirstOrDefault();
         if (loanexists == null)
         {
             dbContext.LoanDetails.Add(LoanModel);
             dbContext.SaveChanges();
             return(100);
         }
         else
         {
             return(200);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "SaveLoanDetails";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Пример #7
0
 public int UpdatePayment(LoanDetail LoanModel)
 {
     try
     {
         var loanexists = dbContext.LoanDetails.Where(l => l.PhoneNumber == LoanModel.PhoneNumber && l.LoanStatus == "Active").FirstOrDefault();
         if (loanexists == null)
         {
             return(300);
         }
         else
         {
             loanexists.PaymentDate            = LoanModel.PaymentDate;
             loanexists.PaymentReferenceNo     = LoanModel.PaymentReferenceNo;
             dbContext.Entry(loanexists).State = System.Data.Entity.EntityState.Modified;
             dbContext.SaveChanges();
             return(100);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Payment";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Пример #8
0
 public int SaveReferenceDetails2(ReferenceDetail ReferenceModel)
 {
     try
     {
         var existscount = dbContext.ReferenceDetails.Where(b => b.PhoneNumber == ReferenceModel.PhoneNumber).FirstOrDefault();
         if (existscount == null)
         {
             dbContext.ReferenceDetails.Add(ReferenceModel);
             dbContext.SaveChanges();
             return(100);
         }
         else
         {
             existscount.Reference2             = ReferenceModel.Reference2;
             existscount.ReferenceName2         = ReferenceModel.ReferenceName2;
             dbContext.Entry(existscount).State = System.Data.Entity.EntityState.Modified;
             dbContext.SaveChanges();
             return(100);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Save Reference Details";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Пример #9
0
 public LoanDetail FetchLoanDetails(string PhoneNumber)
 {
     try {
         var loanquery = dbContext.LoanDetails.Where(l => l.PhoneNumber == PhoneNumber).FirstOrDefault();
         return(loanquery);
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Fetch LoanDetails";
         int error = objError.InsertError(model);
         throw;
     }
 }
Пример #10
0
 public OneTimeFee FetchFeeDetails(string PhoneNumber)
 {
     try
     {
         var processingquery = dbContext.OneTimeFees.Where(p => p.PhoneNumber == PhoneNumber).FirstOrDefault();
         return(processingquery);
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Fetch One Time Fee Details";
         int error = objError.InsertError(model);
         throw;
     }
 }
Пример #11
0
 public BasicDetail FetchBasicDetails(string PhoneNumber)
 {
     try
     {
         var basicquery = dbContext.BasicDetails.Where(b => b.PhoneNumber == PhoneNumber).FirstOrDefault();
         return(basicquery);
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "BasicDetails-Fetch";
         int error = objError.InsertError(model);
         throw;
     }
 }
Пример #12
0
 public SignatureDocument FetchSignature(string PhoneNumber)
 {
     try
     {
         var query = dbContext.SignatureDocuments.Where(b => b.PhoneNumber == PhoneNumber).FirstOrDefault();
         return(query);
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Fetch Signature";
         int error = objError.InsertError(model);
         throw;
     }
 }
Пример #13
0
 public PersonalDetail FetchPersonalDetails(string PhoneNumber)
 {
     try
     {
         var personalquery = dbContext.PersonalDetails.Where(p => p.PhoneNumber == PhoneNumber).FirstOrDefault();
         return(personalquery);
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "PersonalDetails-Fetch";
         int error = objError.InsertError(model);
         throw;
     }
 }
Пример #14
0
 public List <Notification> FetchNotifications(string PhoneNumber)
 {
     try
     {
         var notifications = dbContext.Notifications.Where(N => N.PhoneNumber == PhoneNumber).ToList();
         return(notifications.ToList());
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Notification Fetch";
         int error = objError.InsertError(model);
         throw;
     }
 }
Пример #15
0
        public int SaveEnquiry(UserContact model)
        {
            try
            {
                dbContext.UserContacts.Add(model);
                dbContext.SaveChanges();

                return(100);
            }
            catch (Exception ex)
            {
                ErrorLogDal objError   = new ErrorLogDal();
                ErrorLog    errorModel = new ErrorLog();
                errorModel.InnerException = ex.InnerException.InnerException.Message.ToString();
                errorModel.Source         = "ContactUs-Save";
                int error = objError.InsertError(errorModel);
                return(400);
            }
        }