예제 #1
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     try
     {
         switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
         {
         case "删除":
             DialogResult dialogResult = GlobalMessageBox.Show("确定删除该条数据?", "提示", MessageBoxButtons.OKCancel);
             if (dialogResult != DialogResult.OK)
             {
                 return;
             }
             //this.dataGridView1.Rows.RemoveAt(e.RowIndex);
             this.curOutbound.OutboundDetails.RemoveAt(e.RowIndex);
             this.BindingOutboundSource();
             break;
         }
     }
     catch (Exception ee)
     {
         CommonGlobalUtil.WriteLog(ee);
     }
 }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     try
     {
         if (e.RowIndex > -1 && e.ColumnIndex > -1)
         {
             if (CommonGlobalUtil.ConvertToString(this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) == "删除")
             {
                 //DialogResult dialogResult = GlobalMessageBox.Show("确定删除该条数据?", "提示", MessageBoxButtons.OKCancel);
                 //if (dialogResult != DialogResult.OK)
                 //{
                 //    return;
                 //}
                 PfCustomerRetailDetail detail = this.PfCustomerRetailDetailList[e.RowIndex];
                 this.PfCustomerRetailDetailList.RemoveAt(e.RowIndex);
                 dataGridViewPagingSumCtrl.BindingDataSource(this.PfCustomerRetailDetailList);
             }
         }
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                List <SupplierAccountRecord> list = (List <SupplierAccountRecord>) this.dataGridView1.DataSource;
                SupplierAccountRecord        item = (SupplierAccountRecord)list[e.RowIndex];
                if (e.ColumnIndex == sourceOrderIDDataGridViewTextBoxColumn.Index)
                {
                    if ((AccountType)item.AccountType == AccountType.PurchaseCollection || (AccountType)item.AccountType == AccountType.Other)
                    {
                        SupplierAccountSearchForm form = new SupplierAccountSearchForm();
                        if (form.ShowDialog(item, true) == DialogResult.OK)
                        {
                            RefreshPage();
                        }
                    }
                    else
                    {
                        SupplierAccountRecordOrderDetailForm form = new SupplierAccountRecordOrderDetailForm();
                        form.ShowDialog(item);
                    }
                    //402 在“供应商往来账明细”窗口内,增加点击单据 弹出单据明细窗口 功能。
                    //   this.skinSplitContainer1.Panel2Collapsed = false;
                    //  this.SourceOrderDetailClick?.Invoke(item.SourceOrderID, this, this.skinSplitContainer1.Panel2);
                }
                else if (e.ColumnIndex == ColumnDelete.Index)
                {
                    Delete(item);
                }
                else if (e.ColumnIndex == ColumnEdit.Index)
                {
                    Edit(item);
                }
                else if (e.ColumnIndex == Column2.Index)
                {
                    PayPrint(item);
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
예제 #4
0
        private void BindingReturnOrderSource(RetailSummary listPage)
        {
            // this.dataGridViewPagingSumCtrl.BindingDataSource(listPage?.RetailSummaryInfos);

            dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(listPage?.RetailSummaryInfos));
            this.skinSplitContainer1.Panel2Collapsed = true;
        }
예제 #5
0
 /// <summary>
 /// 绑定RetailDetail数据源并设置下方的Label值
 /// </summary>
 private void BindingRetailDetailDataSourceAndCleanLabel(RetailOrder retailOrder)
 {
     this.skinSplitContainer1.Panel2Collapsed = false;
     if (retailOrder == null || String.IsNullOrEmpty(retailOrder.ID))
     {
         this.dataGridView_RetailDetail.DataSource = null;
     }
     else
     {
         List <RetailDetail> retailDetailList = CommonGlobalCache.ServerProxy.GetRetailDetailList(retailOrder.ID);
         this.dataGridView_RetailDetail.DataSource = null;
         if (retailDetailList != null && retailDetailList.Count > 0)
         {
             foreach (RetailDetail detail in retailDetailList)
             {
                 detail.CostumeName     = CommonGlobalCache.GetCostumeName(detail.CostumeID);
                 detail.SizeDisplayName = CommonGlobalUtil.GetCostumeSizeName(detail.CostumeID, detail.SizeName);
                 //   detail.SinglePrice = detail.SumMoney / detail.BuyCount*-1;
                 //  detail.BrandName =CommonGlobalCache.GetBrandName4CostumeID(detail.CostumeID);
             }
             this.dataGridView_RetailDetail.DataSource = DataGridViewUtil.ListToBindingList(retailDetailList);
         }
     }
     this.dataGridView_RetailDetail.Refresh();
     this.SetRetailOrderLabel(retailOrder);
 }
예제 #6
0
        private void DoExport()
        {
            try
            {
                List <CheckStoreSummary>      unableStore = new List <CheckStoreSummary>();
                List <CheckStoreSummary>      stores      = new List <CheckStoreSummary>();
                List <CheckStoreSummary>      list        = (List <CheckStoreSummary>) this.dataGridView1.DataSource;
                System.Collections.SortedList columns     = new System.Collections.SortedList();
                List <String> keys   = new List <string>();
                List <String> values = new List <string>();
                foreach (DataGridViewColumn item in dataGridView1.Columns)
                {
                    if (item.Visible)
                    {
                        keys.Add(item.DataPropertyName);
                        values.Add(item.HeaderText);
                    }
                }


                NPOIHelper.Keys   = keys.ToArray();
                NPOIHelper.Values = values.ToArray();
                NPOIHelper.ExportExcel(DataGridViewUtil.ToDataTable(list), path);

                GlobalMessageBox.Show("导出完毕!");
            }
            catch (Exception ex)
            { ShowError(ex); }
            finally
            {
                UnLockPage();
            }
        }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     try
     {
         if (e.RowIndex > -1 && e.ColumnIndex > -1)
         {
             /*   List<Brand> list = DataGridViewUtil.BindingListToList<Brand>(dataGridView1.DataSource);
              * Brand item = (Brand)list[e.RowIndex];
              * switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
              * {
              *   case "编辑":
              *       Edit(item);
              *       break;
              *
              *   case "删除":
              *       Delete(list,item);
              *       break;
              * }*/
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
     finally
     {
         GlobalUtil.UnLockPage(this);
     }
 }
예제 #8
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                DataGridView view = (DataGridView)sender;
                List <GuideDayAchievement> curDayReportListSource = (List <GuideDayAchievement>)view.DataSource;
                GuideDayAchievement        item = curDayReportListSource[e.RowIndex];
                item.ReportDate = Convert.ToInt32(DateTime.Now.Year + "" + DateTime.Now.Month + "" + DateTime.Now.Day);
                switch (view.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
                {
                case "明细":
                    //   GuideDetailClick(item);
                    form.ShowDialog(curDayReport.ShopID, item.GuideID, curDayReport.ReportDate);

                    break;
                }
            }
            catch (Exception ex)
            {
                CommonGlobalUtil.ShowError(ex);
            }
        }
예제 #9
0
        private void BaseButton_AddCostume_Click(object sender, EventArgs e)
        {
            try
            {
                int buyCount = int.Parse(this.skinTextBox_bugCount.SkinTxt.Text);
                PfCustomerRetailDetail detail = new PfCustomerRetailDetail()
                {
                    PfCustomerID   = pfCustomer.ID,
                    PfCustomerName = PfCustomerCache.GetPfCustomerName(pfCustomer.ID),
                    CostumeID      = this.currentSelectedItem.Costume.ID,
                    CostumeName    = this.currentSelectedItem.Costume.Name,
                    ColorName      = this.skinComboBox_Color.Text,
                    SizeName       = ValidateUtil.CheckEmptyValue(this.skinComboBox_Size.SelectedValue),
                    // 显示自己设置的尺码组和对应的尺码列表
                    SizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(ValidateUtil.CheckEmptyValue(this.skinComboBox_Size.SelectedValue), CommonGlobalCache.GetSizeGroup(this.currentSelectedItem.Costume.SizeGroupName)),
                    BuyCount        = buyCount,
                };

                if (!this.AddSelectedCostumeToList(detail))
                {
                    return;
                }
                dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(this.PfCustomerRetailDetailList));
                lastAddCustomer = pfCustomer;
                this.skinTextBox_bugCount.SkinTxt.Text = "1";
            }
            catch (Exception ee)
            {
                CommonGlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("添加失败!");
            }
        }
