public void DeleteConfirmed(int id)
        {
            UserCCApplyDetail userCCApplyDetail = db.UserCCApplyDetail.Find(id);

            db.UserCCApplyDetail.Remove(userCCApplyDetail);
            db.SaveChanges();
            // return Redirect("Admin/UserCCAppyDetails/Index");
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,EmployerType,CompanyName,GrossIncomeOrNetSalary,Name,DOB,CityName,MobileNumber,email,CreditCardMaxLimit,OTP,isMobileNumberVerify,isEmailVerify,isUserActive")] UserCCApplyDetail userCCApplyDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userCCApplyDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userCCApplyDetail));
 }
 public ActionResult Create([Bind(Include = "Id,EmployerType,CompanyName,GrossIncomeOrNetSalary,Name,DOB,CityName,MobileNumber,email,CreditCardMaxLimit,OTP,isMobileNumberVerify,isEmailVerify,isUserActive,ApplicationStatusId")] UserCCApplyDetail userCCApplyDetail)
 {
     if (ModelState.IsValid)
     {
         db.UserCCApplyDetail.Add(userCCApplyDetail);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ApplicationStatus = db.ApplicationStatus.ToList();
     ViewData["city"]          = db.Citys.ToList();
     return(View(userCCApplyDetail));
 }
 public ActionResult Create([Bind(Include = "Id,EmployerType,CompanyName,GrossIncomeOrNetSalary,Name,DOB,CityName,MobileNumber,email,CreditCardMaxLimit,OTP,isMobileNumberVerify,isEmailVerify,isUserActive,ApplicationStatusId")] UserCCApplyDetail userCCApplyDetail)
 {
     if (ModelState.IsValid)
     {
         var start = DateTime.Now;
         db.UserCCApplyDetail.Add(userCCApplyDetail);
         db.SaveChanges();
         log.DbCallLog("UserCCApplyDetailsController", "CreatePost", (DateTime.Now - start).ToString(), "Time taken to save CC");
         return(RedirectToAction("Index"));
     }
     ViewBag.ApplicationStatus = db.ApplicationStatus.ToList();
     ViewData["city"]          = db.Citys.ToList();
     return(View(userCCApplyDetail));
 }
        // GET: Admin/UserCCApplyDetails/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserCCApplyDetail userCCApplyDetail = db.UserCCApplyDetail.Find(id);

            if (userCCApplyDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(userCCApplyDetail));
        }
        // GET: Admin/UserCCApplyDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserCCApplyDetail userCCApplyDetail = db.UserCCApplyDetail.Find(id);

            if (userCCApplyDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ApplicationStatus = db.ApplicationStatus.ToList();
            ViewData["city"]          = db.Citys.ToList();
            return(View(userCCApplyDetail));
        }
예제 #7
0
        public int savestep(object convertedJSON, int isfinish = 0)
        {
            var a = (string[])convertedJSON;
            //string []a1 = (string[])convertedJSON;
            var userdata = new UserCCApplyDetail();

            foreach (var item in a)
            {
                userdata = JsonConvert.DeserializeObject <UserCCApplyDetail>(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_UserCCApplyDetail";
                    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", !string.IsNullOrEmpty(userdata.CityName) ? userdata.CityName : db.Citys.Find(userdata.CityId).Name);
                    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.AccountWithIdList);
                    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("@CreditCardId", userdata.CreditCardId);
                    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 ex)
                {
                    transaction.Rollback();
                    connection.Close();
                }
            }
            System.Threading.Thread.Sleep(1000);
            return(0);
            // var d=  JsonConvert.DeserializeObject<detailsForApplyCard>(convertedJSON);
        }