Exemplo n.º 1
0
 public int SaveUser(Register RegModel)
 {
     try
     {
         var existscount = dbContext.Registers.Where(b => b.PhoneNumber == RegModel.PhoneNumber).FirstOrDefault();
         if (existscount == null)
         {
             dbContext.Registers.Add(RegModel);
             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         = "Register-Save User";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Exemplo n.º 2
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);
     }
 }
Exemplo n.º 3
0
 public int SaveReferenceDetails1(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.Reference1             = ReferenceModel.Reference1;
             existscount.ReferenceName1         = ReferenceModel.ReferenceName1;
             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);
     }
 }
Exemplo n.º 4
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);
     }
 }
Exemplo n.º 5
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);
     }
 }
Exemplo n.º 6
0
 public int UpdateAdharCard(AdharCardDocument AdharModel)
 {
     try
     {
         var documentexists = dbContext.AdharCardDocuments.Where(d => d.PhoneNumber == AdharModel.PhoneNumber).FirstOrDefault();
         if (documentexists == null)
         {
             dbContext.AdharCardDocuments.Add(AdharModel);
             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 AdharCard";
         int error = objError.InsertError(model);
         return(400);
     }
 }
Exemplo n.º 7
0
 internal string AddMailMessage(ContactUser model)
 {
     try
     {
         GTLOANEntities dbcontext = new GTLOANEntities();
         dbcontext.ContactUsers.Add(model);
         dbcontext.SaveChanges();
         return("success");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        internal string SendNotification(Notification notify)
        {
            try
            {
                GTLOANEntities dbContext = new GTLOANEntities();

                dbContext.Notifications.Add(notify);
                dbContext.SaveChanges();
                return("success");
            }
            catch (Exception)
            {
                return("error");
            }
        }
Exemplo n.º 9
0
 internal void UpdateStatus(string phoneNumber, string status)
 {
     try
     {
         GTLOANEntities dbContext = new GTLOANEntities();
         var            query     = dbContext.LoanDetails
                                    .Where(e => e.LoanStatus == "Active")
                                    .FirstOrDefault();
         query.LoanStatus             = status;
         dbContext.Entry(query).State = EntityState.Modified;
         dbContext.SaveChanges();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 10
0
        internal string Status(string PhoneNumber, string Status)
        {
            try
            {
                GTLOANEntities dbContext = new GTLOANEntities();

                var query = dbContext.OneTimeFees

                            .Where(p => p.PhoneNumber == PhoneNumber).FirstOrDefault();
                query.Status = Status;
                dbContext.Entry(query).State = EntityState.Modified;
                dbContext.SaveChanges();
                return("success");
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 11
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);
            }
        }
Exemplo n.º 12
0
        public int InsertError(ErrorLog model)
        {
            try
            {
                //model.Data = Data;
                //model.Message = Message;
                //model.InnerException = InnerException;
                //model.Source = Source;
                //model.TargetSite = TargetSite;
                model.Date = DateTime.Now;

                dbContext.ErrorLogs.Add(model);
                dbContext.SaveChanges();
                return(500);
            }
            catch (Exception)
            {
                return(400);
            }
        }
        internal string DisApprove(string Phonenumber)
        {
            try
            {
                GTLOANEntities dbContext = new GTLOANEntities();

                var query = dbContext.Registers

                            .Where(p => p.PhoneNumber == Phonenumber).FirstOrDefault();

                query.Status = "rejected";
                dbContext.Entry(query).State = EntityState.Modified;
                dbContext.SaveChanges();
                return("success");
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 14
0
        internal string Approve(string PhoneNumber, string Transaction)
        {
            try
            {
                GTLOANEntities dbContext = new GTLOANEntities();

                var query = dbContext.LoanDetails

                            .Where(p => p.PhoneNumber == PhoneNumber).FirstOrDefault();

                query.LoanStatus             = "Active";
                query.DueDate                = DateTime.Now.AddDays(+14);
                query.LoanTransactionNo      = Transaction;
                dbContext.Entry(query).State = EntityState.Modified;
                dbContext.SaveChanges();
                return("success");
            }
            catch (Exception ex)
            {
                throw;
            }
        }