Пример #1
0
        private void Delete(Shop item)
        {
            if (item != null)
            {
                if (GlobalMessageBox.Show("删除后将查无店铺信息,确定删除吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    List <Shop>    list   = DataGridViewUtil.BindingListToList <Shop>(dataGridView1.DataSource);
                    InteractResult result = GlobalCache.ServerProxy.DeleteShop(item.ID);

                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalMessageBox.Show("删除成功!");
                        GlobalCache.RemoveShop(item.ID);
                        this.dataGridView1.DataSource = null;
                        list.Remove(item);
                        this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
                        break;

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

                    default:
                        break;
                    }
                }
            }
        }
Пример #2
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);
 }
Пример #3
0
 /// <summary>
 /// 绑定选定款号对应的CostumeStore集合
 /// </summary>
 private void BindingSelectedCostumeStoreSource()
 {
     if (this.InvokeRequired)
     {
         this.BeginInvoke(new CbGeneric(this.BindingSelectedCostumeStoreSource));
     }
     else
     {
         this.dataGridViewPagingSumCtrl.SetDataSource <CostumeStore>(DataGridViewUtil.ListToBindingList(curSelectedCostumeStoreList));
         foreach (DataGridViewRow row in dataGridView1.Rows)
         {
             if (row.Index % 2 == 0)
             {
                 row.ReadOnly         = true;
                 row.HeaderCell.Value = "客户库存";
             }
             else
             {
                 row.ReadOnly         = false;
                 row.HeaderCell.Value = "退货";
             }
         }
         // cell获取焦点
         dataGridViewPagingSumCtrl.AutoFocusToWritableCell();
     }
 }
Пример #4
0
        private void UpdateData(List <ListItem <string> > list)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                ParameterConfig config = SetUpConfig(list);
                UpdateResult    result = GlobalCache.ServerProxy.UpdateParameterConfig(config);
                switch (result)
                {
                case UpdateResult.Error:
                    GlobalMessageBox.Show("内部错误!");
                    break;

                default:
                    UpdateCache(config);
                    this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
                    this.skinTextBoxName.Text     = "";
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally {
                GlobalUtil.UnLockPage(this);
            }
        }
Пример #5
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;
        }
Пример #6
0
        private void skinComboBoxShopID_SelectedIndexChanged(object sender, EventArgs e)
        {
            string supplierId = ValidateUtil.CheckEmptyValue(skinComboBox_PfCustomer.SelectedValue);

            if (!String.IsNullOrEmpty(selectedSupplierID) && selectedSupplierID != supplierId && curInboundDetailList != null && curInboundDetailList.Count > 0)
            {
                List <PfOrderDetail> pfDetails = new List <PfOrderDetail>();
                foreach (var item in curInboundDetailList)
                {
                    item.CustomerID   = supplierId;
                    item.CustomerName = pfCustomer.Name;

                    Costume citem = GlobalCache.GetCostume(item.CostumeID);
                    item.PfPrice =
                        citem.Price == 0 ? 0 : Math.Round(citem.Price * pfCustomer.PfDiscount * (decimal)0.01, 2, MidpointRounding.AwayFromZero);
                    pfDetails.Add(item);
                }
                this.curInboundDetailList.Clear();
                this.curInboundDetailList = pfDetails;
                dataGridViewPagingSumCtrl2.BindingDataSource <PfOrderDetail>(DataGridViewUtil.ListToBindingList(this.curInboundDetailList));
                // dataGridViewPagingSumCtrl3.BindingDataSource<PfOrderDetail>(DataGridViewUtil.ListToBindingList(this.curInboundDetailList));
                dataGridViewPagingSumCtrl2.ScrollToEnd();


                /*  GlobalMessageBox.Show("请选择相同的客户!");
                 * skinComboBox_PfCustomer.SelectedValue = selectedSupplierID;
                 * return;*/
            }
            selectedSupplierID = supplierId;
            //   this.costumeFromSupplierTextBox1.SupplierID = supplierId;
        }
Пример #7
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("添加失败!");
            }
        }
