コード例 #1
0
 public ActionResult EditWebsiteData(Prob_Vs_price_matrix m)
 {
     m.UserId = CurrentUser.UserId;
     using (var con = new SqlConnection(_connectionString))
     {
         var result = con.Query <int>("sp_insert_into_Probles_VS_Price_matrix",
                                      new { m.Model_Id,
                                            Problem_Id = m.Problem,
                                            m.Market_Price,
                                            m.estimated_Price,
                                            m.Min_Price,
                                            m.Max_Price,
                                            action = "edit",
                                            m.UserId,
                                            CurrentUser.CompanyId },
                                      commandType: CommandType.StoredProcedure).FirstOrDefault();
         var response = new ResponseModel();
         if (result == 2)
         {
             response.IsSuccess   = true;
             response.Response    = "Successfully Updated";
             TempData["response"] = response;
         }
         else
         {
             response.IsSuccess   = true;
             response.Response    = "Not Updated Successfully";
             TempData["response"] = response;
         }
         return(RedirectToAction("Probs_price_Matrix"));
     }
 }
コード例 #2
0
        public ActionResult AddWebsiteData()
        {
            var parts = new Prob_Vs_price_matrix();

            parts.BrandList   = new SelectList(dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text");
            parts.ProblemList = new SelectList(dropdown.BindMstDeviceProblemAbhishek(), "Value", "Text");
            parts.ModelList   = new SelectList(dropdown.BindModelName(), "value", "text");
            return(PartialView(parts));
        }
コード例 #3
0
        public ActionResult EditWebsiteData(int websitePriceProblem, int ProblemId)
        {
            var result = new Prob_Vs_price_matrix();

            using (var con = new SqlConnection(_connectionString))
            {
                result = con.Query <Prob_Vs_price_matrix>("sp_GetSingleRecord_Probles_VS_Price_Matrix ",
                                                          new { Problem_Id = ProblemId, model_ID = websitePriceProblem }, commandType: CommandType.StoredProcedure).FirstOrDefault();
                ViewBag.Problem   = new SelectList(dropdown.BindMstDeviceProblemAbhishek(), "Value", "Text");
                ViewBag.BrandName = new SelectList(dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text");
                if (result.Model_Id != null)
                {
                    ViewBag.Model_Id = new SelectList(dropdown.BindProduct(Int32.Parse(result.BrandName)), "Value", "Text");
                }
                else
                {
                    ViewBag.Model_Id = new SelectList(Enumerable.Empty <SelectListItem>());
                }
            }

            result.Problem = result.Problem_Id;

            return(PartialView("EditWebsiteData", result));
        }