private void Redo(ScrapOrder allocateOrder)
 {
     if (this.RedoClick != null)
     {
         this.RedoClick(allocateOrder, this);
     }
 }
Beispiel #2
0
        private void ShowForm(ScrapOrder order)
        {
            //采购进货明细
            CostumeStoreTrackSearchScrapDetailForm form
                = new CostumeStoreTrackSearchScrapDetailForm();

            form.BaseModifyCostumeID = para.CostumeID;
            form.ShowDialog(order);
        }
Beispiel #3
0
        public ScrapOrderCtrl(ScrapOrder order)
        {
            InitializeComponent();
            Init();
            this.order = order;

            if (!HasPermission(RolePermissionMenuEnum.报损单查询, RolePermissionEnum.重做_单据时间))
            {
                dateTimePicker_Start.Enabled = false;
            }
        }
 private void Initialize(ScrapOrder order)
 {
     if (order == null || String.IsNullOrEmpty(order.OutboundOrderID))
     {
         return;
     }
     try
     {
         this.Text += "-" + order.ID;
         List <BoundDetail> list = CommonGlobalCache.ServerProxy.GetOutboundDetail(order.OutboundOrderID);
         this.BindingOutboundDetailSource(list);
     }
     catch (Exception ee)
     {
         CommonGlobalUtil.ShowError(ee);
     }
 }
Beispiel #5
0
 private void dataGridView_RetailDetail_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     try {
         ScrapOrder item = dataGridView_RetailDetail.Rows[e.RowIndex].DataBoundItem as ScrapOrder;
         if (e.ColumnIndex == totalCountDataGridViewTextBoxColumn.Index)
         {
             ShowForm(item);
         }
     }
     catch (Exception ee)
     {
         CommonGlobalUtil.ShowError(ee);
     }
 }
 public ScrapOrderDetailCtrl(ScrapOrder 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.curScrapOrder = order;
     Initialize();
 }
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                List <ScrapOrder> curScrapOrderListSource = (List <ScrapOrder>) this.dataGridView1.DataSource;
                ScrapOrder        item = curScrapOrderListSource[e.RowIndex];

                if (ColumnOrder.Index == e.ColumnIndex)
                {
                    this.skinSplitContainer1.Panel2Collapsed = false;
                    this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2, false);
                }
                else if (ColumnPrint.Index == e.ColumnIndex)
                {
                    this.skinSplitContainer1.Panel2Collapsed = false;
                    this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2, true);
                }
                else if (ColumnCancel.Index == e.ColumnIndex)
                {
                    this.Cancel(item);
                }
                else if (ColumnRedo.Index == e.ColumnIndex)
                {
                    this.Redo(item);
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.WriteLog(ex);
            }
        }
        private void Cancel(ScrapOrder allocateOrder)
        {
            try
            {
                if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                InteractResult result = null;
                result = GlobalCache.ServerProxy.CancelScrap(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();
            }
        }
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (e.RowIndex < -1 || e.ColumnIndex < -1)
            {
                return;
            }
            if (e.Value == null)
            {
                return;
            }

            DataGridView view  = sender as DataGridView;
            ScrapOrder   order = view.Rows[e.RowIndex].DataBoundItem as ScrapOrder;

            if (e.ColumnIndex == ShopNameColumn.Index)
            {
                e.Value = GlobalCache.GetShopName(e.Value.ToString());
            }
            else if (e.ColumnIndex == AdminUserColumn.Index)
            {
                e.Value = GlobalCache.GetUserName(e.Value.ToString());
            }
            else if (e.ColumnIndex == ColumnCancel.Index)
            {
                if (order.IsCancel)
                {
                    e.Value = null;
                }
            }
            else if (e.ColumnIndex == ColumnRedo.Index)
            {
                if (!order.IsCancel)
                {
                    e.Value = null;
                }
            }
        }