Пример #8
0
        /// <summary>
        /// 绑定要补货的集合源
        /// </summary>
        private void BindingInboundDetailSource()
        {
            if (this.curDetailList != null && this.curDetailList.Count > 0)
            {
                foreach (BoundDetail detail in this.curDetailList)
                {
                    detail.CostumeName = CommonGlobalCache.GetCostumeName(detail.CostumeID);
                    Costume cItem = CommonGlobalCache.GetCostume(detail.CostumeID);
                    detail.Year   = cItem.Year;
                    detail.Season = cItem.Season;
                    if (detail.Comment == null)
                    {
                        detail.Comment = "";
                    }
                }


                /*    CostumeStore destShopStore = item?.CostumeStoreList?.Find(t => t.CostumeID == store.CostumeID && t.ColorName == store.ColorName );
                 *  if (destShopStore != null)
                 *  {
                 *      //取收货方的吊牌价售价
                 *      store.Price = destShopStore.Price;
                 *      store.SalePrice = destShopStore.SalePrice;
                 *  }
                 */
                //  this.dataGridView2.DataSource = this.curDetailList;
            }


            dataGridViewPagingSumCtrl2.BindingDataSource <BoundDetail>(DataGridViewUtil.ListToBindingList(this.curDetailList));
            dataGridViewPagingSumCtrl2.ScrollToEnd();
        }
Пример #9
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 (CommonGlobalUtil.ConvertToString(this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) == "删除")
             {
                 DialogResult dialogResult = GlobalMessageBox.Show("确定删除该条数据?", "提示", MessageBoxButtons.OKCancel);
                 if (dialogResult != DialogResult.OK)
                 {
                     return;
                 }
                 RetailDetail detail = this.retailDetailList[e.RowIndex];
                 this.retailDetailList.RemoveAt(e.RowIndex);
                 dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(this.retailDetailList));
             }
             if (e.ColumnIndex == GuideName.Index)
             {
                 RetailDetail detail = this.retailDetailList[e.RowIndex];
                 // detail.GuideID = this.retailDetailList[e.ColumnIndex];
                 detail.GuideID = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
                 //detail.GuideName = CommonGlobalCache.GetUserName(detail.GuideID);
             }
         }
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
Пример #10
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);
     }
 }
        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);
        }
        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);
            }

            //}
        }
Пример #13
0
        /// <summary>
        /// 绑定选定款号对应的CostumeStore集合
        /// </summary>
        private void BindingSelectedCostumeStoreSource()
        {
            if (this.curSelectedCostumeStoreList != null && this.curSelectedCostumeStoreList.Count > 0)
            {
                List <CostumeStore> tempList = new List <CostumeStore>();
                foreach (CostumeStore store in this.curSelectedCostumeStoreList)
                {
                    store.Title = "店铺库存";
                    CostumeStore tempStore = this.BuildCostumeStore4NeedReplenish(store);
                    tempList.Add(store);
                    tempList.Add(tempStore);
                }
                this.curSelectedCostumeStoreList = tempList;
            }
            this.dataGridViewPagingSumCtrl.SetDataSource <CostumeStore>(DataGridViewUtil.ListToBindingList(this.curSelectedCostumeStoreList));
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Index % 2 == 0)
                {
                    row.ReadOnly         = true;
                    row.HeaderCell.Value = "店铺库存";
                }
                else
                {
                    row.ReadOnly         = false;
                    row.HeaderCell.Value = "发货";
                }
            }

            // cell获取焦点
            dataGridViewPagingSumCtrl.AutoFocusToWritableCell();
        }
Пример #14
0
        private void Search()
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                List <GiftTicketTemplate> list = GlobalCache.ServerProxy.GetGiftTicketTemplates();

                foreach (var item in list)
                {
                    item.OperatorUserName = GlobalCache.GetUserName(item.OperatorUserID);
                }
                dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(list));
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Пример #15
0
        private void BindingReturnOrderSource(RetailSummary listPage)
        {
            // this.dataGridViewPagingSumCtrl.BindingDataSource(listPage?.RetailSummaryInfos);

            dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(listPage?.RetailSummaryInfos));
            this.skinSplitContainer1.Panel2Collapsed = true;
        }
Пример #16
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);
     }
 }
Пример #17
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();
            }
        }
Пример #18
0
 private void BindingDataSource()
 {
     if (this.rechargeRecordList != null && this.rechargeRecordList.Count > 0)
     {
         this.SetGuideName();//绑定源前先将GuideName字段赋值,用于显示
     }
     dataGridViewPagingSumCtrl.BindingDataSource <RechargeRecord>(DataGridViewUtil.ListToBindingList(this.rechargeRecordList));
 }
Пример #19
0
 private void Initialize()
 {
     this.skinTextBoxName.SkinTxt.Text      = string.Empty;
     this.dataGridView1.AutoGenerateColumns = false;
     this.dataGridView1.DataSource          = null;
     list = GlobalCache.CostumeColorList;
     this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
 }
