Ejemplo n.º 1
0
        /// <summary>
        /// 根据条件查询统计调拨单统计行
        /// </summary>
        /// <returns></returns>
        public ActionResult GetCount()
        {
            string CompanyID     = WebUtil.GetFormValue <string>("CompanyID");
            string OrderNum      = WebUtil.GetFormValue <string>("OrderNum");
            int    AllocateType  = WebUtil.GetFormValue <int>("AllocateType", 0);
            string ContractOrder = WebUtil.GetFormValue <string>("ContractOrder");
            int    Status        = WebUtil.GetFormValue <int>("Status", 0);
            string BeginTime     = WebUtil.GetFormValue <string>("BeginTime");
            string EndTime       = WebUtil.GetFormValue <string>("EndTime");
            string StorageNum    = WebUtil.GetFormValue <string>("StorageNum");

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            AllocateOrderEntity entity = new AllocateOrderEntity();

            entity.CompanyID     = CompanyID;
            entity.OrderNum      = OrderNum;
            entity.AllocateType  = AllocateType;
            entity.ContractOrder = ContractOrder;
            entity.Status        = Status;
            entity.BeginTime     = BeginTime;
            entity.EndTime       = EndTime;
            entity.StorageNum    = StorageNum;

            int Count = bill.GetCount(entity);

            DataResult <int> dataResult = new DataResult <int>();

            dataResult.Code    = (int)EResponseCode.Success;
            dataResult.Message = "响应成功";
            dataResult.Result  = Count;

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 设置打印数据
        /// </summary>
        /// <returns></returns>
        public ActionResult Print()
        {
            string   CompanyID = WebUtil.GetFormValue <string>("CompanyID");
            string   SnNum     = WebUtil.GetFormValue <string>("SnNum");
            string   PrintUser = WebUtil.GetFormValue <string>("PrintUser");
            DateTime PrintTime = WebUtil.GetFormValue <DateTime>("PrintTime");

            AllocateOrderEntity entity = new AllocateOrderEntity();

            entity.SnNum     = SnNum;
            entity.CompanyID = CompanyID;
            entity.PrintUser = PrintUser;
            entity.PrintTime = PrintTime;

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);

            string     returnValue = bill.Print(entity);
            DataResult result      = new DataResult();

            if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "设置成功";
            }
            else
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "设置失败";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据调拨单唯一编号删除调拨单
        /// </summary>
        /// <returns></returns>
        public ActionResult DeleteSingle()
        {
            string SnNum     = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty);

            AllocateOrderEntity entity = new AllocateOrderEntity();

            entity.SnNum     = SnNum;
            entity.CompanyID = CompanyID;

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            string returnValue = bill.Delete(entity);

            DataResult result = new DataResult();

            if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "调拨单删除成功";
            }
            else
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "调拨单删除失败";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Ejemplo n.º 4
0
        public InboundDetailCtrl(InboundOrder inboundOrder, AllocateOrder order)
        {
            InitializeComponent();
            dataGridViewPagingSumCtrl = new DataGridViewPagingSumCtrl(dataGridView1, new string[] {
                xSDataGridViewTextBoxColumn.DataPropertyName,
                sDataGridViewTextBoxColumn.DataPropertyName,
                mDataGridViewTextBoxColumn.DataPropertyName,
                lDataGridViewTextBoxColumn.DataPropertyName,
                xLDataGridViewTextBoxColumn.DataPropertyName,
                xL2DataGridViewTextBoxColumn.DataPropertyName,
                xL3DataGridViewTextBoxColumn.DataPropertyName,
                xL4DataGridViewTextBoxColumn.DataPropertyName,
                xL5DataGridViewTextBoxColumn.DataPropertyName,
                xL6DataGridViewTextBoxColumn.DataPropertyName,
                fDataGridViewTextBoxColumn.DataPropertyName,

                sumCountDataGridViewTextBoxColumn.DataPropertyName,
                sumMoneyDataGridViewTextBoxColumn.DataPropertyName
            });
            dataGridViewPagingSumCtrl.Initialize();
            this.curInboundOrder = inboundOrder; Initialize();
            if (order.State == 1)
            {
                this.curDateTime = order.FinishedTime.ToString();
            }
            else
            {
                this.curDateTime = "";
            }
        }
