Пример #1
0
        /// <summary>
        /// 库房启禁用状态
        /// </summary>
        /// <param name="houseCode">库房编码</param>
        /// <param name="enabled">true,启用;false禁用</param>
        /// <returns></returns>
        public ResponseData WareHouseEnabled(string houseCode, bool enabled)
        {
            ResponseData response = new ResponseData();

            try
            {
                ERP_WHModel wareHouse = bllERPWH.GetModelByWHCode(houseCode);
                if (wareHouse == null)
                {
                    response.Status   = false;
                    response.Describe = "库房不存在,库房设置失败!";
                    return(response);
                }
                wareHouse.ERP_WH_Enabled = enabled.ToString().ToUpper();
                bllERPWH.Update(wareHouse);

                response.Status = true;
                if (enabled == true)
                {
                    response.Describe = "库房启用成功!";
                }
                else
                {
                    response.Describe = "库房禁用成功!";
                }
                return(response);
            }
            catch (Exception ex)
            {
                response.Status = false;
                if (enabled == true)
                {
                    response.Describe = "库房启用失败!" + ex.Message;
                }
                else
                {
                    response.Describe = "库房禁用失败!" + ex.Message;
                }
                return(response);
            }
        }
Пример #2
0
        /// <summary>
        /// 仓库信息
        /// </summary>
        /// <param name="wareHouse"></param>
        /// <param name="vgInfo"></param>
        /// <param name="whShelfRelList"></param>
        /// <returns></returns>
        public ResponseData WareHouseInfor(WareHouse wareHouse, WH_VGInfo vgInfo, List <WH_Shelf_Rel> whShelfRelList)
        {
            ResponseData response = new ResponseData();

            try
            {
                if (wareHouse == null)
                {
                    response.Status   = false;
                    response.Describe = "仓库描述类为空!";
                    return(response);
                }
                ERP_WHModel erpWhModel = new ERP_WHModel();
                erpWhModel.ERP_WH_Code           = wareHouse.Code;
                erpWhModel.ERP_WH_CreateGroup    = wareHouse.CreateGroup;
                erpWhModel.ERP_WH_Default_Status = wareHouse.DefaultStatus;
                erpWhModel.ERP_WH_Enabled        = wareHouse.EnableMange.ToString().ToUpper();
                erpWhModel.ERP_WH_ID             = wareHouse.MainID;
                erpWhModel.ERP_WH_Name           = wareHouse.Name;
                erpWhModel.ERP_WH_Property       = wareHouse.Property;
                erpWhModel.ERP_WH_UseGroup       = wareHouse.UseGroup;
                bllERPWH.UpdateWH(erpWhModel);
                if (wareHouse.EnableMange == true)//启用仓位管理
                {
                    ERP_WH_VGModel erpWhGvData = new ERP_WH_VGModel();
                    erpWhGvData.ERP_WH_ID      = erpWhModel.ERP_WH_ID;
                    erpWhGvData.ERP_WH_VG_Code = vgInfo.WH_VG_Code;
                    erpWhGvData.ERP_WH_VG_ID   = vgInfo.MainID;
                    bllERPWhVG.UpdateWHVG(erpWhGvData);

                    //ERP_Shelf_VGModel shelfVgData = new ERP_Shelf_VGModel();
                    //shelfVgData.ERP_Shelf_VG_ID = shelfVg.Shelf_VG_MainID;
                    //shelfVgData.ERP_Shelf_VG_Code = shelfVg.Code;
                    //shelfVgData.ERP_Shelf_VG_Name = shelfVg.Name;
                    //bllERPShelfVG.UpdateVG(shelfVgData);

                    //foreach (Shelf_VG_List shelfVgListTemp in shelfVgList)
                    //{
                    //    ERP_Shelf_VG_VListModel shelfVgListData = new ERP_Shelf_VG_VListModel();
                    //    shelfVgListData.ERP_Shelf_VG_ID = shelfVgListTemp.Shelf_VG_MainID;
                    //    shelfVgListData.ERP_Shelf_VG_VList_Code = shelfVgListTemp.Code;
                    //    shelfVgListData.ERP_Shelf_VG_VList_ID = shelfVgListTemp.Shelf_VG_List_MainID;
                    //    shelfVgListData.ERP_Shelf_VG_VList_Name = shelfVgListTemp.Name;
                    //    bllERPShelfVGList.UpdateVGList(shelfVgListData);
                    //}

                    foreach (WH_Shelf_Rel whShelfRel in whShelfRelList)
                    {
                        ERP_WH_VG_RELModel erpVGREL = new ERP_WH_VG_RELModel();
                        erpVGREL.ERP_WH_VG_REL_ID      = Guid.NewGuid().ToString();
                        erpVGREL.ERP_Shelf_VG_VList_ID = whShelfRel.WH_Shelf_VG_List_ID;
                        erpVGREL.ERP_WH_VG_ID          = whShelfRel.WH_VG_ID;
                        erpVGREL.ERP_WH_VG_REL_Value   = whShelfRel.Value;
                        bllWhVgRel.UpdateVGRELList(erpVGREL);
                    }
                }

                response.Status   = true;
                response.Describe = "仓库数据更新成功!";
                return(response);
            }
            catch (Exception ex)
            {
                response.Status   = false;
                response.Describe = "启用仓库管理错误!" + ex.Message;
                return(response);
            }
        }