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 <Distributor> list = (List <Distributor>) this.dataGridView1.DataSource;
                    Distributor        item = (Distributor)list[e.RowIndex];
                    if (e.ColumnIndex == accruedCommissionDataGridViewTextBoxColumn.Index)
                    {
                        PfCommissionDetailForm form = new PfCommissionDetailForm(para);
                        // form.PfCustomerRechargeRecordSuccess += WholesaleCustomerRechargeForm_PfCustomerRechargeRecordSuccess;
                        form.ShowDialog(item.ID);
                    }

                    /*   List<PfCustomer> list = (List<PfCustomer>)this.dataGridView1.DataSource;
                     * PfCustomer item = (PfCustomer)list[e.RowIndex];
                     * switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
                     * {
                     *     case "余额明细":
                     *       this.BalanceDetailClick?.Invoke(item, this);
                     *         break;
                     *     case "编辑":
                     *         this.SaveClick(item, this);
                     *         break;
                     *     case "删除":
                     *         if (GlobalMessageBox.Show("删除之后将查不到该客户的往来账,确定删除吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                     *         {
                     *             Remove(list, item);
                     *         }
                     *         break;
                     * }*/
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Beispiel #2
0
        private void dataGridView3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }

            if (e.RowIndex > -1 && e.ColumnIndex > -1)
            {
                List <PfCustomer> memberList = DataGridViewUtil.BindingListToList <PfCustomer>(dataGridView3.DataSource);
                //  List<PfCustomer> memberList = (List<PfCustomer>)this.dataGridView3.DataSource;
                PfCustomer Mitem = memberList[e.RowIndex];
                if (e.ColumnIndex == dataGridViewLinkColumn2.Index)
                {
                    if (curSelectNode != null)
                    {
                        SaveOffLineCustomerForm form = new SaveOffLineCustomerForm(Mitem.ID, Mitem, curSelectNode);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            InteractResult <List <PfCustomer> > mList = CommonGlobalCache.ServerProxy.GetPfDistributors(para);
                            if (mList.ExeResult == ExeResult.Success)
                            {
                                if (mList != null)
                                {
                                    //this.dataGridViewTextBoxColumn1.Visible = true;
                                    List <PfCustomer> ListPfCustomer = mList.Data;
                                    //foreach (PfCustomer Pitem in ListPfCustomer)
                                    //{
                                    //    Pitem.CustomerCode = Pitem.ID;
                                    //}
                                    dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(ListPfCustomer));
                                    this.dataGridView3.CurrentCell = this.dataGridView3.Rows[e.RowIndex].Cells[1];

                                    this.dataGridView3.Rows[e.RowIndex].Selected = true;
                                }
                            }
                        }
                    }
                }
                else if (e.ColumnIndex == dataGridViewLinkColumn1.Index)
                {
                    GetDistributorsPara paradetail = new GetDistributorsPara()
                    {
                        StartTime = new Date("1900-01-01"), EndTime = new Date(DateTime.Now)
                    };

                    PfCommissionDetailForm form = new PfCommissionDetailForm(paradetail);
                    // form.PfCustomerRechargeRecordSuccess += WholesaleCustomerRechargeForm_PfCustomerRechargeRecordSuccess;
                    form.ShowDialog(Mitem.ID);



                    //  RetailCommissionDetailForm form = new RetailCommissionDetailForm(para);
                    // form.PfCustomerRechargeRecordSuccess += WholesaleCustomerRechargeForm_PfCustomerRechargeRecordSuccess;
                    //  form.ShowDialog(Mitem.ID);
                }

                /*    else if (e.ColumnIndex == seeCommissionDataGridViewCheckBoxColumn.Index)
                 *  {
                 *      UpIsCheck(Mitem.ID, Mitem.SeeCommission);
                 *  }*/
            }
        }