コード例 #1
0
        private void dataGridView3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }

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

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

                    RetailCommissionDetailForm form = new RetailCommissionDetailForm(para);
                    // form.PfCustomerRechargeRecordSuccess += WholesaleCustomerRechargeForm_PfCustomerRechargeRecordSuccess;


                    form.ShowDialog(Mitem.PhoneNumber);
                }

                /* else if (e.ColumnIndex == seeCommissionDataGridViewCheckBoxColumn2.Index)
                 * {
                 *   Mitem.SeeCommission = (bool)this.dataGridView3[e.ColumnIndex, e.RowIndex].Value;
                 *   UpIsCheck(Mitem.PhoneNumber, Mitem.SeeCommission);
                 * }*/
            }
        }