public ActionResult Xuat(string ReceiptIsuueGuid, string SizeAdd, int?TrangThai, int?LoaiPhieu, int?Kho, string GhiChu, string ReceiptIsuueName)
        {
            using (var context = new ShopOnlineDb())
            {
                using (var dbContextTransaction = context.Database.BeginTransaction())
                {
                    try
                    {
                        Kho = 2;

                        shGoodReceiptIsuueService _receipt = new shGoodReceiptIsuueService();
                        _receipt.XuatDuLieuKhoHang(
                            ReceiptIsuueGuid,
                            SizeAdd,
                            TrangThai,
                            LoaiPhieu,
                            Kho,
                            GhiChu,
                            User.Identity.GetUserLogin().Userid,
                            PhieuNhapXuat.Xuat.GetHashCode(),
                            ReceiptIsuueName,
                            true,
                            DateTime.Now
                            );

                        dbContextTransaction.Commit();
                    }
                    catch (Exception ex)
                    {
                        dbContextTransaction.Rollback();
                    }
                }
            }
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult OrderProcessing(string OrderGuid, int?OrderStatus, string Description)
        {
            using (var context = new ShopOnlineDb())
            {
                using (var dbContextTransaction = context.Database.BeginTransaction())
                {
                    try
                    {
                        shGoodReceiptIsuueService _receipt = new shGoodReceiptIsuueService();
                        if (OrderStatus.HasValue)
                        {
                            if (OrderStatus == C.Core.Common.OrderStatus.DangGiaoHang.GetHashCode())
                            {
                                shOrderService _order = new shOrderService();
                                shOrder        order  = _order.XuLyDonhang(OrderGuid, null, User.Identity.GetUserLogin().Userid);
                            }
                            else
                            {
                                shGoodReceiptIsuue receipt = _receipt.XuatDuLieuDonHang(
                                    OrderGuid,
                                    OrderStatus,
                                    Description,
                                    User.Identity.GetUserLogin().Userid,
                                    PhieuNhapXuat.Xuat.GetHashCode(),
                                    TypeHelper.ToInt32(User.Identity.GetUserLogin().Unitid),
                                    LoaiPhieuNhapXuat.BanLe.GetHashCode(),
                                    Description,
                                    TrangThaiPhieuNhapXuat.HoanThanh.GetHashCode(),
                                    true,
                                    DateTime.Now,
                                    OrderGuid);
                            }
                        }

                        dbContextTransaction.Commit();
                    }
                    catch (Exception ex)
                    {
                        dbContextTransaction.Rollback();
                    }
                }
            }
            if (Request.IsAjaxRequest())
            {
                return(Json("OK", JsonRequestBehavior.AllowGet));
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Xuat(string id)
        {
            shGoodReceiptIsuueService _good = new shGoodReceiptIsuueService();

            shGoodReceiptIsuue good = _good.FindByKey(id);

            if (good == null)
            {
                good = new shGoodReceiptIsuue();
            }
            dsNhap(id);
            DropNhapDuLieu(good.LoaiPhieu, good.MaKho, good.TrangThai, PhieuNhapXuat.Xuat.GetHashCode());

            return(View(good));
        }
        public PartialViewResult ListReceiptIsuue(int?page, string TuNgay, string DenNgay, string TuKhoa, int?TrangThai, int?NguoiTao)
        {
            int pageCurrent = 1;

            if (page.HasValue)
            {
                pageCurrent = page.Value;
            }

            shGoodReceiptIsuueService        _receiptissue   = new shGoodReceiptIsuueService();
            IEnumerable <shGoodReceiptIsuue> dsPhieuNhapXuat = _receiptissue.DanhSachPhieuXuatNhap(TuNgay, DenNgay, TuKhoa, TrangThai, NguoiTao)
                                                               .OrderByDescending(x => x.CreateDate);

            ViewBag.ListCategory = dsPhieuNhapXuat;
            return(PartialView("ListReceiptIsuue", dsPhieuNhapXuat));
        }