using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using BO.Utils; using BO.Utils.BillRpc; using BWP.WinFormControl; using Distribution.LocalBo; namespace Distribution { public partial class DistributionForm : Form,IAfterLogin { public string RoleName { get { return "配货员"; } } public Form Generate() { return this; } private bool mIsCustomerSynced, mIsDeliverGoodsLineSynced; private BackgroundWorker mBackgroundWorkerSyncBaseInfo; private BindingList mSaleOutStoreList; public DistributionForm() { InitializeComponent(); dataGridViewSaleOutStore.AutoGenerateColumns = false; dataGridViewDingHuo.AutoGenerateColumns = false; dataGridViewFaHuo.AutoGenerateColumns = false; cbxSelectCustomer.Init(x => CustomerRpc.SyncListForDropDown(x,!mIsCustomerSynced)); cbxSelectXianLu.Init(x => DeliverGoodsLineRpc.SyncListForDropDown(x,!mIsDeliverGoodsLineSynced)); mBackgroundWorkerSyncBaseInfo =new BackgroundWorker(); mBackgroundWorkerSyncBaseInfo.DoWork += backgroundWorkerSyncBaseInfo_DoWork; mBackgroundWorkerSyncBaseInfo.RunWorkerCompleted += backgroundWorkerSyncBaseInfo_RunWorkerCompleted; mBackgroundWorkerSyncBaseInfo.RunWorkerAsync(); } private void backgroundWorkerSyncBaseInfo_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { mIsCustomerSynced = true; mIsDeliverGoodsLineSynced = true; } private void backgroundWorkerSyncBaseInfo_DoWork(object sender, DoWorkEventArgs e) { CustomerRpc.SyncList(); DeliverGoodsLineRpc.SyncList(); } private void DistributionForm_Load(object sender, EventArgs e) { } private void btnSearch_Click(object sender, EventArgs e) { } } }