Ejemplo n.º 1
0
        public ActionResult StockInItem(StockIn stockIn)
        {
            if (Request.IsAuthenticated)
            {
                if (ModelState.IsValid)
                {
                    stockIn.Month      = stockIn.Date.Substring(0, 2);
                    stockIn.Year       = stockIn.Date.Substring(6, 4);
                    stockIn.ActionDate = DateTime.Now.ToString();
                    stockIn.ActionType = ActionType.Insert;
                    stockIn.ActionBy   = ActionType.User;

                    ViewBag.Response = stockInManager.AddStockIn(stockIn);
                }
                else
                {
                    ViewBag.Response = 3;
                }

                ViewBag.Companies = companyManager.GetCompaniesForDropDown();

                ModelState.Clear();
                return(View());
            }
            else
            {
                return(HttpNotFound());
            }
        }