Ejemplo n.º 1
0
 public StockInBill(WarehouseStockIn oStockIn, PurchaseInformation oPurchase, List<StockInSkuAndPurchase> oInSkuAndPurchase)
 {
     this.oStockIn = oStockIn;
     this.oPurchase = oPurchase;
     this.oInSkuAndPurchase = oInSkuAndPurchase;
 }
Ejemplo n.º 2
0
        ///// <summary>
        ///// 对WarehouseShipping进行编辑的页面
        ///// </summary>
        ///// <param name="outID">要编辑的WarehouseShipping对象的Gid</param>
        ///// <returns>返回对WarehouseShipping进行操作的部分页面</returns>
        //[HttpPost]
        //public PartialViewResult WarehouseShippingAdd()
        //{
        //    WarehouseShipping warehouseShipping = new WarehouseShipping();
        //    ViewBag.Warehouselist = GetWarehouseSelectList(GetPriWarehouses(Guid.Empty));
        //    List<ShippingInformation> shippings = dbEntity.ShippingInformations.Where(item=>item.Otype == (byte)4).ToList();
        //    List<SelectListItem> list = new List<SelectListItem>();
        //    foreach(ShippingInformation shipping in shippings)
        //    {
        //        list.Add(new SelectListItem
        //        {
        //            Text = shipping.FullName.Matter,
        //            Value = shipping.Gid.ToString()
        //        });   
        //    }
        //    ViewBag.ShippingList = list;
        //    return PartialView(warehouseShipping);
        //}
        ///// <summary>
        ///// WarehouseShipping 添加处理
        ///// </summary>
        ///// <returns>返回到WarehouseShipping页面</returns>
        //[HttpPost]
        //public ActionResult WarehouseShippingEdit(WarehouseShipping warehouseShipping)
        //{
        //    WarehouseShipping outItem = (from item in dbEntity.WarehouseShippings
        //                              where item.WhID == warehouseShipping.WhID
        //                                 && item.ShipID == warehouseShipping.ShipID
        //                              select item).FirstOrDefault();
        //    if (outItem != null)
        //        outItem.Deleted = false;
        //    else
        //    {
        //        outItem = new WarehouseShipping
        //        {
        //            WhID = warehouseShipping.WhID,
        //            ShipID = warehouseShipping.ShipID,
        //            Remark = warehouseShipping.Remark
        //        };
        //        dbEntity.WarehouseShippings.Add(outItem);
        //    }
        //    dbEntity.SaveChanges();
        //    return RedirectToAction("WarehouseShipping");
        //}
        #endregion 仓库支持的承运商

        #region 入库单
        /// <summary>
        /// 入库单页面
        /// </summary>
        /// <param name="outID"></param>
        /// <returns>返回入库单总览页面</returns>
        public ActionResult StockIn()
        {
            // 权限验证
            if (!base.CheckPrivilege())
                return RedirectToAction("ErrorPage", "Home", new { message = "Sorry you have no privilege to visit the Page" });
            WarehouseStockIn temp = new WarehouseStockIn();
            List<SelectListItem> list = base.GetSelectList(temp.InStatusList);
            list.Add(new SelectListItem
            {
                Text = "全部",
                Value = "255"
            });
            ViewBag.InStatus = list;
            list = base.GetSelectList(temp.RefTypeList);
            list.Add(new SelectListItem
            {
                Text = "全部",
                Value = "255"
            });
            ViewBag.RefType = list;
            return View();
        }
Ejemplo n.º 3
0
 public StockInBill(WarehouseStockIn oStockIn, OrderInformation oOrder, List<StockInSku> oStockInSkus)
 {
     this.oStockIn = oStockIn;
     this.oOrder = oOrder;
     this.oStockInSkus = oStockInSkus;
 }
Ejemplo n.º 4
0
 public StockInBill(WarehouseStockIn oStockIn, OrderInformation oOrder, List<StockInSku> oStockInSkus,PurchaseInformation oPurchase, List<StockInSkuAndPurchase> oInSkuAndPurchase)
 {
     this.oStockIn = oStockIn;
     this.oOrder = oOrder;
     this.oStockInSkus = oStockInSkus;
     this.oPurchase = oPurchase;
     this.oInSkuAndPurchase = oInSkuAndPurchase;
 }