Beispiel #10
0
        //简单打印示例
        public static void Print(ScrapOrder item, DataGridView dataGridView2, int times = 1)
        {
            //if (times < 0) { times = 0; }

            //for (int i = 0; i < times; i++)
            //{

            GoldPrinter.MisGoldPrinter misGoldPrinter = new GoldPrinter.MisGoldPrinter(false, new PrinterMargins(20, 20, 20, 20, 787, 1129));

            misGoldPrinter.Title   = "报损单";                                                        //主标题(C#用\n表示换行)
            misGoldPrinter.Caption = "";                                                           //副标题
                                                                                                   //misGoldPrinter.Top = "单号:" + item.AllocateOrder.ID + "|收货方:" + CommonGlobalCache.GetShopName(item.AllocateOrder.DestShopID) + "|开单日期:" + item.AllocateOrder.CreateTime;                                       //抬头,一行三列的文字说明,用|分隔

            Header header = new Header(4, 2);                                                      //行列数基本不受限制,但超过一页失去意义,因为以Body为主,以其它为辅

            header.IsDrawAllPage = true;                                                           //可以指定每页是否重复打印
            header.SetText(0, 0, "报损单号:" + item.ID);
            header.SetText(0, 1, "开单时间:" + item.CreateTime.GetDateTimeFormats('f')[0].ToString()); //DataSource可以是字符串、一维数组、二维数组、DataTable、WinDataGrid、WebDataGrid、ListView\ListView、
            header.SetText(1, 0, "店    铺:" + CommonGlobalCache.GetShopName(item.ShopID));
            header.SetText(1, 1, "操 作 人:" + CommonGlobalCache.GetUserName(item.OperatorUserID));   //同仁们还可以根据实际应用对GridBase的DataSource进行扩展
            header.SetText(2, 0, "总 数 量:" + item.TotalCount.ToString());
            header.SetText(2, 1, "总 金 额:" + item.TotalPrice.ToString());                           //同仁们还可以根据实际应用对GridBase的DataSource进行扩展
            header.SetText(3, 0, "备    注:");
            header.SetText(3, 1, item.Remarks);

            misGoldPrinter.Header = header;                     //将定制对象,赋给页头
                                                                // misGoldPrinter.Top = new String[] { "单号:" + item.AllocateOrder.ID + "|收货方:" + CommonGlobalCache.GetShopName(item.AllocateOrder.DestShopID) + "|开单日期:" + item.AllocateOrder.CreateTime,
                                                                //  "发货方:" + CommonGlobalCache.GetShopName(item.AllocateOrder.SourceShopID) + "|操作人:" + CommonGlobalCache.GetUserName(item.AllocateOrder.SourceUserID) + "|打印日期:" + System.DateTime.Now.ToLongDateString()  };                                       //抬头,一行三列的文字说明,用|分隔


            //  misGoldPrinter.Bottom = "发货方:" + CommonGlobalCache.GetShopName(item.AllocateOrder.SourceShopID) + "|操作人:" + CommonGlobalCache.GetUserName(item.AllocateOrder.SourceUserID) + "|打印日期:" + System.DateTime.Now.ToLongDateString() + "|";  //结尾,说明同抬头
            misGoldPrinter.DataSource = DataGridViewUtil.ToStringArray(dataGridView2, true, true);
            if (!Directory.Exists(CommonGlobalUtil.SystemDir + "EXPORTS\\"))
            {
                Directory.CreateDirectory(CommonGlobalUtil.SystemDir + "EXPORTS\\");
            }
            misGoldPrinter.FileName = CommonGlobalUtil.SystemDir + "EXPORTS\\" + item.ID + ".jpg";
            ((GoldPrinter.Body)(misGoldPrinter.Body)).Font = dataGridView2.Font;

            int[] widths = new int[] {
                80, 100, 40, 30,
                30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                , 40, 50, 50
            };
            List <int> widthList = new List <int>();

            for (int i = 0; i <
                 dataGridView2.Columns.Count; i++)
            {
                DataGridViewColumn column = dataGridView2.Columns[i];
                if (column.Visible && !String.IsNullOrEmpty(column.HeaderText))
                {
                    widthList.Add(widths[i]);
                }
            }
            widths = widthList.ToArray();
            int newWidth   = 787;
            int totalWidth = 0;

            for (int i = 0; i < widths.Length; i++)
            {
                totalWidth += widths[i];
            }
            for (int i = 0; i < widths.Length; i++)
            {
                widths[i] = decimal.ToInt32(Math.Round((widths[i] * newWidth * (decimal)1.0 / totalWidth), 0, MidpointRounding.AwayFromZero));
            }
            ((GoldPrinter.Body)(misGoldPrinter.Body)).ColsWidth = widths;
            misGoldPrinter.Preview();
            misGoldPrinter.Dispose();
            misGoldPrinter = null;
        }
 public PaymentCommissionForm(ScrapOrder item)
 {
     InitializeComponent();
 }
