Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            var model = new ImportList();

            model.Current = new ImportRecord();
            var unremovable = ImexItem.Unremovable(UserID, Employee.ID, DbAction.Import.Remove, id);

            if (unremovable.Count > 0)
            {
                model.Message = "Số lượng sản phẩm tồn kho ít hơn số lượng sản phẩm phiếu xuất";
            }
            else
            {
                model.Result  = Import.Remove(UserID, Employee.ID, id, true);
                model.Message = model.Result ? "Xóa phiếu thành công" : "Xóa phiếu không thành công";
            }
            if (!model.Result)
            {
                model.Current = Import.Get(UserID, Employee.ID, id);
            }
            model.List = SKtimeManagement.Import.History(UserID, Employee.ID, Employee.BussinessID);
            if (Request.IsAjaxRequest())
            {
                return(Json(new
                {
                    html = RenderPartialViewToString(Views.HistoryPartial, model)
                }, JsonRequestBehavior.AllowGet));
            }
            return(View(Views.History, model));
        }
Exemplo n.º 2
0
        public ActionResult History()
        {
            var model = new ImportList();

            model.List    = SKtimeManagement.Import.History(UserID, Employee.ID, Employee.BussinessID);
            model.Current = new ImportRecord();
            if (Request.IsAjaxRequest())
            {
                return(Json(new
                {
                    html = RenderPartialViewToString(Views.HistoryPartial, model)
                }, JsonRequestBehavior.AllowGet));
            }
            return(View(Views.History, model));
        }
Exemplo n.º 3
0
        public ActionResult Detail(int id)
        {
            var record = Import.Get(UserID, Employee.ID, id, true);

            foreach (var product in record.Products)
            {
                product.Url = RenderPartialViewToString("ProductUrl", product);
            }
            if (Request.IsAjaxRequest())
            {
                return(Json(new
                {
                    html = RenderPartialViewToString(Views.Products, record)
                }, JsonRequestBehavior.AllowGet));
            }
            var model = new ImportList();

            model.List    = Import.History(UserID, Employee.ID, Employee.BussinessID);
            model.Current = record;
            return(View(Views.History, model));
        }