public ActionResult Edit(UpdatePROD_MASTERModel model) { if (ModelState.IsValid) { this.UpdateBaseData <UpdatePROD_MASTERModel>(model); OperationResult result = PROD_MASTERService.Update(model); if (result.ResultType == OperationResultType.Success) { return(Json(result)); } else { return(PartialView(model)); } } else { return(PartialView(model)); } }
public OperationResult Update(UpdatePROD_MASTERModel model) { var entity = PROD_MASTERList.First(t => t.ID == model.ID); entity.ID = model.ID; entity.ProductNo = model.ProductNo; entity.ProductName = model.ProductName; entity.Description = model.Description; entity.ProductType = model.ProductType; entity.StndCost = model.StndCost; entity.CurrCost = model.CurrCost; entity.ListPrice = model.ListPrice; entity.SpecialPrice = model.SpecialPrice; entity.ClearPrice = model.ClearPrice; entity.ProdCategoryID = model.ProdCategoryID; entity.CategoryCode = model.CategoryCode; entity.SchdlUOM = model.SchdlUOM; entity.PriceShed = model.PriceShed; entity.BaseUOFM = model.BaseUOFM; entity.AvailableQTY = model.AvailableQTY; entity.ProdGroupID = model.ProdGroupID; entity.ProdSubclassID = model.ProdSubclassID; entity.LeadTime = model.LeadTime; entity.QtySales = model.QtySales; entity.QtyMin = model.QtyMin; entity.QtyMax = model.QtyMax; entity.CustomerID = model.CustomerID; entity.StockType = model.StockType; entity.SalesRepID = model.SalesRepID; entity.PriceBookItem = model.PriceBookItem; entity.PriceLevel = model.PriceLevel; entity.BarCode = model.BarCode; entity.Ranking = model.Ranking; entity.Notes = model.Notes; entity.Substitute1 = model.Substitute1; entity.Substitute2 = model.Substitute2; entity.Qty1 = model.Qty1; entity.Qty3 = model.Qty3; entity.Qty6 = model.Qty6; entity.Qty12 = model.Qty12; entity.Sales1 = model.Sales1; entity.Sales3 = model.Sales3; entity.Sales6 = model.Sales6; entity.Sales12 = model.Sales12; entity.GPD1 = model.GPD1; entity.GPD3 = model.GPD3; entity.GPD6 = model.GPD6; entity.GPD12 = model.GPD12; entity.LastDate = model.LastDate; entity.CreateDate = model.CreateDate; entity.Creator = model.Creator; entity.Modifier = model.Modifier; entity.ModiDate = model.ModiDate; entity.Status = model.Status; entity.P01 = model.P01; entity.P02 = model.P02; entity.P03 = model.P03; entity.P04 = model.P04; entity.P05 = model.P05; entity.P06 = model.P06; entity.P07 = model.P07; entity.P08 = model.P08; entity.P09 = model.P09; entity.P10 = model.P10; entity.IsCommend = model.IsCommend; entity.IsHot = model.IsHot; entity.ExteriorPart = model.ExteriorPart; entity.ExteriorPartPrice = model.ExteriorPartPrice; entity.ViewTimes = model.ViewTimes; entity.SmallPic = model.SmallPic; entity.BigPic = model.BigPic; entity.LocationStocks1 = model.LocationStocks1; entity.LocationStocks2 = model.LocationStocks2; entity.LocationStocks3 = model.LocationStocks3; entity.LocationStocks4 = model.LocationStocks4; entity.LocationStocks5 = model.LocationStocks5; entity.LocationStocks6 = model.LocationStocks6; entity.LocationStocks7 = model.LocationStocks7; entity.LocationStocks8 = model.LocationStocks8; entity.LocationStocks9 = model.LocationStocks9; entity.LocationStocks10 = model.LocationStocks10; entity.LocationStocks11 = model.LocationStocks11; entity.LocationStocks12 = model.LocationStocks12; entity.LocationStocks13 = model.LocationStocks13; entity.LocationStocks14 = model.LocationStocks14; entity.LocationStocks15 = model.LocationStocks15; entity.LocationAllocate1 = model.LocationAllocate1; entity.LocationAllocate2 = model.LocationAllocate2; entity.LocationAllocate3 = model.LocationAllocate3; entity.LocationAllocate4 = model.LocationAllocate4; entity.LocationAllocate5 = model.LocationAllocate5; entity.LocationAllocate6 = model.LocationAllocate6; entity.LocationAllocate7 = model.LocationAllocate7; entity.LocationAllocate8 = model.LocationAllocate8; entity.LocationAllocate9 = model.LocationAllocate9; entity.LocationAllocate10 = model.LocationAllocate10; entity.LocationAllocate11 = model.LocationAllocate11; entity.LocationAllocate12 = model.LocationAllocate12; entity.LocationAllocate13 = model.LocationAllocate13; entity.LocationAllocate14 = model.LocationAllocate14; entity.LocationAllocate15 = model.LocationAllocate15; entity.Introduction = model.Introduction; entity.Brand = model.Brand; entity.Item01 = model.Item01; entity.Item02 = model.Item02; entity.Item03 = model.Item03; entity.Item04 = model.Item04; entity.Item05 = model.Item05; PROD_MASTERRepository.Update(entity); return(new OperationResult(OperationResultType.Success, "update completed")); }
public ActionResult Edit(string Id) { var model = new UpdatePROD_MASTERModel(); var entity = PROD_MASTERService.PROD_MASTERList.FirstOrDefault(t => t.ID == Id); if (null != entity) { model = new UpdatePROD_MASTERModel { ID = entity.ID, ProductNo = entity.ProductNo, ProductName = entity.ProductName, Description = entity.Description, ProductType = entity.ProductType, StndCost = entity.StndCost, CurrCost = entity.CurrCost, ListPrice = entity.ListPrice, SpecialPrice = entity.SpecialPrice, ClearPrice = entity.ClearPrice, ProdCategoryID = entity.ProdCategoryID, CategoryCode = entity.CategoryCode, SchdlUOM = entity.SchdlUOM, PriceShed = entity.PriceShed, BaseUOFM = entity.BaseUOFM, AvailableQTY = entity.AvailableQTY, ProdGroupID = entity.ProdGroupID, ProdSubclassID = entity.ProdSubclassID, LeadTime = entity.LeadTime, QtySales = entity.QtySales, QtyMin = entity.QtyMin, QtyMax = entity.QtyMax, CustomerID = entity.CustomerID, StockType = entity.StockType, SalesRepID = entity.SalesRepID, PriceBookItem = entity.PriceBookItem, PriceLevel = entity.PriceLevel, BarCode = entity.BarCode, Ranking = entity.Ranking, Notes = entity.Notes, Substitute1 = entity.Substitute1, Substitute2 = entity.Substitute2, Qty1 = entity.Qty1, Qty3 = entity.Qty3, Qty6 = entity.Qty6, Qty12 = entity.Qty12, Sales1 = entity.Sales1, Sales3 = entity.Sales3, Sales6 = entity.Sales6, Sales12 = entity.Sales12, GPD1 = entity.GPD1, GPD3 = entity.GPD3, GPD6 = entity.GPD6, GPD12 = entity.GPD12, LastDate = entity.LastDate, CreateDate = entity.CreateDate, Creator = entity.Creator, Modifier = entity.Modifier, ModiDate = entity.ModiDate, Status = entity.Status, P01 = entity.P01, P02 = entity.P02, P03 = entity.P03, P04 = entity.P04, P05 = entity.P05, P06 = entity.P06, P07 = entity.P07, P08 = entity.P08, P09 = entity.P09, P10 = entity.P10, IsCommend = entity.IsCommend, IsHot = entity.IsHot, ExteriorPart = entity.ExteriorPart, ExteriorPartPrice = entity.ExteriorPartPrice, ViewTimes = entity.ViewTimes, SmallPic = entity.SmallPic, BigPic = entity.BigPic, LocationStocks1 = entity.LocationStocks1, LocationStocks2 = entity.LocationStocks2, LocationStocks3 = entity.LocationStocks3, LocationStocks4 = entity.LocationStocks4, LocationStocks5 = entity.LocationStocks5, LocationStocks6 = entity.LocationStocks6, LocationStocks7 = entity.LocationStocks7, LocationStocks8 = entity.LocationStocks8, LocationStocks9 = entity.LocationStocks9, LocationStocks10 = entity.LocationStocks10, LocationStocks11 = entity.LocationStocks11, LocationStocks12 = entity.LocationStocks12, LocationStocks13 = entity.LocationStocks13, LocationStocks14 = entity.LocationStocks14, LocationStocks15 = entity.LocationStocks15, LocationAllocate1 = entity.LocationAllocate1, LocationAllocate2 = entity.LocationAllocate2, LocationAllocate3 = entity.LocationAllocate3, LocationAllocate4 = entity.LocationAllocate4, LocationAllocate5 = entity.LocationAllocate5, LocationAllocate6 = entity.LocationAllocate6, LocationAllocate7 = entity.LocationAllocate7, LocationAllocate8 = entity.LocationAllocate8, LocationAllocate9 = entity.LocationAllocate9, LocationAllocate10 = entity.LocationAllocate10, LocationAllocate11 = entity.LocationAllocate11, LocationAllocate12 = entity.LocationAllocate12, LocationAllocate13 = entity.LocationAllocate13, LocationAllocate14 = entity.LocationAllocate14, LocationAllocate15 = entity.LocationAllocate15, Introduction = entity.Introduction, Brand = entity.Brand, Item01 = entity.Item01, Item02 = entity.Item02, Item03 = entity.Item03, Item04 = entity.Item04, Item05 = entity.Item05, }; } return(PartialView(model)); }