Ejemplo n.º 1
0
        private void btn_State_Add_Click(object sender, EventArgs e)
        {
            f_AddState fads = new f_AddState();

            fads.custName = tb_Customer_Name.Text;
            fads.edit     = false;
            fads.ShowDialog();
            if (fads.OK)
            {
                if (fads.state != "" && !States.Contains(fads.state))
                {
                    States.Add(fads.state);
                    loadCustomerStates();
                }
            }
        }
Ejemplo n.º 2
0
        private void btn_State_Edit_Click(object sender, EventArgs e)
        {
            if (lv_States.FocusedItem != null)
            {
                string s = lv_States.FocusedItem.SubItems[1].Text;

                f_AddState fads = new f_AddState();
                fads.custName      = tb_Customer_Name.Text;
                fads.edit          = true;
                fads.previousState = s;
                fads.ShowDialog();
                if (fads.OK)
                {
                    if (fads.state != "" && !States.Contains(fads.state))
                    {
                        States[States.IndexOf(s)] = fads.state;
                        loadCustomerStates();
                    }
                }
            }
        }