public ActionResult Edit(VehicleManufacturerList model)
        {
            SetActiveMenuItem();
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            try
            {
                //Set our updater name
                var FullName = Request.Cookies["userInfo"]["FullName"];

                //Now update the record
                ManufacturerBLL.UpdateManufacturer(model, FullName);

                //Take our ID with us to the confirmation form
                ViewBag.Id = model.Id;

                //Determine the kind of SQL transaction we have performed
                ViewBag.Message = "updated";

                //We can now safely go to the confirmation view
                return(View("AddUpdateConfirm"));
            }
            catch (Exception ex)
            {
                TempData["ErrorMessage"] = ex.Message;
                return(Redirect("~/Admin/Home/Error"));
            }
        }
        public ActionResult Create(VehicleManufacturerList model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            try
            {
                //Set our iniotal return value
                var returnValue = 0;
                //Set our updater name
                var FullName = Request.Cookies["userInfo"]["FullName"];
                //Attempt to add our record
                ManufacturerBLL.AddManufacturer(model, FullName, out returnValue);

                //Take our ID with us to the confirmation form
                ViewBag.Id = returnValue;

                //Determine the kind of SQL transaction we have performed
                ViewBag.Message = "added";

                //We can now safely go to the confirmation view
                return(View("AddUpdateConfirm"));
            }

            catch (Exception ex)
            {
                TempData["ErrorMessage"] = ex.Message;
                return(Redirect("~/Admin/Home/Error"));
            }
        }
Esempio n. 3
0
 public ManageInventory()
 {
     InitializeComponent();
     generic      = new GenericBLL();
     formulation  = new FormulationBLL();
     dosage       = new DosageBLL();
     manufacturer = new ManufacturerBLL();
     medicine     = new MedicineBLL();
 }
Esempio n. 4
0
        private void populateCboManufacturer()
        {
            ManufacturerBLL     manufacturer  = new ManufacturerBLL();
            List <Manufacturer> manufacturers = new List <Manufacturer>();

            manufacturers = manufacturer.GetAll();
            foreach (Manufacturer m in manufacturers)
            {
                cboManufacturer.Items.Add(m.CompanyName);
            }
        }
 public ActionResult Delete(string id)
 {
     try
     {
         var result = new ManufacturerBLL().DeleteManufacturer(id);
         return(JsonContentHelper.GetJsonContent(result));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Edit(WebManufacturer webManufacturer)
 {
     try
     {
         var result = new ManufacturerBLL().UpdateManufacturer(webManufacturer);
         return(JsonContentHelper.GetJsonContent(result));
     }
     catch
     {
         return(View());
     }
 }
 // GET: /Admin/Manufacturer/Edit
 public ActionResult Edit(int id)
 {
     SetActiveMenuItem();
     try
     {
         var model = ManufacturerBLL.GetManufacturer(id);
         return(View(model: model));
     }
     catch (Exception ex)
     {
         TempData["ErrorMessage"] = ex.Message;
         return(Redirect("~/Admin/Home/Error"));
     }
 }
        public ActionResult Create(WebManufacturer WebManufacturer)
        {
            try
            {
                WebManufacturer.ProjectID    = this.GetCurrentProjectID();
                WebManufacturer.CreateUserID = this.GetCurrentUserID();

                var result = new ManufacturerBLL().InsertManufacturer(WebManufacturer);
                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 manufacturerID, string returnUrl)
        {
            ViewBag.ReturnUrl = returnUrl;

            try
            {
                var result = new ManufacturerBLL().GetManufacturerByID(manufacturerID);
                if (result.Code == 0)
                {
                    return(View(result.Data));
                }
            }
            catch (Exception)
            {
            }

            return(View());
        }
 public ActionResult Details(string manufacturerID, string returnUrl)
 {
     ViewBag.ReturnUrl = returnUrl;
     ViewBag.Action    = "Details";
     ViewBag.IsView    = "True";
     try
     {
         var result = new ManufacturerBLL().GetManufacturerByID(manufacturerID);
         if (result.Code == 0)
         {
             return(View(result.Data));
         }
     }
     catch (Exception)
     {
     }
     return(View());
 }
Esempio n. 12
0
        // GET: Admin/Gallery
        public ActionResult Index(int?PageNumber, int?NumberOfItems)
        {
            var _pageNumber    = 0;
            var _numberOfItems = 0;
            var result         = 0;
            var _numberOfPages = 0;

            if (int.TryParse(Convert.ToString(PageNumber), out result))
            {
                //Pagenumber was present so set it
                _pageNumber = (int)PageNumber;
            }
            else
            {
                //No page number was set so default to page 1
                _pageNumber = 1;
            }
            if (int.TryParse(Convert.ToString(NumberOfItems), out result))
            {
                //Number of items was present so set it
                _numberOfItems = (int)NumberOfItems;
            }
            else
            {
                //Number of items was not set, so default to page 1 with 8 items
                _numberOfItems = 8;
                _pageNumber    = 1;
            }

            //Retrieve gallery images
            var model = GalleryBLL.GetImageGallery(_pageNumber, _numberOfItems, out _numberOfPages);

            //Set these items to manage the pagers in the view
            ViewBag.NumberOfPages = _numberOfPages;
            ViewBag.NumberOfItems = _numberOfItems;
            ViewBag.CurrentPage   = _pageNumber;
            var ManufacturerList = ManufacturerBLL.GetManufacturerList();
            var DropDownList     = new SelectList(ManufacturerList, "Id", "Display");

            ViewBag.ManufacturerList = DropDownList;
            return(View(model));
        }
 public ActionResult Index(string searchInfo, int pageIndex = 1, int pageSize = 10, string orderBy = "", bool ascending = false)
 {
     try
     {
         var bll        = new ManufacturerBLL();
         int totalCount = 0;
         var list       = new List <WebManufacturer>();
         var cResult    = bll.GetManufacturerList(out totalCount, this.GetCurrentProjectID(), searchInfo, pageIndex, pageSize, orderBy, ascending);
         if (cResult.Code == 0)
         {
             list = cResult.Data;
         }
         var pageList = new PagedList <WebManufacturer>(list, pageIndex, pageSize, totalCount);
         ViewBag.SearchInfo = searchInfo;
         ViewBag.PageSize   = pageSize;
         return(View(pageList));
     }
     catch (Exception)
     {
     }
     return(View());
 }
Esempio n. 14
0
        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));
        }
Esempio n. 15
0
 public static ManufacturerView MapToView(ManufacturerBLL bllitem, IMapper imapper)
 {
     return(imapper.Map <ManufacturerView>(bllitem));
 }