Exemplo n.º 1
0
        public void DeleteConfirmed(int id)
        {
            UserLoanApplyDetail userLoanApplyDetail = db.UserLoanApplyDetail.Find(id);

            db.UserLoanApplyDetail.Remove(userLoanApplyDetail);
            db.SaveChanges();
            //return RedirectToAction("Index");
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,EmployerType,CompanyName,GrossIncomeOrNetSalary,Name,DOB,CityName,MobileNumber,email,CreditCardMaxLimit,OTP,isMobileNumberVerify,isEmailVerify,isUserActive,Intended_loan_amount")] UserLoanApplyDetail userLoanApplyDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userLoanApplyDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userLoanApplyDetail));
 }
Exemplo n.º 3
0
 public ActionResult Create([Bind(Include = "Id,EmployerType,CompanyName,GrossIncomeOrNetSalary,Name,DOB,CityName,MobileNumber,email,CreditCardMaxLimit,OTP,isMobileNumberVerify,isEmailVerify,isUserActive,Intended_loan_amount,ApplicationStatusId")] UserLoanApplyDetail userLoanApplyDetail)
 {
     if (ModelState.IsValid)
     {
         db.UserLoanApplyDetail.Add(userLoanApplyDetail);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ApplicationStatus = db.ApplicationStatus.ToList();
     ViewData["city"]          = db.Citys.ToList();
     return(View(userLoanApplyDetail));
 }
Exemplo n.º 4
0
        // GET: Admin/UserLoanApplyDetails/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserLoanApplyDetail userLoanApplyDetail = db.UserLoanApplyDetail.Find(id);

            if (userLoanApplyDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(userLoanApplyDetail));
        }
Exemplo n.º 5
0
        // GET: Admin/UserLoanApplyDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserLoanApplyDetail userLoanApplyDetail = db.UserLoanApplyDetail.Find(id);

            if (userLoanApplyDetail == null)
            {
                return(HttpNotFound());
            }
            ViewData["city"]          = db.Citys.ToList();
            ViewBag.ApplicationStatus = db.ApplicationStatus.Find(userLoanApplyDetail.ApplicationStatusId);
            return(View(userLoanApplyDetail));
        }
Exemplo n.º 6
0
        public int savestep(object convertedJSON, int isfinish = 0)
        {
            var a = (string[])convertedJSON;
            //string []a1 = (string[])convertedJSON;
            var userdata = new UserLoanApplyDetail();

            foreach (var item in a)
            {
                userdata = JsonConvert.DeserializeObject <UserLoanApplyDetail>(item);
            }
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["MmDbConnectionString"].ConnectionString))
            {
                connection.Open();

                SqlCommand     command = connection.CreateCommand();
                SqlTransaction transaction;
                transaction         = connection.BeginTransaction("SampleTransaction");
                command.Connection  = connection;
                command.Transaction = transaction;
                try
                {
                    if (userdata.CurrentOrPrevLoan == "1")
                    {
                        userdata._CurrentOrPrevLoan = true;
                    }
                    else if (userdata.CurrentOrPrevLoan == "0")
                    {
                        userdata._CurrentOrPrevLoan = false;
                    }
                    command.Parameters.Clear();
                    command.CommandText = "Insert_UserLoanApplyDetail";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@Id", userdata.Id);
                    command.Parameters.AddWithValue("@CompanyName", userdata.CompanyName);
                    command.Parameters.AddWithValue("@GrossIncomeOrNetSalary", userdata.GrossIncomeOrNetSalary);
                    command.Parameters.AddWithValue("@Name", userdata.Name);
                    command.Parameters.AddWithValue("@DOB", userdata.DOB);
                    command.Parameters.AddWithValue("@CityId", userdata.CityId);
                    command.Parameters.AddWithValue("@CityName", userdata.CityName);
                    command.Parameters.AddWithValue("@PinCode", userdata.PinCode);
                    command.Parameters.AddWithValue("@MobileNumber", userdata.MobileNumber);
                    command.Parameters.AddWithValue("@OTP", userdata.OTP);
                    command.Parameters.AddWithValue("@email", userdata.email);
                    string accountWith = string.Join(",", userdata.AccountWith);
                    accountWith = accountWith.Length > 4 ? accountWith.Substring(4, accountWith.Length - 4) : "";
                    string CreditCardWith = string.Join(",", userdata.CreditCardWith);
                    CreditCardWith = CreditCardWith.Length > 4 ? CreditCardWith.Substring(4, CreditCardWith.Length - 4) : "";
                    command.Parameters.AddWithValue("@AccountWith", accountWith);
                    command.Parameters.AddWithValue("@CreditCardWith", CreditCardWith);
                    command.Parameters.AddWithValue("@CreditCardMaxLimit", userdata.CreditCardMaxLimit);
                    command.Parameters.AddWithValue("@CurrentOrPrevLoan", userdata._CurrentOrPrevLoan);
                    command.Parameters.AddWithValue("@EmployerType", userdata.EmployerType);
                    command.Parameters.AddWithValue("@Intended_loan_amount", userdata.Intended_loan_amount);
                    command.Parameters.AddWithValue("@LoanType", userdata.LoanType);
                    command.Parameters.AddWithValue("@PanCard", userdata.PanCard);
                    if (isfinish == 1)
                    {
                        command.Parameters.AddWithValue("@isUserActive", true);
                    }
                    else
                    {
                        command.Parameters.AddWithValue("@isUserActive", false);
                    }
                    var id = command.ExecuteScalar();
                    transaction.Commit();
                    connection.Close();
                    //TempData["ApplyId"] = id;
                    return(Convert.ToInt32(id));
                }
                catch (Exception)
                {
                    transaction.Rollback();
                    connection.Close();
                }
            }
            System.Threading.Thread.Sleep(1000);
            return(0);
            // var d=  JsonConvert.DeserializeObject<detailsForApplyCard>(convertedJSON);
        }