예제 #10
0
        private void skinComboBoxShopID_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (dataGridView1.Rows.Count > 0 && isFlag == false)
            {
                DialogResult dialogResult = GlobalMessageBox.Show("切换店铺将会清空列表,是否确定切换?", "提示", MessageBoxButtons.OKCancel);
                if (dialogResult != DialogResult.OK)
                {
                    isFlag = true;
                    this.skinComboBoxShopID.SelectedValue = ISCancelShopId;
                    return;
                }

                currentRetailCostume.RetailDetailList.Clear();

                dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(currentRetailCostume.RetailDetailList));
                // SetCostumeDetails(null);
            }
            else
            {
                isFlag = false;
            }
            //skinComboBoxShopID
            shopID = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue);

            ISCancelShopId = shopID;
            guideComboBox1.Initialize(Common.GuideComboBoxInitializeType.Null, shopID);
            retailOrderIDTextBox1.ShopID      = shopID;
            CostumeCurrentShopTextBox1.ShopID = shopID;
        }
예제 #11
0
        private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                DataGridView view = (DataGridView)sender;
                switch (view.Rows[e.RowIndex].HeaderCell.Value)
                {
                case "充值":
                    RechargeClick();
                    break;

                case "收入":
                    SalesCountClick();
                    break;

                case "退货":
                    RefundCountClick();
                    break;
                }
            }
            catch (Exception ex)
            {
                CommonGlobalUtil.ShowError(ex);
            }
        }
 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 <PfCustomerBalanceRecord> list = (List <PfCustomerBalanceRecord>) this.dataGridView1.DataSource;
         PfCustomerBalanceRecord        item = (PfCustomerBalanceRecord)list[e.RowIndex];
         if (e.ColumnIndex == SourceOrderID.Index)
         {
             this.skinSplitContainer1.Panel2Collapsed = false;
             this.DetailClick?.Invoke(item, this,
                                      this.skinSplitContainer1.Panel2);
         }
     }
     catch (Exception ee)
     {
         CommonGlobalUtil.ShowError(ee);
     }
 }