Ejemplo n.º 5
0
 private void Pick(AllocateOrder allocateOrder)
 {
     if (this.PickClick != null)
     {
         this.PickClick(allocateOrder, this);
     }
 }
Ejemplo n.º 6
0
 private void ReAllocate(AllocateOrder allocateOrder)
 {
     if (this.ReAllocateClick != null)
     {
         this.ReAllocateClick(allocateOrder, this);
     }
 }
Ejemplo n.º 7
0
 private void ClickOutboundDetail(AllocateOrder allocateOrder)
 {
     if (this.OutboundDetailClick != null)
     {
         this.skinSplitContainer1.Panel2Collapsed = false;
         this.OutboundDetailClick(allocateOrder.OutboundOrderID, this, this.skinSplitContainer1.Panel2);
     }
 }
Ejemplo n.º 8
0
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }
            if (e.Value == null)
            {
                return;
            }

            DataGridViewRow row   = dataGridView1.Rows[e.RowIndex];
            AllocateOrder   order = (AllocateOrder)row.DataBoundItem;

            AllocateOrderState state = (AllocateOrderState)order.State;

            if (operationColumn.Index == e.ColumnIndex)
            {
                if ((state == AllocateOrderState.Delivery && order.DestShopID != CommonGlobalCache.CurrentShopID &&
                     CommonGlobalCache.CurrentShopID != CommonGlobalCache.GeneralStoreShopID
                     ) ||
                    state == AllocateOrderState.OverrideOrder ||
                    state == AllocateOrderState.HangUp ||
                    state == AllocateOrderState.Receipt)
                {
                    e.Value = null;
                }
            }
            else if (ColumnCancel.Index == e.ColumnIndex)
            {
                if (state != AllocateOrderState.Delivery && state != AllocateOrderState.Receipt)
                {
                    e.Value = null;
                }
            }
            else if (ColumnRedo.Index == e.ColumnIndex)
            {
                if (state != AllocateOrderState.OverrideOrder)
                {
                    e.Value = null;
                }
            }
            else if (ColumnPick.Index == e.ColumnIndex)
            {
                if (state != AllocateOrderState.HangUp)
                {
                    e.Value = null;
                }
            }
            else if (FinishedTime.Index == e.ColumnIndex)
            {
                if (state != AllocateOrderState.Receipt)
                {
                    e.Value = null;
                }
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 自动入库
        /// </summary>
        public static bool AutoInbound(AllocateOrder allocateOrder)
        {
            bool success = true;

            if (!LockAutoInbound)
            {
                LockAutoInbound = true;
                //if (CommonGlobalCache.IsCheckStoreState)
                //{
                //    GlobalMessageBox.Show("当前库存处于盘点状态,不能进行此操作!");
                //    return false;
                //}
                //AllocateOrderPagePara pagePara = new AllocateOrderPagePara()
                //{ AllocateOrderID = allocateOrderID,
                //    AllocateOrderState = AllocateOrderState.Delivery,
                //    IsOpenDate = false,
                //  //  DestShopID = CommonGlobalCache.CurrentShopID,
                //    PageIndex = 0,
                //    PageSize = int.MaxValue
                //};
                //AllocateOrderPage listPage = CommonGlobalCache.ServerProxy.GetAllocateInboundOrderPage(pagePara);
                //if (listPage != null)
                //{
                //    foreach (var item in listPage.AllocateOrderList)
                //    {
                Outbound      outbound    = CommonGlobalCache.ServerProxy.GetOneOutbound(allocateOrder.ID);
                InboundPara   inboundPara = BuildInboundPara(outbound, allocateOrder);
                InboundResult result      = CommonGlobalCache.ServerProxy.Inbound(inboundPara);

                switch (result)
                {
                case InboundResult.Success:
                    break;

                case InboundResult.StateIsNotDelivery:
                    success = false;
                    break;

                case InboundResult.Error:
                    success = false;
                    break;

                default:
                    break;
                }
                if (!success)
                {
                    GlobalMessageBox.Show("自动入库错误!" + inboundPara.InboundOrder.ID);
                    // break;
                }

                //    }
                LockAutoInbound = false;
                //  }
            }
            return(success);
        }
Ejemplo n.º 10
0
 private void DeleteSelectedHangedOrder(AllocateOrder order)
 {
     if (orders.Contains(order))
     {
         orders.Remove(order);
     }
     flag = true;
     dataGridViewPagingSumCtrl.BindingDataSource(orders);
 }
Ejemplo n.º 11
0
        private void ClickInboundDetail(AllocateOrder allocateOrder)
        {
            if ((AllocateOrderState)allocateOrder.State != AllocateOrderState.Receipt)
            {
                GlobalMessageBox.Show("该单还未收货,入库单明细为空");
                return;
            }

            this.skinSplitContainer1.Panel2Collapsed = false;
            this.InboundDetailClick?.Invoke(allocateOrder.InboundOrderID, this, this.skinSplitContainer1.Panel2);
        }
Ejemplo n.º 12
0
        private InboundPara BuildInboundPara()
        {
            if (this.curOutbound == null || this.curOutbound.OutboundOrder == null || this.curOutbound.OutboundDetails == null || this.curOutbound.OutboundDetails.Count == 0)
            {
                return(null);
            }

            int                totalCount     = 0;
            decimal            totalPrice     = 0;
            decimal            totalCost      = 0;
            List <BoundDetail> inboundDetails = new List <BoundDetail>();
            string             id             = IDHelper.GetID(OrderPrefix.InboundOrder, CommonGlobalCache.CurrentShop.AutoCode);

            foreach (BoundDetail detail in this.curOutbound.OutboundDetails)
            {
                //if (detail.SumCount <= 0)
                //{
                //    continue;

                //}
                totalCost  += detail.SumCost;
                totalCount += detail.SumCount;
                totalPrice += detail.SumMoney;
                inboundDetails.Add(OutboundDetailConvertToInboundDetail(detail, id));
            }
            if (CommonGlobalCache.CurrentUser.Type == UserInfoType.Admin)
            {
                AllocateOrder allocateOrder = CommonGlobalCache.ServerProxy.GetAllocateOrder(this.curOutbound.OutboundOrder.SourceOrderID);
                shopID = allocateOrder.DestShopID;
            }
            InboundOrder inboundOrder = new InboundOrder()
            {
                SourceOrderID  = this.curOutbound.OutboundOrder.SourceOrderID,
                ShopID         = shopID,
                ID             = id,
                OperatorUserID = //IsPos ? (string)this.guideComboBox1.SelectedValue :
                                 CommonGlobalCache.CurrentUserID,
                CreateTime = DateTime.Now,
                EntryTime  = DateTime.Now,
                TotalCost  = totalCost,
                TotalCount = totalCount,

                TotalPrice = totalPrice,
                Remarks    = this.skinTextBox_Remarks.SkinTxt.Text,
            };

            return(new InboundPara()
            {
                InboundOrder = inboundOrder,
                InboundDetails = inboundDetails
            });
        }
Ejemplo n.º 13
0
        //private void skinComboBoxShopID_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    CostumeCurrentShopTextBox1.ShopID = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue);
        //}

        private void baseButton1_Click(object sender, EventArgs e)
        {
            if (GlobalMessageBox.Show("确定清空下表数据吗?", "友情提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                dataGridView2.DataSource = null;
                curDetailList?.Clear();
                dataGridView2.Refresh();
                if (action == OperationEnum.Pick)
                {
                    order  = null;
                    action = OperationEnum.Add;
                }
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 获得打印的数据源
        /// </summary>
        /// <returns></returns>
        public ActionResult GetPrint()
        {
            string CompanyID = WebUtil.GetFormValue <string>("CompanyID");
            string SnNum     = WebUtil.GetFormValue <string>("SnNum");

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            DataSet ds = bill.GetPrint(SnNum);
            DataResult <DataSet> dataResult = new DataResult <DataSet>();

            dataResult.Code    = (int)EResponseCode.Success;
            dataResult.Message = "响应成功";
            dataResult.Result  = ds;

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Ejemplo n.º 15
0
        public AllocateOrderApplyCtrl(AllocateOrder order, OperationEnum action = OperationEnum.Add)
        {
            InitializeComponent();

            this.order  = order;
            this.action = action;
            if (action == OperationEnum.Redo)
            {
                if (!HasPermission(RolePermissionMenuEnum.调拨单查询, RolePermissionEnum.重做_单据时间))
                {
                    dateTimePicker_Start.Enabled = false;
                }
            }
            Init();
            LoadConfig();
        }
Ejemplo n.º 16
0
 private void ShowForm(AllocateOrder order)
 {
     if (order.Type == CostumeStoreTrackChangeType.AllocateInbound)
     {
         CostumeStoreTrackSearchIntoDetailForm form
             = new CostumeStoreTrackSearchIntoDetailForm();
         form.BaseModifyCostumeID = para.CostumeID;
         form.ShowDialog(order);
     }
     else
     {
         CostumeStoreTrackSearchIntoDetailWholeSaleForm form
             = new CostumeStoreTrackSearchIntoDetailWholeSaleForm();
         form.BaseModifyCostumeID = para.CostumeID;
         form.ShowDialog(order);
     }
 }
Ejemplo n.º 17
0
 private void Initialize(AllocateOrder order)
 {
     if (order == null || String.IsNullOrEmpty(order.ID))
     {
         return;
     }
     try
     {
         this.Text += "-" + order.ID;
         List <BoundDetail> list = CommonGlobalCache.ServerProxy.GetOutboundDetail(order.OutboundOrderID);
         this.BindingOutboundDetailSource(list);
     }
     catch (Exception ee)
     {
         CommonGlobalUtil.ShowError(ee);
     }
 }
Ejemplo n.º 18
0
        private static InboundPara BuildInboundPara(Outbound curOutbound, AllocateOrder allocateOrder)
        {
            if (curOutbound == null || curOutbound.OutboundOrder == null || curOutbound.OutboundDetails == null || curOutbound.OutboundDetails.Count == 0)
            {
                return(null);
            }

            int                totalCount     = 0;
            decimal            totalCost      = 0;
            decimal            totalPrice     = 0;
            List <BoundDetail> inboundDetails = new List <BoundDetail>();
            string             id             = IDHelper.GetID(OrderPrefix.InboundOrder, CommonGlobalCache.CurrentShop.AutoCode);

            foreach (BoundDetail detail in curOutbound.OutboundDetails)
            {
                //if (detail.SumCount <= 0)
                //{
                //    continue;
                //}
                totalCost  += detail.SumCost;
                totalCount += detail.SumCount;
                totalPrice += detail.SumMoney;
                inboundDetails.Add(OutboundDetailConvertToInboundDetail(detail, id));
            }

            InboundOrder inboundOrder = new InboundOrder()
            {
                SourceOrderID  = curOutbound.OutboundOrder.SourceOrderID,
                ShopID         = allocateOrder.DestShopID,
                ID             = id,
                OperatorUserID = string.Empty,
                CreateTime     = allocateOrder.CreateTime,
                EntryTime      = DateTime.Now,
                TotalCost      = totalCost,
                TotalCount     = totalCount,
                TotalPrice     = totalPrice,
                Remarks        = "自动入库",
            };

            return(new InboundPara()
            {
                InboundOrder = inboundOrder,
                InboundDetails = inboundDetails
            });
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 审核调拨单
        /// </summary>
        /// <returns></returns>
        public ActionResult Audite()
        {
            string SnNum         = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID     = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            int    Status        = WebUtil.GetFormValue <int>("Status", (int)EAudite.NotPass);
            string AuditUser     = WebUtil.GetFormValue <string>("AuditUser", string.Empty);
            string Reason        = WebUtil.GetFormValue <string>("Reason", string.Empty);
            int    OperateType   = WebUtil.GetFormValue <int>("OperateType", 0);
            string EquipmentNum  = WebUtil.GetFormValue <string>("EquipmentNum");
            string EquipmentCode = WebUtil.GetFormValue <string>("EquipmentCode");
            string Remark        = WebUtil.GetFormValue <string>("Remark");

            AllocateOrderEntity entity = new AllocateOrderEntity();

            entity.SnNum         = SnNum;
            entity.CompanyID     = CompanyID;
            entity.Status        = Status;
            entity.AuditUser     = AuditUser;
            entity.Reason        = Reason;
            entity.OperateType   = OperateType;
            entity.EquipmentNum  = EquipmentNum;
            entity.EquipmentCode = EquipmentCode;
            entity.Remark        = Remark;

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            string     returnValue = bill.Audite(entity);
            DataResult result      = new DataResult();

            if ("1000" == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "操作成功";
            }
            else if ("1001" == returnValue)
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "调拨单不存在";
            }
            else if ("1002" == returnValue)
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "调拨单已经审核";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Ejemplo n.º 20
0
 private void dataGridView_RetailDetail_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     try {
         AllocateOrder item = dataGridView_RetailDetail.Rows[e.RowIndex].DataBoundItem as AllocateOrder;
         if (e.ColumnIndex == totalCountDataGridViewTextBoxColumn.Index)
         {
             ShowForm(item);
         }
     }
     catch (Exception ee)
     {
         CommonGlobalUtil.ShowError(ee);
     }
 }
Ejemplo n.º 21
0
        /// <summary>
        /// 查询调拨单详细
        /// </summary>
        /// <returns></returns>
        public ActionResult GetDetail()
        {
            string SnNum                = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID            = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            AllocateDetailEntity entity = new AllocateDetailEntity();

            entity.OrderSnNum = SnNum;
            entity.CompanyID  = CompanyID;
            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            List <AllocateDetailEntity> list = bill.GetOrderDetail(entity);

            DataResult <List <AllocateDetailEntity> > dataResult = new DataResult <List <AllocateDetailEntity> >();

            dataResult.Code    = (int)EResponseCode.Success;
            dataResult.Message = "响应成功";
            dataResult.Result  = list;
            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Ejemplo n.º 22
0
 private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.ColumnIndex < 0 || e.RowIndex < 0)
     {
         return;
     }
     try
     {
         DataGridView  view  = sender as DataGridView;
         AllocateOrder order = view.CurrentRow.DataBoundItem as AllocateOrder;
         curOrder = order;
         BaseButton_Select_Click(null, null);
     }
     catch (Exception ex)
     {
         // CommonGlobalUtil.ShowError(ex);
     }
 }
Ejemplo n.º 23
0
        private void dataGridView_HangedOrder_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            try
            {
                if (e.RowIndex > -1 && e.ColumnIndex > -1)
                {
                    List <PurchaseOrder> orders = dataGridView1.DataSource as List <PurchaseOrder>;
                    if (e.ColumnIndex == operationColumn.Index)
                    {
                        DialogResult dialogResult = GlobalMessageBox.Show("确定删除该条数据?", "提示", MessageBoxButtons.OKCancel);
                        if (dialogResult != DialogResult.OK)
                        {
                            return;
                        }
                        AllocateOrder  order  = dataGridView1.Rows[e.RowIndex].DataBoundItem as AllocateOrder;
                        InteractResult result = CommonGlobalCache.ServerProxy.DeleteUpAllocateOrder(order?.ID);

                        switch (result.ExeResult)
                        {
                        case ExeResult.Success:
                            GlobalMessageBox.Show("删除成功!");
                            CommonGlobalUtil.WriteLog(order.ID);
                            DeleteSelectedHangedOrder(order);
                            break;

                        case ExeResult.Error:
                            GlobalMessageBox.Show(result.Msg);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            catch (Exception ee)
            {
                CommonGlobalUtil.ShowError(ee);
            }
        }
Ejemplo n.º 24
0
        private void Inbound(AllocateOrder allocateOrder)
        {
            if (allocateOrder.State != (byte)AllocateOrderState.Delivery)
            {
                GlobalMessageBox.Show("订单状态不是已发货,不能收货!");
                return;
            }
            if (allocateOrder.DestShopID != CommonGlobalCache.CurrentShopID)
            {
                GlobalMessageBox.Show("本店铺不是收货店铺,不能收货!");
                return;
            }

            if (this.InboundClick != null)
            {
                this.skinSplitContainer1.Panel2Collapsed = false;
                this.InboundClick(allocateOrder.ID, this, this.skinSplitContainer1.Panel2);
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 查询调拨单分页列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetOrderList()
        {
            string CompanyID     = WebUtil.GetFormValue <string>("CompanyID");
            int    PageIndex     = WebUtil.GetFormValue <int>("PageIndex", 1);
            int    PageSize      = WebUtil.GetFormValue <int>("PageSize", 10);
            string OrderNum      = WebUtil.GetFormValue <string>("OrderNum");
            int    AllocateType  = WebUtil.GetFormValue <int>("AllocateType", 0);
            string ContractOrder = WebUtil.GetFormValue <string>("ContractOrder");
            int    Status        = WebUtil.GetFormValue <int>("Status", 0);
            string BeginTime     = WebUtil.GetFormValue <string>("BeginTime");
            string EndTime       = WebUtil.GetFormValue <string>("EndTime");
            string StorageNum    = WebUtil.GetFormValue <string>("StorageNum");

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            AllocateOrderEntity entity = new AllocateOrderEntity();

            entity.CompanyID     = CompanyID;
            entity.OrderNum      = OrderNum;
            entity.AllocateType  = AllocateType;
            entity.ContractOrder = ContractOrder;
            entity.Status        = Status;
            entity.BeginTime     = BeginTime;
            entity.EndTime       = EndTime;
            entity.StorageNum    = StorageNum;

            PageInfo pageInfo = new PageInfo()
            {
                PageIndex = PageIndex, PageSize = PageSize
            };

            List <AllocateOrderEntity>           listResult = bill.GetList(entity, ref pageInfo);
            DataListResult <AllocateOrderEntity> dataResult = new DataListResult <AllocateOrderEntity>()
            {
                Code     = (int)EResponseCode.Success,
                Message  = "响应成功",
                Result   = listResult,
                PageInfo = pageInfo
            };

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 新增调拨单
        /// </summary>
        /// <returns></returns>
        public ActionResult Create()
        {
            string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            AllocateOrderEntity         entity = WebUtil.GetFormObject <AllocateOrderEntity>("Entity");
            List <AllocateDetailEntity> list   = WebUtil.GetFormObject <List <AllocateDetailEntity> >("List");

            entity.SnNum         = ConvertHelper.NewGuid();
            entity.ProductType   = (int)EProductType.Goods;
            entity.Status        = (int)EAudite.Wait;
            entity.IsDelete      = (int)EIsDelete.NotDelete;
            entity.CreateTime    = DateTime.Now;
            entity.CompanyID     = entity.CompanyID.IsEmpty() ? CompanyID : entity.CompanyID;
            entity.EquipmentNum  = "";
            entity.EquipmentCode = "";

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            string     returnValue = bill.Create(entity, list);
            DataResult result      = new DataResult();

            if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "调拨单创建成功";
            }
            else if (returnValue == "1001")
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "调拨仓库未初始化";
            }
            else if (returnValue == "1002")
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "调拨仓库待入库未初始化";
            }
            else
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "调拨单创建失败";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 编辑调拨单主体信息
        /// </summary>
        /// <returns></returns>
        public ActionResult EditOrder()
        {
            string CompanyID           = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            AllocateOrderEntity entity = WebUtil.GetFormObject <AllocateOrderEntity>("Entity");

            Bill <AllocateOrderEntity, AllocateDetailEntity> bill = new AllocateOrder(CompanyID);
            string     returnValue = bill.EditOrder(entity);
            DataResult result      = new DataResult();

            if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "调拨单主体编辑成功";
            }
            else
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "调拨单主体编辑失败";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Ejemplo n.º 28
0
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }
            DataGridViewRow  row  = dataGridView1.Rows[e.RowIndex];
            DataGridViewCell cell = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];

            AllocateOrder order = (AllocateOrder)row.DataBoundItem;

            if (stateNameDataGridViewTextBoxColumn.Index == e.ColumnIndex)
            {
            }
            else if (column_operation.Index == e.ColumnIndex)
            {
                if (e.Value == null)
                {
                    return;
                }


                if (order.State != (byte)AllocateOrderState.Delivery && order.State != (byte)AllocateOrderState.OverrideOrder)
                {
                    e.Value = null;
                }
            }
            else if (SourceShopName.Index == e.ColumnIndex)
            {
                e.Value = CommonGlobalCache.GetShopName(order.SourceShopID);
            }
            else if (DestShopName.Index == e.ColumnIndex)
            {
                e.Value = CommonGlobalCache.GetShopName(order.DestShopID);
            }
            else if (GuideName.Index == e.ColumnIndex)
            {
                e.Value = CommonGlobalCache.GetUserName(order.SourceUserID);
            }
        }
Ejemplo n.º 29
0
 public AllocateOrderDetailCtrl(AllocateOrder order)
 {
     InitializeComponent();
     dataGridViewPagingSumCtrl = new DataGridViewPagingSumCtrl(this.dataGridView1, new String[] {
         xSDataGridViewTextBoxColumn.DataPropertyName,
         sDataGridViewTextBoxColumn.DataPropertyName,
         mDataGridViewTextBoxColumn.DataPropertyName,
         lDataGridViewTextBoxColumn.DataPropertyName,
         xLDataGridViewTextBoxColumn.DataPropertyName,
         xL2DataGridViewTextBoxColumn.DataPropertyName,
         xL3DataGridViewTextBoxColumn.DataPropertyName,
         xL4DataGridViewTextBoxColumn.DataPropertyName,
         xL5DataGridViewTextBoxColumn.DataPropertyName,
         xL6DataGridViewTextBoxColumn.DataPropertyName,
         fDataGridViewTextBoxColumn.DataPropertyName,
         SumMoney4Price.DataPropertyName,
         sumCountDataGridViewTextBoxColumn.DataPropertyName
     });
     dataGridViewPagingSumCtrl.Initialize();
     this.curAllocateOrder = order;
     Initialize();
 }
Ejemplo n.º 30
0
        private void Cancel(AllocateOrder allocateOrder)
        {
            try
            {
                if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                InteractResult result = CommonGlobalCache.ServerProxy.OverrideAllocateOrder(allocateOrder.ID, CommonGlobalCache.CurrentUserID);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("冲单成功!");
                    break;

                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    break;

                default:
                    break;
                }
                this.RefreshPage();
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }