public ActionResult FormEdit_PhieuXuatKho([ModelBinder(typeof(DevExpressEditorsBinder))] EditableChungTu chungtu)
        {
            var userName = System.Web.HttpContext.Current.User.Identity.Name.ToString();
            var Madvql   = CCDCDataProvider.GetMadvql_ByUserName(userName);

            ViewData["Madvql"] = Madvql;
            chungtu.Madvql     = Madvql;

            if (!ModelState.IsValid)
            {
                return(DemoView("PhieuXuatKho", "FormEdit_Xuat", CCDCDataProvider.getChungtuXuats("X01", chungtu.STTCT)));
            }
            if (chungtu.STTCT == -1)
            {
                CCDCDataProvider.InsertChungTuXuat(chungtu);
            }

            else
            {
                CCDCDataProvider.UpdateChungTuXuat(chungtu);
            }
            var ob = CCDCDataProvider.getChungtuXuats("X00", chungtu.STTCT);

            return(DemoView("PhieuXuatKho", "FormEdit_Xuat", CCDCDataProvider.getChungtuXuats("X00", chungtu.STTCT)));
            // return RedirectToAction("FormEdit_Xuat");
        }
        public ActionResult FormEdit_PhieuNhapKho(int STTCT)
        {
            Session["STTCT"] = STTCT;
            EditableChungTu editCT = CCDCDataProvider.GetEditableChungtus(STTCT);

            if (editCT == null)
            {
                editCT       = new EditableChungTu();
                editCT.STTCT = -1;
            }
            return(DemoView("PhieuNhapKho", "FormEdit_Nhap", editCT));
        }
Пример #3
0
        public ActionResult FormEdit_PhieuXuatKho(int STTCT)
        {
            Session["STTCT"] = STTCT;
            var editCT   = CCDCDataProvider.GetEditableChungtus(STTCT);
            var userName = System.Web.HttpContext.Current.User.Identity.Name.ToString();
            var Madvql   = CCDCDataProvider.GetMadvql_ByUserName(userName);

            ViewData["Madvql"] = Madvql;
            if (editCT == null)
            {
                editCT       = new EditableChungTu();
                editCT.STTCT = -1;
            }
            return(DemoView("PhieuXuatKho", "FormEdit_Xuat", editCT));
        }
Пример #4
0
        public ActionResult FormEdit_PhieuNhapKho([ModelBinder(typeof(DevExpressEditorsBinder))] EditableChungTu chungtu)
        {
            var userName = System.Web.HttpContext.Current.User.Identity.Name.ToString();
            var Madvql   = CCDCDataProvider.GetMadvql_ByUserName(userName);

            chungtu.Maloaiphieu = "N00";
            chungtu.Madvql      = Madvql;
            if (!ModelState.IsValid)
            {
                return(DemoView("PhieuNhapKho", "FormEdit_Nhap", CCDCDataProvider.GetEditableChungtus(chungtu.STTCT)));
            }
            if (chungtu.STTCT == -1)
            {
                CCDCDataProvider.InsertChungTuNhap(chungtu);
            }
            else
            {
                CCDCDataProvider.UpdateChungTuNhap(chungtu);
            }
            chungtu.STTCT = (int)Session["STTCT"];
            return(DemoView("PhieuNhapKho", "FormEdit_Nhap", CCDCDataProvider.GetEditableChungtus(chungtu.STTCT)));
        }