Exemplo n.º 1
0
        private void butNew_Click(object sender, System.EventArgs e)
        {
            if (this.txtName.Text != "")
            {
                frmEditRepCharges frmCharges = new frmEditRepCharges();
                frmCharges.ActionType = "New";

                frmCharges.Rep.CompanyID = this.CompanyID;
                frmCharges.Rep.RepID     = Convert.ToInt32(this.txtRepID.Text);

                frmCharges.ShowDialog();


                //this.load_rep_charges(this.CompanyID,this.txtRepID.Text);
                LoadCharges();
            }
        }
Exemplo n.º 2
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            if (listCharges.SelectedItems.Count != 0)
            {
                frmEditRepCharges frmCharges = new frmEditRepCharges();
                frmCharges.ActionType        = "Edit";
                frmCharges.Rep.RepID         = Convert.ToInt32(this.txtRepID.Text);
                frmCharges.Rep.Name          = this.txtName.Text;
                frmCharges.Rep.ChargeID      = listCharges.SelectedItems[0].SubItems[0].Text;
                frmCharges.Rep.Date          = listCharges.SelectedItems[0].SubItems[1].Text == ""?Convert.ToDateTime(null):Convert.ToDateTime(listCharges.SelectedItems[0].SubItems[1].Text);
                frmCharges.Rep.Description_1 = listCharges.SelectedItems[0].SubItems[2].Text;
                frmCharges.Rep.Description_2 = listCharges.SelectedItems[0].SubItems[3].Text;
                frmCharges.Rep.Description_3 = listCharges.SelectedItems[0].SubItems[4].Text;
                frmCharges.Rep.Charge        = Convert.ToDouble(listCharges.SelectedItems[0].SubItems[5].Text);

                frmCharges.ShowDialog();

                //this.load_rep_charges(this.CompanyID,this.txtRepID.Text);
                LoadCharges();
            }
        }