public ActionResult Delete(string id) { try { var result = new DeviceTypeBLL().DeleteDeviceType(id); return(JsonContentHelper.GetJsonContent(result)); } catch { return(View()); } }
public ActionResult Edit(WebDeviceType webDeviceType) { try { webDeviceType.ProjectID = this.GetCurrentProjectID(); var result = new DeviceTypeBLL().UpdateDeviceType(webDeviceType); return(JsonContentHelper.GetJsonContent(result)); } catch { return(View()); } }
public ActionResult Create(WebDeviceType webDeviceType) { try { webDeviceType.ProjectID = this.GetCurrentProjectID(); webDeviceType.CreateUserID = this.GetCurrentUserID(); webDeviceType.ProjectID = this.GetCurrentProjectID(); var result = new DeviceTypeBLL().InsertDeviceType(webDeviceType); return(JsonContentHelper.GetJsonContent(result)); } catch { return(View()); } }
public ActionResult CreateDevice(string returnUrl) { DeviceTypeBLL deviceBLL = new DeviceTypeBLL(); ManufacturerBLL manufacturBLL = new ManufacturerBLL(); SupplierBLL supplierBLL = new SupplierBLL(); var deviceType = deviceBLL.GetDeviceTypeDir(this.GetCurrentProjectID()); ViewBag.ManufacturList = manufacturBLL.GetManufacturerDir(this.GetCurrentProjectID()).Data; ViewBag.SupperList = supplierBLL.GetSupplierDir(this.GetCurrentProjectID()).Data; ViewBag.DeviceType = deviceType.Data; ViewBag.Action = "Add"; ViewBag.ReturnUrl = returnUrl; WebDevice webDevice = new WebDevice(); return(View(webDevice)); }
public ActionResult Edit(string deviceTypeID, string returnUrl) { ViewBag.ReturnUrl = returnUrl; try { var result = new DeviceTypeBLL().GetDeviceTypeByID(deviceTypeID); if (result.Code == 0) { int totalCount; var items = new MaintainItemBLL().GetMaintainItemList(out totalCount, this.GetCurrentProjectID(), "", 1, -1, "Name", true); ViewBag.AllMaintainItems = items.Data; return(View(result.Data)); } } catch (Exception) { } return(View()); }
public ActionResult Index(string searchInfo, int pageIndex = 1, int pageSize = 10, string orderBy = "", bool ascending = false) { try { var deviceTypeBLL = new DeviceTypeBLL(); int totalCount = 0; var list = new List <WebDeviceType>(); var cResult = deviceTypeBLL.GetDeviceTypeList(out totalCount, this.GetCurrentProjectID(), searchInfo, pageIndex, pageSize, orderBy, ascending); if (cResult.Code == 0) { list = cResult.Data; } var pageList = new PagedList <WebDeviceType>(list, pageIndex, pageSize, totalCount); ViewBag.SearchInfo = searchInfo; ViewBag.PageSize = pageSize; return(View(pageList)); } catch (Exception) { } return(View()); }
public ActionResult EditDevice(string deviceTypeID, string returnUrl) { DeviceBLL deviceBLL = new DeviceBLL(); var result = deviceBLL.GetDeviceByID(deviceTypeID); WebDevice webDevice = null; if (result.Code == 0) { webDevice = result.Data; } ManufacturerBLL manufacturBLL = new ManufacturerBLL(); SupplierBLL supplierBLL = new SupplierBLL(); DeviceTypeBLL deviceTypeBll = new DeviceTypeBLL(); var deviceType = deviceTypeBll.GetDeviceTypeDir(this.GetCurrentProjectID()); ViewBag.ManufacturList = manufacturBLL.GetManufacturerDir(this.GetCurrentProjectID()).Data; ViewBag.SupperList = supplierBLL.GetSupplierDir(this.GetCurrentProjectID()).Data; ViewBag.DeviceType = deviceType.Data; ViewBag.Action = "Update"; ViewBag.ReturnUrl = returnUrl; return(View(webDevice)); }