private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { try { if (e.RowIndex > -1 && e.ColumnIndex > -1) { if (e.Value == null) { return; } DataGridView view = sender as DataGridView; GiftTicket tickets = view.Rows[e.RowIndex].DataBoundItem as GiftTicket; //if (e.ColumnIndex == effectDateDataGridViewTextBoxColumn.Index) //{ // if (tickets.EffectDate == SystemDefault.DateTimeNull) // { // e.Value = null; // } //} //else if (e.ColumnIndex == expiredDateDataGridViewTextBoxColumn.Index) //{ // if (tickets.ExpiredDate == SystemDefault.DateTimeNull) // { // e.Value = null; // } //} //else if (e.ColumnIndex == Denomination.Index || e.ColumnIndex == denominationDataGridViewTextBoxColumn.Index) { if (String.IsNullOrEmpty(tickets?.ID)) { e.Value = null; } } } } catch (Exception ee) { GlobalUtil.ShowError(ee); } }
//绑定数据源 private void BindingDataSource() { try { this.dataGridView1.DataSource = null; List <GiftTicket> temp = new List <GiftTicket>(); int tempDenomination = 0; if (this.GiftTicketList != null && this.GiftTicketList.Count != 0) { //根据面额大小择优排序 for (int i = 0; i < GiftTicketList.Count - 1; ++i) { tempDenomination = i; for (int j = i + 1; j < GiftTicketList.Count; ++j) { if (GiftTicketList[j].Denomination > GiftTicketList[tempDenomination].Denomination) { tempDenomination = j; } } GiftTicket t = GiftTicketList[tempDenomination]; GiftTicketList[tempDenomination] = GiftTicketList[i]; GiftTicketList[i] = t; // Console.WriteLine("{0}",list[i]); } temp.AddRange(GiftTicketList); } //foreach (var item in AllRetailDetailList) //{ // if (!MatchRetails.Contains(item)) // { // temp.Add(new GiftTicket() { CostumeID = item.CostumeID, EffectDate = SystemDefault.DateTimeNull, ExpiredDate = SystemDefault.DateTimeNull }); // } //} this.dataGridView1.DataSource = temp; } catch (Exception ee) { GlobalUtil.ShowError(ee); } }
private void Initialize() { try { ResetAll(false); skinComboBox_PfCustomer.Initialize(true, true); //默认选择总仓 skinComboBoxShopID.Initialize(true); GeneralStoreShopID = GlobalCache.GeneralStoreShopID; this.skinComboBoxShopID.SelectedValue = GeneralStoreShopID; LoadOrder(order); DataGridViewUtil.SetAlternatingColor(dataGridView1, Color.Gainsboro, Color.White); balanceRound = GlobalCache.GetParameter(ParameterConfigKey.PfPriceRound).ParaValue == "1"; } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void baseButton1_Click(object sender, EventArgs e) { EmOrderExportConfigSetForm AddBrand = new EmOrderExportConfigSetForm(); try { if (AddBrand.ShowDialog(this) == DialogResult.OK) { this.RefreshPage(); } } catch (Exception ex) { GlobalUtil.ShowError(ex); } finally { GlobalUtil.UnLockPage(this); } }
private void UpdateShopPriceAndSalePriceForm_Load(object sender, EventArgs e) { try { this.dataGridViewRole.AutoGenerateColumns = false; List <Shop> shopList = GlobalCache.ServerProxy.GetShopList().FindAll(t => t.Enabled == true); foreach (Shop shopItem in shopList) { if (curItem.ShopId == shopItem.ID) { shopItem.Selected = true; } } dataGridViewRole.DataSource = shopList; } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void BaseButton_Search_Click(object sender, EventArgs e) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } List <EmExpressCompany> listPage = GlobalCache.EMallServerProxy.GetAllEmExpressCompany(); this.BindingDataSource(listPage); } catch (Exception ex) { GlobalUtil.ShowError(ex); } finally { GlobalUtil.UnLockPage(this); } }
private void Initialize() { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } List <EmRetailDetail> listPage = GlobalCache.EMallServerProxy.GetEmRetailDetail(this.Order.ID); this.BindingDataSource(listPage); } catch (Exception ex) { GlobalUtil.ShowError(ex); } finally { GlobalUtil.UnLockPage(this); } }
public void Search(SupplierAccountRecordSummaryPara para) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } InteractResult <List <SupplierAccountRecordSummaryInfo> > listPage = GlobalCache.ServerProxy.GetSupplierAccountRecordSummary(this.pagePara); this.BindingSource(listPage.Data); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
public void Search(PfAccountContrastPara para) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } InteractResult <PfAccountContrastItem> listPage = GlobalCache.ServerProxy.GetPfAccountContrast(this.pagePara); this.BindingSource(listPage?.Data); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
private void dataGridView1_CellClick(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 "编辑": PfCustomerStore store = this.dataGridView1.Rows[e.RowIndex].DataBoundItem as PfCustomerStore; WholesaleBeginningSaveCostumeForm form = new WholesaleBeginningSaveCostumeForm(store); if (form.ShowDialog() == DialogResult.OK) { this.BaseButton_Search_Click(null, null); } break; case "删除": DialogResult dialogResult = GlobalMessageBox.Show("确定删除该行数据吗?", "提示", MessageBoxButtons.OKCancel); if (dialogResult != DialogResult.OK) { return; } //GlobalCache.ServerProxy.HideCreatePfStore() this.curInboundDetailList.RemoveAt(e.RowIndex); this.BindingInboundDetailSource(); break; } } catch (Exception ee) { GlobalUtil.ShowError(ee); } }
private void baseButtonImport_Click(object sender, EventArgs e) { path = CJBasic.Helpers.FileHelper.GetFileToOpen("请选择导入文件"); if (String.IsNullOrEmpty(path)) { return; } string fileExt = Path.GetExtension(path); if (fileExt != ".xlsx" && fileExt != ".xls") { ShowMessage("你所选择文件格式不正确,请重新上传文件!"); return; } if (GlobalMessageBox.Show("是否开始导入" + System.IO.Path.GetFileName(path), "友情提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { path = null; return; } /* if (NPOIHelper.IsFileInUse(path)) * { * ShowMessage("你所选择文件已被打开,请关闭后再重新导入!"); * return; * }*/ try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.DoImport); cb.BeginInvoke(null, null); } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } try { switch (this.dataGridView2.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) { case "删除": this.curReplenishDetailList.RemoveAt(e.RowIndex); this.BindingReplenishDetailSource(); break; } } catch (Exception ee) { GlobalUtil.ShowError(ee); } }
private void LoadConfig() { try { config = BalanceFormConfiguration.Load(CONFIG_PATH) as BalanceFormConfiguration; } catch (Exception ex) { GlobalUtil.WriteLog(ex); } if (config != null) { this.skinCheckBoxPrint.Checked = config.PrintTicket; } else { config = new BalanceFormConfiguration() { }; } }
private List <PfCustomerStore> curInboundDetailList = new List <PfCustomerStore>();//当前要入库的CostumeStore private void BindingInboundDetailSource() { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } dataGridViewPagingSumCtrl.BindingDataSource <PfCustomerStore>(DataGridViewUtil.ListToBindingList(this.curInboundDetailList)); dataGridViewPagingSumCtrl.ScrollToEnd(); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
private void BaseButton_Search_Click(object sender, EventArgs e) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } List <Supplier> listPage = GlobalCache.ServerProxy.GetSupplierList(); this.BindingSource(listPage); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
private void EmCostumeManageCtrl_Load(object sender, EventArgs e) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } skinLabelResult.Text = string.Empty; //异步调用 CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.GetInfo); cb.BeginInvoke(null, null); } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (!DataGridViewUtil.CheckPerrmisson(this, sender, e)) { return; } try { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } if (e.RowIndex >= 0 && e.RowIndex != -1 && !dataGridView1.Rows[e.RowIndex].IsNewRow) { DataGridView view = (DataGridView)sender; List <EmCarriageCostTemplate> list = (List <EmCarriageCostTemplate>)view.DataSource; EmCarriageCostTemplate item = (EmCarriageCostTemplate)list[e.RowIndex]; switch (view.Rows[e.RowIndex].Cells[e.ColumnIndex].OwningColumn.HeaderText) { case "编辑": this.OpenModifyDialog(item, this); break; case "删除": RemoveTemplate(item.AutoID); // UpdateEmShowOnlineIsFalse(item); break; default: break; } } } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (!DataGridViewUtil.CheckPerrmisson(this, sender, e)) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } try { List <DistributorWithdrawRecord> curScrapOrderListSource = (List <DistributorWithdrawRecord>) this.dataGridView1.DataSource; DistributorWithdrawRecord item = curScrapOrderListSource[e.RowIndex]; if (ColumnPay.Index == e.ColumnIndex) { PaymentCashForm payform = new PaymentCashForm(item); if (payform.ShowDialog(this) == DialogResult.OK) { Payment(item); } // payform.ConfirmClick += Payment(item); // Payment(item); //this.skinSplitContainer1.Panel2Collapsed = false; //this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2, false); } else if (ColumnCancel.Index == e.ColumnIndex) { Cancel(item); } } catch (Exception ex) { GlobalUtil.WriteLog(ex); } }
public void SearchDetailList(GetShopPriceRangeReportPara para) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } List <PriceRangeReport> listPage = GlobalCache.ServerProxy.GetShopPriceRangeReport(para); this.BindingDataSource(listPage); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
public void Search(PurchasePayManagePara para) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } InteractResult <SupplierAccountRecordPage> listPage = GlobalCache.ServerProxy.PurchasePayManage(this.pagePara); dataGridViewPagingSumCtrl.OrderPara = pagePara; this.dataGridViewPagingSumCtrl.Initialize(listPage.Data); this.BindingSource(listPage.Data); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
public void Search(GetPfAccountRecordPagePara para) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } PfAccountRecordPage listPage = GlobalCache.ServerProxy.GetPfAccountRecordPage(this.pagePara); dataGridViewPagingSumCtrl.OrderPara = pagePara; this.dataGridViewPagingSumCtrl.Initialize(listPage); this.BindingSource(listPage); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
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 Initialize() { try { string jsonText = File.ReadAllText(@"CitySelectForm.dat"); resultList = (List <Zone>)JavaScriptConvert.DeserializeObject(jsonText, typeof(List <Zone>)); List <Province> provinces = new List <Province>(); foreach (var zone in resultList) { provinces.AddRange(zone.Province); } skinComboBoxProvince.DisplayMember = "Name"; skinComboBoxProvince.ValueMember = "Name"; skinComboBoxProvince.DataSource = provinces; SetDeliveryTime(); } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void BaseButton_Search_Click(object sender, EventArgs e) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } string orderID = string.IsNullOrEmpty(this.skinTextBox_OrderID.SkinTxt.Text) ? null : this.skinTextBox_OrderID.SkinTxt.Text; this.pagePara = new ReturnOrderPagePara() { ReturnOrderID = orderID, IsOpenDate = true, StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value), EndDate = new CJBasic.Date(this.dateTimePicker_End.Value), PageIndex = 0, PageSize = this.dataGridViewPagingSumCtrl.PageSize, SupplierID = ValidateUtil.CheckEmptyValue(this.skinComboBoxSupplierID.SelectedValue), CostumeID = ValidateUtil.CheckEmptyValue(skinTextBox_costumeID.SkinTxt.Text), PurchaseOrderState = (PurchaseOrderState)rtType.SelectedValue, PurchaseOrderStateEnum = (PurchaseOrderStateEnum)skinComboBox_State.SelectedValue, DestShopID = ValidateUtil.CheckEmptyValue(skinComboBoxShopID.SelectedValue), Remarks = ValidateUtil.CheckEmptyValue(this.txtRemark.SkinTxt.Text), }; dataGridViewPagingSumCtrl.OrderPara = pagePara; ReturnOrderPage listPage = GlobalCache.ServerProxy.GetReturnOrderPage(this.pagePara); dataGridViewPagingSumCtrl.OrderPara = pagePara; this.dataGridViewPagingSumCtrl.Initialize(listPage); this.BindingReturnOrderSource(listPage); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
public UpdateShopCostumePriceCtrl() { InitializeComponent(); MenuPermission = RolePermissionMenuEnum.价格管理; dataGridViewPagingSumCtrl2 = new DataGridViewPagingSumCtrl(this.dataGridView2); dataGridViewPagingSumCtrl2.Initialize(); this.dataGridViewPagingSumCtrl = new DataGridViewPagingSumCtrl(this.dataGridView1, new string[] { }); this.dataGridView1.AutoGenerateColumns = false; dataGridViewPagingSumCtrl.Initialize(); this.dataGridView1.AutoGenerateColumns = false; dataGridViewPagingSumCtrl.ColumnSorting = dataGridViewPagingSumCtrl_ColumnSorting; GlobalUtil.SetShop(skinComboBoxShopID, false); skinComboBoxShopID.SelectedValue = GlobalCache.GeneralStoreShopID; // CommonGlobalUtil.SetBigClass(skinComboBoxBigClass); GlobalUtil.SetBrand(this.skinComboBox_Brand); }
private void baseButtonEnd_Click(object sender, EventArgs e) { try { if (GlobalMessageBox.Show("期初客户库存只能录入一次,确定录入完毕?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } TabPageClose(this.CurrentTabPage, this.SourceCtrlType); GlobalUtil.SaveParameters(ParameterConfigKey.IsHideCreatePfStore, "1"); End?.Invoke(this); } catch (Exception ex) { GlobalUtil.ShowError(ex); } finally { GlobalUtil.UnLockPage(this); } }
private void baseButtonSave_Click(object sender, EventArgs e) { try { if (pfCustomer == null) { GlobalMessageBox.Show("客户不存在,请重新选择!"); skinComboBox_PfCustomer.Focus(); return; } if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } CreatePfCostumeStore cPfCostumeStore = new CreatePfCostumeStore(); InteractResult result = GlobalCache.ServerProxy.InsertPfCostumeStores(cPfCostumeStore); switch (result.ExeResult) { case ExeResult.Success: GlobalMessageBox.Show("保存成功!"); //baseButton3.Enabled = false; //baseButtonEnd.Visible = false; break; case ExeResult.Error: GlobalMessageBox.Show(result.Msg); break; default: break; } } catch (Exception ex) { GlobalUtil.ShowError(ex); } finally { GlobalUtil.UnLockPage(this); } }
private void Search(Object sender, EventArgs args) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } CostumeRetailAnalysisPage listPage = GlobalCache.ServerProxy.GetCostumeRetailAnalysisPage(para); this.BindingDataSource(listPage); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
private void Cancel(DistributorWithdrawRecord item) { try { if (GlobalMessageBox.Show("确定取消提现申请吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } if (GlobalUtil.EngineUnconnectioned(this)) { return; } InteractResult result = GlobalCache.ServerProxy.CancelDistributorWithdrawRecord(item.AutoID); switch (result.ExeResult) { case ExeResult.Success: GlobalMessageBox.Show("取消成功!"); RefreshPage(); break; case ExeResult.Error: GlobalMessageBox.Show(result.Msg); break; default: break; } } catch (Exception ex) { GlobalUtil.ShowError(ex); } finally { GlobalUtil.UnLockPage(this); } }
private void Initialize() { try { if (ValidatedTickets != null && ValidatedTickets.Count > 0) { this.GiftTicketList = new List <GiftTicket>(); this.MatchRetails = new List <RetailDetail>(); if (matches != null) { foreach (var item in matches) { if (item.Ticket == null) { GiftTicketList.Add(new GiftTicket() { CostumeID = item.Retail.CostumeID, EffectDate = SystemDefault.DateTimeNull, ExpiredDate = SystemDefault.DateTimeNull }); } else { GiftTicketList.Add(item.Ticket); } MatchRetails.Add(item.Retail); //this.MatchRetails = matchRetails; } } effectDateDataGridViewTextBoxColumn.DefaultCellStyle.Format = DateTimeUtil.DEFAULT_DATE_FORMAT; expiredDateDataGridViewTextBoxColumn.DefaultCellStyle.Format = DateTimeUtil.DEFAULT_DATE_FORMAT; this.BindingDataSource(); } } catch (Exception ee) { GlobalUtil.ShowError(ee); } }