예제 #13
0
 private void dataGridViewRuleExpression_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     try
     {
         DataGridView view = (DataGridView)sender;
         if (e.RowIndex > -1 && e.ColumnIndex > -1)
         {
             List <Rule> list = DataGridViewUtil.BindingListToList <Rule>(view.DataSource);//(List<ListItem<String>>)view.DataSource;
             switch (view.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
             {
             case "删除":
                 Rule selectedItem = (Rule)view.Rows[e.RowIndex].DataBoundItem;
                 view.DataSource = null;
                 list.Remove(selectedItem);
                 view.DataSource = DataGridViewUtil.ListToBindingList <Rule>(list);
                 UpdateRule(view);
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
     finally
     {
         GlobalUtil.UnLockPage(this);
     }
 }
예제 #14
0
 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 <DayReport> curDayReportListSource = (List <DayReport>) this.dataGridView1.DataSource;
         DayReport        item = curDayReportListSource[e.RowIndex];
         switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
         {
         case "明细":
             if (this.DetailClick != null)
             {
                 this.DetailClick(item, this);
             }
             break;
         }
     }
     catch (Exception ex)
     {
         CommonGlobalUtil.WriteLog(ex);
     }
 }
예제 #15
0
        private void DoExport()
        {
            try
            {
                List <DistributorCommissionRecord> list = (List <DistributorCommissionRecord>) this.dataGridView_RetailDetail.DataSource;;
                //System.Collections.SortedList columns = new System.Collections.SortedList();
                List <String> keys   = new List <string>();
                List <String> values = new List <string>();
                foreach (DataGridViewColumn item in dataGridView_RetailDetail.Columns)
                {
                    if (item.Visible)
                    {
                        //if (item.Name != "Column1" &&item.Name != "Column2" && item.Name != "Column3" && item.Name != "enabledDataGridViewCheckBoxColumn")
                        //{
                        keys.Add(item.DataPropertyName);
                        values.Add(item.HeaderText);
                        //}
                    }
                }



                NPOIHelper.Keys   = keys.ToArray();
                NPOIHelper.Values = values.ToArray();
                NPOIHelper.ExportExcel(DataGridViewUtil.ToDataTable(list), path);

                GlobalMessageBox.Show("导出完毕!");
            }
            catch (Exception ex)
            { ShowError(ex); }
            finally
            {
                UnLockPage();
            }
        }
예제 #16
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     try
     {
         if (e.RowIndex > -1 && e.ColumnIndex > -1)
         {
             if (e.ColumnIndex == Column1.Index)
             {
                 PfCustomerRetailDetail detail = this.PfCustomerRetailDetailList[e.RowIndex];
                 this.PfCustomerRetailDetailList.RemoveAt(e.RowIndex);
                 if (PfCustomerRetailDetailList != null && PfCustomerRetailDetailList.Count == 0)
                 {
                     // 删除判断是否整个清空了,如果清空了,则清空客户信息
                     lastAddCustomer = null;
                 }
                 dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(this.PfCustomerRetailDetailList));
             }
         }
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
예제 #17
0
        private void DoExport()
        {
            try
            {
                if (dataGridView1.DataSource != null && dataGridView1.Rows.Count > 0)
                {
                    List <CashRecord> list   = (List <CashRecord>) this.dataGridView1.DataSource;
                    List <String>     keys   = new List <string>();
                    List <String>     values = new List <string>();
                    foreach (DataGridViewColumn item in dataGridView1.Columns)
                    {
                        if (item.Visible)
                        {
                            keys.Add(item.DataPropertyName);
                            values.Add(item.HeaderText);
                        }
                    }



                    NPOIHelper.Keys   = keys.ToArray();
                    NPOIHelper.Values = values.ToArray();
                    NPOIHelper.ExportExcel(DataGridViewUtil.ToDataTable(list), path);

                    GlobalMessageBox.Show("导出完毕!");
                }
            }
            catch (Exception ex)
            { ShowError(ex); }
            finally
            {
                UnLockPage();
            }
        }
예제 #18
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
         {
             return;
         }
         if (e.RowIndex < 0 || e.ColumnIndex < 0)
         {
             return;
         }
         DataGridView view = sender as DataGridView;
         PfCustomer   item = view.Rows[e.RowIndex].DataBoundItem as PfCustomer;
         if (ColumnEdit.Index == e.ColumnIndex)
         {
             //修改
             Edit(item);
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
 }
        private void baseButton1_Click(object sender, EventArgs e)
        {
            string name = textBox1.Text.ToString();
            //if (name != "")
            //{
            GetDistributorsPara para = new GetDistributorsPara()
            {
                //StartTime=
                DistributorIDOrName = "",
                PageIndex           = 0,
                PageSize            = 20,
                StartTime           = new CJBasic.Date(this.dateTimePicker_Start.Value),
                EndTime             = new CJBasic.Date(this.dateTimePicker_End.Value),
            };
            InteractResult <DistributorCommissionPage> result = GlobalCache.ServerProxy.GetDistributors4Retail(para);

            if (result.ExeResult == ExeResult.Success)
            {
                if (result.Data != null)
                {
                    dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(result.Data.Distributors));
                }
            }
            else
            {
                ShowMessage(result.Msg);
            }

            //}
        }