Пример #20
0
        private void baseButton1_Click(object sender, EventArgs e)
        {
            string idName            = this.skinTextBoxName.SkinTxt.Text;
            List <CostumeColor> list = GlobalCache.ServerProxy.GetCostumeColor4IDOrName(idName);

            dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(list));
            dataGridView1.Refresh();
        }
Пример #21
0
        private void BaseButtonQuery_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                String queryStr = this.skinTextBoxName.SkinTxt.Text.Trim();
                if (condition.SelectedValue == null)
                {
                    dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(EnabledLink, ColumnDisable, ColumnDelete);
                }
                else if (Convert.ToBoolean(condition.SelectedValue))
                {
                    dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(ColumnDisable);
                    dataGridViewPagingSumCtrl.AppendNotShowInColumnSettings(EnabledLink, ColumnDelete);
                }
                else
                {
                    dataGridViewPagingSumCtrl.AppendNotShowInColumnSettings(ColumnDisable);
                    dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(EnabledLink, ColumnDelete);
                }
                bool        state = true;
                List <Shop> shops = null;
                if (condition.SelectedValue != null)
                {
                    state = Convert.ToBoolean(condition.SelectedValue);
                    shops = GlobalCache.ShopList.FindAll(t =>
                                                         // (t.ID.Contains(queryStr) || t.Name.Contains(queryStr)) && condition.SelectedValue == null ? true : (Convert.ToBoolean(condition.SelectedValue) ? t.Enabled : !t.Enabled));
                                                         (t.ID.Contains(queryStr) || t.Name.Contains(queryStr)) && t.Enabled == state);
                }
                else
                {
                    shops = GlobalCache.ShopList.FindAll(t =>
                                                         // (t.ID.Contains(queryStr) || t.Name.Contains(queryStr)) && condition.SelectedValue == null ? true : (Convert.ToBoolean(condition.SelectedValue) ? t.Enabled : !t.Enabled));
                                                         (t.ID.Contains(queryStr) || t.Name.Contains(queryStr)));
                }
                //else
                //{
                //   // state = Convert.ToBoolean(condition.SelectedValue);
                //}



                dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(shops));
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Пример #22
0
 private void BindingSource(List <PfCustomer> listPage)
 {
     this.dataGridView1.DataSource = null;
     if (listPage != null)
     {
         dataGridViewPagingSumCtrl.BindingDataSource <PfCustomer>(DataGridViewUtil.ListToBindingList(listPage), new String[] { paymentBalanceDataGridViewTextBoxColumn.DataPropertyName }, listPage.Count, null, null, false);
         // this.dataGridView1.DataSource = listPage;
     }
     this.dataGridView1.Refresh();
 }
Пример #23
0
        private void baseButton1_Click(object sender, EventArgs e)
        {
            string name = textBox1.Text.ToString();
            //if (name != "")
            //{
            List <Brand> list = GlobalCache.ServerProxy.GetBrands4IdOrName(name);

            dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(list));
            //}
        }
Пример #24
0
 /// <summary>
 /// 绑定要报损的集合源
 /// </summary>
 private void BindingOutboundDetailSource()
 {
     if (this.curOutboundDetailList != null && this.curOutboundDetailList.Count > 0)
     {
         foreach (BoundDetail detail in this.curOutboundDetailList)
         {
             detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID);
         }
     }
     dataGridViewPagingSumCtrl2.BindingDataSource <BoundDetail>(DataGridViewUtil.ListToBindingList(this.curOutboundDetailList));
 }
Пример #25
0
        private void BindingSource(List <Supplier> listPage)
        {
            this.dataGridView1.DataSource = null;
            List <Supplier> Supplierlist = listPage.FindAll(t => t.Enabled);

            if (Supplierlist != null)
            {
                dataGridViewPagingSumCtrl.BindingDataSource <Supplier>(DataGridViewUtil.ListToBindingList(Supplierlist), new String[] { paymentBalanceDataGridViewTextBoxColumn.DataPropertyName }, listPage.Count, null, null, false);
            }
            this.dataGridView1.Refresh();
        }
