public string KindOfFurnitureSubmit(FormCollection form) { string result = string.Empty; TopKindOfFurniture dal = new TopKindOfFurniture(); try { for (int i = 1; i < 19; i++) { if (form["topkindoffurniture" + i.ToString()] != null) { var model = dal.GetSingledataById(i); int tempint = 0; int.TryParse(form["topkindoffurniture" + i.ToString()], out tempint); if (tempint.Equals(0)) model.Tp_DcID_FK = null; else model.Tp_DcID_FK = tempint; dal.Update(model); } } result = "1"; } catch (Exception) { result = "0"; } return result; }
public ActionResult KindOfFurniture() { ViewBag.jsInit = Public.SuperAdminCommon.JSInit("FurnitureManage", "FurnitureKindOfFurniture"); TopKindOfFurniture dal = new TopKindOfFurniture(); IList<Fr_TopKindOfFurniture> topkingoffurniture = dal.GetAllModel(); return View(topkingoffurniture); }