Beispiel #12
0
        private ScrapCostume Build()
        {
            if (this.curOutboundDetailList == null || this.curOutboundDetailList.Count == 0)
            {
                return(null);
            }
            int                totalCount      = 0;
            decimal            totalPrice      = 0;
            decimal            totalCost       = 0;
            List <BoundDetail> outboundDetails = new List <BoundDetail>();

            //使用报损单的店铺ID信息

            // Shop shop = GlobalCache.ShopList.Find(t => t.ID == this.curReplenishOrder.ShopID);
            Shop   shop     = (Shop)this.skinComboBoxShopID.SelectedItem;
            string id       = IDHelper.GetID(OrderPrefix.OutboundOrder, shop.AutoCode);
            string pOrderID = IDHelper.GetID(OrderPrefix.ScrapOrder, shop.AutoCode);

            foreach (BoundDetail detail in this.curOutboundDetailList)
            {
                if (detail.SumCount <= 0)
                {
                    continue;
                }
                if (detail.Comment == null)
                {
                    detail.Comment = "";
                }
                totalCount         += detail.SumCount;
                totalPrice         += detail.SumMoney;
                totalCost          += detail.SumCost;
                detail.BoundOrderID = id;
                outboundDetails.Add(detail);
            }

            OutboundOrder order = new OutboundOrder()
            {
                SourceOrderID  = pOrderID,
                ID             = id,
                OperatorUserID = GlobalCache.CurrentUserID,
                ShopID         = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue),
                CreateTime     = dateTimePicker_Start.Value,
                EntryTime      = DateTime.Now,
                TotalCount     = totalCount,
                TotalCost      = totalCost,
                TotalPrice     = totalPrice,
                Remarks        = this.skinTextBox_Remarks.SkinTxt.Text
            };


            ScrapOrder pOrder = new ScrapOrder()
            {
                // GuideID = ValidateUtil.CheckEmptyValue(this.guideComboBox1.SelectedValue),
                ID              = pOrderID,
                OperatorUserID  = GlobalCache.CurrentUserID,
                OutboundOrderID = order.ID,
                ShopID          = order.ShopID,
                CreateTime      = dateTimePicker_Start.Value,
                EntryTime       = DateTime.Now,
                TotalCount      = totalCount,
                TotalPrice      = totalPrice,
                Remarks         = this.skinTextBox_Remarks.SkinTxt.Text
            };

            List <ScrapDetail> scrapDetails = OutboundDetail2ScrapDetail(outboundDetails, pOrderID);

            return(new ScrapCostume()
            {
                ScrapOrder = pOrder,
                OutboundOrder = order,
                OutboundDetails = outboundDetails,
                ScrapDetails = scrapDetails
            });
        }
 internal void ShowDialog(ScrapOrder order)
 {
     this.Initialize(order);
     this.ShowDialog();
 }