Пример #26
0
        //  public event CJBasic.Action<Supplier, BaseUserControl> SaveClick;

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            try
            {
                if (e.RowIndex > -1 && e.ColumnIndex > -1)
                {
                    if (GlobalUtil.EngineUnconnectioned(this))
                    {
                        return;
                    }
                    List <Supplier> list = DataGridViewUtil.BindingListToList <Supplier>(dataGridView1.DataSource);
                    Supplier        item = (Supplier)list[e.RowIndex];
                    if (e.ColumnIndex == Column1.Index)
                    {
                        this.SaveClick(item, this);
                    }
                    else if (e.ColumnIndex == Column2.Index)
                    {
                        if (GlobalMessageBox.Show("删除之后将查不到该供应商的往来账,确定删除吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            InteractResult result = GlobalCache.Supllier_OnRemove(item.ID);
                            switch (result.ExeResult)
                            {
                            case ExeResult.Success:
                                GlobalMessageBox.Show("删除成功!");
                                this.dataGridView1.DataSource = null;
                                list.Remove(item);
                                this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
                                break;

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

                            default:
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Пример #27
0
 private void BindingSource(List <BoundDetail> list)
 {
     this.dataGridView2.DataSource = null;
     if (list != null && list.Count > 0)
     {
         foreach (BoundDetail detail in list)
         {
             detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID);
         }
         this.dataGridView2.DataSource = DataGridViewUtil.ListToBindingList(list);
     }
 }
Пример #28
0
        private void BindingOutboundDetailSource(List <BoundDetail> list)
        {
            if (list != null && list.Count > 0)
            {
                foreach (BoundDetail detail in list)
                {
                    detail.CostumeName = CommonGlobalCache.GetCostumeName(detail.CostumeID);
                }
            }

            dataGridViewPagingSumCtrl2.BindingDataSource <BoundDetail>(DataGridViewUtil.ListToBindingList(list));
        }
Пример #29
0
        public RefundDirectCtrl(RetailOrder order)
        {
            InitializeComponent();
            Init();
            this.order = order;

            if (!HasPermission(RolePermissionMenuEnum.销售退货单查询, RolePermissionEnum.重做_单据时间))
            {
                dateTimePicker_Start.Enabled = false;
            }

            List <RetailDetail> details = CommonGlobalCache.ServerProxy.GetRetailDetailList(order.ID);

            if (!String.IsNullOrEmpty(order.MemeberID))
            {
                memberIDTextBox2.Text = order.MemeberID;
                memberIDTextBox2.Search();
            }
            //guideComboBox2.SelectedValue = order.GuideID;
            guideComboBox1.SelectedValue = order.OperateGuideID;
            dateTimePicker_Start.Value   = order.CreateTime;
            string       selectShopid = ValidateUtil.CheckEmptyValue(order.ShopID);
            List <Guide> guideList    = CommonGlobalCache.GuideList.FindAll(t => t.State == 0 && t.ShopID == selectShopid);



            if (details != null)
            {
                foreach (var item in details)
                {
                    this.GuideName.DataSource    = guideList;
                    this.GuideName.DisplayMember = "Name";
                    this.GuideName.ValueMember   = "ID";
                    item.CostumeName             = CommonGlobalCache.GetCostumeName(item.CostumeID);
                    item.SizeDisplayName         = CommonGlobalUtil.GetCostumeSizeName(item.CostumeID, item.SizeName);
                    item.BuyCount            = -item.BuyCount;
                    item.SumMoney            = -item.SumMoney;
                    item.IsRefund            = true;
                    item.RefundCount         = item.BuyCount;
                    item.SumMoneyActual      = -item.SumMoneyActual;
                    item.IsUseTickets        = false;
                    item.Discount            = 100;
                    item.DiscountOrigin      = 100;
                    item.AllowReviseDiscount = true;
                    item.CostPrice           = -item.CostPrice;
                    item.SumCost             = -item.SumCost;
                    item.GuideID             = item.GuideID;
                }
            }
            retailDetailList = details;
            dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(retailDetailList));
        }
Пример #30
0
        private void DataGrid2Binding(InteractResult <List <CostumeDistributionDetail> > retailDetailList)
        {
            DateTime starttime = DateTime.Now;

            //this.dataGridView_RetailDetail.DataSource = null;
            //dataGridViewPagingSumCtrl2.BindingDataSource(new List<CostumeDistributionDetail>());
            if (retailDetailList != null)
            {
            }
            //dataGridViewPagingSumCtrl2.BindingDataSource(retailDetailList.Data,false,null);
            dataGridViewPagingSumCtrl2.BindingDataSource(DataGridViewUtil.ListToBindingList(retailDetailList.Data));
            //dataGridViewPagingSumCtrl2.AppendNotShowInColumnSettings(nameDataGridViewTextBoxColumn);
        }