예제 #20
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            try
            {
                // MessageBox.Show(string.Format("当前点中的是第{0}列,第{1}行", e.ColumnIndex, e.RowIndex));
                if (e.RowIndex > -1 && e.ColumnIndex > -1)
                {
                    List <GiftTicket> memberList = (List <GiftTicket>) this.dataGridView1.DataSource;

                    switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
                    {
                    case "选择优惠券":
                        if (!String.IsNullOrEmpty(memberList[e.RowIndex].ID))
                        {
                            ChooseGiftTicket(e.RowIndex);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
        }
        private void Delete(List <Brand> list, Brand item)
        {
            if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }

            if (GlobalUtil.EngineUnconnectioned(this))
            {
                return;
            }
            this.dataGridView1.DataSource = null;
            InteractResult result = GlobalCache.Brand_OnRemove(item.AutoID);

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

            default:
                this.dataGridView1.DataSource = null;
                list.Remove(item);
                this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
                break;
            }
            this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
        }
예제 #22
0
 private void Initialize()
 {
     if (this.curReplenishOrder == null)
     {
         return;
     }
     try
     {
         DataGridViewUtil.SetAlternatingColor(dataGridView1, Color.Gainsboro, Color.White);
         this.skinTextBox_OrderID.Text = "补货申请单号:" + this.curReplenishOrder.ID;
         this.skinLabel_ShopName.Text  = "店铺名称:" + GlobalCache.GetShopName(this.curReplenishOrder.ShopID);
         curReplenishDetailList        = GlobalCache.ServerProxy.GetReplenishDetail(this.curReplenishOrder.ID);
         foreach (var item in curReplenishDetailList)
         {
             Costume costume = CommonGlobalCache.GetCostume(item.CostumeID);
             if (costume != null)
             {
                 item.CostPrice = costume.CostPrice;
             }
         }
         this.BindingSource(curReplenishDetailList);
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
 }
예제 #23
0
        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 <PurchaseOrder> curReturnOrderListSource = (List<PurchaseOrder>)this.dataGridView1.DataSource;
                //PurchaseOrder item = curReturnOrderListSource[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.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2,true);

                //}
            }
            catch (Exception ex)
            {
                GlobalUtil.WriteLog(ex);
            }
        }