Ejemplo n.º 5
0
 public ActionResult StockInEditDB(WarehouseStockIn model)
 {
     if (!base.CheckPrivilege("EnablePrepare"))//制表权限验证
         return RedirectToAction("ErrorPage", "Home", new { message = "Sorry you have no privilege to visit the Page" });
     WarehouseStockIn temp = dbEntity.WarehouseStockIns.Find(model.Gid);
     if (temp == null || temp.Deleted)
     {
         return Error("记录不存在", Url.Action("StockIn"));
     }
     if (model.Istatus == (byte)ModelEnum.StockInStatus.CONFIRMED)
     {
         return Error("已确认,不能编辑", Url.Action("StockIn"));
     }
     temp.InType = model.InType;
     ModelEnum.NoteType refType = GetRefType((Guid)model.InType);
     if (refType != ModelEnum.NoteType.NONE && !model.RefID.HasValue)
     {
         return Error("必须填写关联单据", Url.Action("StockIn"));
     }
     temp.RefType = (byte)refType;
     if (refType != ModelEnum.NoteType.NONE)
         temp.RefID = model.RefID;
     dbEntity.SaveChanges();
     return RedirectToAction("StockIn");
 }
Ejemplo n.º 6
0
 public ActionResult StockInAddDB(WarehouseStockIn model)
 {
     if (!base.CheckPrivilege("EnablePrepare"))//制表权限验证
         return RedirectToAction("ErrorPage", "Home", new { message = "Sorry you have no privilege to visit the Page" });
     try
     {
         WarehouseStockIn stockIn = new WarehouseStockIn
         {
             WhID = model.WhID,
             InType = model.InType,
             Prepared = CurrentSession.UserID,
             Remark = model.Remark
         };
         ModelEnum.NoteType refType = GetRefType((Guid)model.InType);
         if (refType != ModelEnum.NoteType.NONE && !model.RefID.HasValue)
         {
             return Error("关联单据必须填写", Url.Action("StockIn"));
         }
         stockIn.RefType = (byte)refType;
         if (refType != ModelEnum.NoteType.NONE)
             stockIn.RefID = model.RefID;
         dbEntity.WarehouseStockIns.Add(stockIn);
         dbEntity.SaveChanges();
         //需要控制页面流到对应的组织和仓库
         return RedirectToAction("StockInEdit", new { inID = stockIn.Gid });
     }
     catch (RefTypeNotFoundExcetpion)
     {
         return Error("关联单据类型出现异常", Url.Action("StockIn"));
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 添加WarehouseStockInAdd部分页Action
 /// </summary>
 /// <param name="warehouseID">对应的仓库的Gid</param>
 /// <returns>返回添加仓库的部分页</returns>
 /// //edit by tianyou 2011/10/15 添加whID 参数为null情况
 public ActionResult StockInAdd(Guid? whID = null,Guid? inType = null ,byte? refType = null, Guid? refID = null)
 {
     if (!base.CheckPrivilege("EnablePrepare"))//制表权限验证
         return RedirectToAction("ErrorPage", "Home", new { message = "Sorry you have no privilege to visit the Page" });
     WarehouseInformation warehouse = whID == null ? null : dbEntity.WarehouseInformations.Where(w => w.Gid == whID).FirstOrDefault();
     if (whID == null || warehouse == null || warehouse.Deleted)
     {
         return Error("仓库不存在", Url.Action("StockIn"));
     }
     else
     {
         Guid? bulkInGid = (from cat in dbEntity.GeneralStandardCategorys
                            where cat.Code == "PurchaseIn"
                               && !cat.Deleted
                            select cat.Gid).SingleOrDefault();
         if (bulkInGid == null)
         {
             return Error("标准分类出现异常", Url.Action("StockIn"));
         }
         WarehouseStockIn model = new WarehouseStockIn
         {
             WhID = (Guid)whID,
             Warehouse = warehouse,
             RefType = (byte)ModelEnum.NoteType.PURCHASE,
             InType = bulkInGid,
             RefID = Guid.Empty
         };
         if (inType.HasValue)
             model.InType = inType;
         if (refType.HasValue)
             model.RefType = refType.Value;
         if (refID.HasValue)
             model.RefID = refID;
         return View(model);
     }
 }