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 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));
        }