예제 #24
0
        public void ExportDatabase(GridView gridView, String file)
        {
            try
            {
                //implementar
                ConnectionDbf cdbf = new ConnectionDbf(file);

                var dt = cdbf.GetDataTable();

                var lista = DataGridViewUtil.ConvertToList <Produto>(dt);

                foreach (var item in lista)
                {
                    foreach (var c in COLUMNS)
                    {
                        //terminar
                    }
                    Console.WriteLine(item);
                }
            }
            catch (Exception ex)
            {
                XMessageIts.ExceptionMessage(ex);
            }

            //return Task.Run(()delegate);
        }
예제 #25
0
        private void dataGridView_RetailOrder_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                List <RetailOrder> source = DataGridViewUtil.BindingListToList <RetailOrder>(this.dataGridView_RetailOrder.DataSource);
                RetailOrder        item   = source[e.RowIndex];
                if (ColumnRemove.Index == e.ColumnIndex)
                {
                    //冲单
                    Cancel(item);
                }
                else if (ColumnRedo.Index == e.ColumnIndex)
                {
                    Redo(item);
                }
                else if (ColumnPrint.Index == e.ColumnIndex)
                {
                    if (isRefundOrder)
                    {
                        //打印
                        Print(item);
                    }
                    else
                    {
                        PrintRetail(item);
                    }
                }

                else if (Column1.Index == e.ColumnIndex)
                {
                    string fileName = string.Empty;
                    if (isRefundOrder)
                    {
                        fileName = "退货单";
                    }
                    else
                    {
                        fileName = "销售单";
                    }
                    path = CJBasic.Helpers.FileHelper.GetPathToSave("保存文件", fileName + item.ID + new Date(DateTime.Now).ToDateInteger() + ".xls", Environment.GetFolderPath(Environment.SpecialFolder.Personal));
                    if (String.IsNullOrEmpty(path))
                    {
                        return;
                    }
                    Export(item);
                }
            }
            catch (Exception ee)
            {
                CommonGlobalUtil.ShowError(ee);
            }
        }
예제 #26
0
 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 <InboundOrder> list = (List <InboundOrder>) this.dataGridView1.DataSource;
         InboundOrder        item = list[e.RowIndex];
         if (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].OwningColumn.DataPropertyName == iDDataGridViewTextBoxColumn1.DataPropertyName)
         {
             this.skinSplitContainer1.Panel2Collapsed = false;
             this.InboundDetailClick?.Invoke(item, this.skinSplitContainer1.Panel2);
         }
         if (sourceOrderIDDataGridViewTextBoxColumn1.Index == e.ColumnIndex)
         {
             this.skinSplitContainer1.Panel2Collapsed = false;
             this.SourceDetailClick?.Invoke(item.SourceOrderID, this, this.skinSplitContainer1.Panel2);
         }
     }
     catch (Exception ee)
     {
         CommonGlobalUtil.ShowError(ee);
     }
 }
