コード例 #1
0
        public ActionResult Edit(int Productid, ProductMaster prdmaster)
        {
            ProductMaster oProdMaster = new ProductMaster();
            Int64         pProductId  = System.Convert.ToInt64(prdmaster.ProductId);

            oProdMaster = ProductMasterData.Select_Record(pProductId);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = ProductMasterData.Update(oProdMaster, prdmaster);
                if (bSucess == true)
                {
                    ViewData["resultUpdate"] = "1";
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ViewData["resultUpdate"] = "0";
                    ModelState.AddModelError("", "Can Not Update");
                }
            }

            return(View(prdmaster));
        }
コード例 #2
0
        // GET: ProductMaster/Edit/5
        public ActionResult Edit(Int64 Productid)
        {
            ViewData["lstManufacturer"] = getManufacturer(Productid);
            ViewData["lstProductType"]  = getProductTypeList(Productid);
            ProductMaster ProductMaster = new ProductMaster();

            ProductMaster = ProductMasterData.Select_Record(Productid);
            if (ProductMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(ProductMaster));
        }
コード例 #3
0
        public ActionResult Delete(Int64 productId, FormCollection collection)
        {
            ProductMaster ProductMaster = new ProductMaster();
            Int64         pCustId       = System.Convert.ToInt64(productId);

            ProductMaster = ProductMasterData.Select_Record(pCustId);

            bool bSucess = false;

            bSucess = ProductMasterData.Delete(ProductMaster);
            if (bSucess == true)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Can Not Delete");
            }
            return(null);
        }