예제 #27
0
        private void DoExport()
        {
            try
            {
                if (dataGridView1.DataSource != null && dataGridView1.Rows.Count > 0)
                {
                    List <PfRetailAnalysisInfo>   list    = DataGridViewUtil.BindingListToList <PfRetailAnalysisInfo>(dataGridView1.DataSource);
                    System.Collections.SortedList columns = new System.Collections.SortedList();
                    List <String> keys   = new List <string>();
                    List <String> values = new List <string>();
                    foreach (DataGridViewColumn item in dataGridView1.Columns)
                    {
                        if (item.Visible)
                        {
                            keys.Add(item.DataPropertyName);
                            values.Add(item.HeaderText);
                        }
                    }



                    NPOIHelper.Keys   = keys.ToArray();
                    NPOIHelper.Values = values.ToArray();
                    NPOIHelper.ExportExcel(DataGridViewUtil.ToDataTable(list), path);

                    GlobalMessageBox.Show("导出完毕!");
                }
            }
            catch (Exception ex)
            { ShowError(ex); }
            finally
            {
                UnLockPage();
            }
        }
예제 #28
0
 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 <PurchaseOrder> curPurchaseOrderListSource = (List <PurchaseOrder>) this.dataGridView1.DataSource;
         PurchaseOrder        item = curPurchaseOrderListSource[e.RowIndex];
         switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].OwningColumn.HeaderText)
         {
         case "采购进货单明细":
             if (this.DetailClick != null)
             {
                 this.skinSplitContainer1.Panel2Collapsed = false;
                 this.DetailClick(item, this.skinSplitContainer1.Panel2);
             }
             break;
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.WriteLog(ex);
     }
 }
예제 #29
0
        private void DoExport()
        {
            try
            {
                if (DataGridView == null)
                {
                    ShowMessage("请设置FileName属性!");
                    return;
                }
                List <T>      list   = DataGridView.DataSource as List <T>;
                List <String> keys   = new List <string>();
                List <String> values = new List <string>();
                foreach (DataGridViewColumn item in DataGridView.Columns)
                {
                    if (item.Visible)
                    {
                        keys.Add(item.DataPropertyName);
                        values.Add(item.HeaderText);
                    }
                }

                NPOIHelper.Keys   = keys.ToArray();
                NPOIHelper.Values = values.ToArray();//new System.Collections.SortedList();
                NPOIHelper.ExportExcel(DataGridViewUtil.ToDataTable(list), path);
                ShowMessage("导出完毕!");
            }
            catch (Exception ex)
            { ShowError(ex); }
            finally
            {
                UnLockPage();
            }
        }
예제 #30
0
        /*private void BindingSource(List<PfCustomerStore> listPage)
         * {
         *  if (this.InvokeRequired)
         *  {
         *      this.BeginInvoke(new CbGeneric<List<PfCustomerStore>>(this.BindingSource), listPage);
         *  }
         *  else
         *  {
         *      if (listPage != null)
         *      {
         *          //foreach (var item in listPage)
         *          //{
         *          //  //  item.CostumeName = CommonGlobalCache.GetCostumeName(item.CostumeID);
         *          //    item.ShopName = CommonGlobalCache.GetShopName(item.ShopID);
         *          //}
         *      }
         *
         *      dataGridViewPagingSumCtrl.BindingDataSource<PfCustomerStore>(DataGridViewUtil.ListToBindingList(listPage));
         *      CompleteProgressForm();
         *  }
         * }*/


        private void BindingSource(List <PfCustomerStore> listPage)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new CbGeneric <List <PfCustomerStore> >(this.BindingSource), listPage);
            }
            else
            {
                if (listPage != null)
                {
                    //foreach (var item in listPage)
                    //{
                    //    item.ShopName = CommonGlobalCache.GetShopName(item.ShopID);
                    //}
                }
                if (costumeTextBox1.Text != "")
                {
                    dataGridViewPagingSumCtrl.AppendNotShowInColumnSettings(Column2);
                }
                else
                {
                    dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(Column2);
                }
                dataGridViewPagingSumCtrl.BindingDataSource <PfCustomerStore>(DataGridViewUtil.ListToBindingList(listPage));
                CompleteProgressForm();
            }
        }