Ejemplo n.º 1
0
 /// <summary>
 /// This method will sets the state of the side bar enable states according to respective parameters
 /// </summary>
 /// <param name="add"></param>
 /// <param name="edit"></param>
 /// <param name="save"></param>
 /// <param name="print"></param>
 /// <param name="delete"></param>
 public static void setToolTipButtonStates(bool add, bool edit, bool save, bool print, bool delete, bool clear)
 {
     main = Program.getMainForm();
     //     main.BtnAdd = add;
     //     main.BtnEdit = edit;
     //      main.BtnSave = save;
     //      main.BtnPrint = print;
     //      main.BtnDelete = delete;
     //      main.BtnClear = clear;
 }
Ejemplo n.º 2
0
        public void save()
        {
            main = Program.getMainForm();

//btnAdd = main.BtnAdd;
            //        btnEdit = main.BtnEdit;
            //       btnSave = main.BtnSave;
            //     btnPrint = main.BtnPrint;
            //     btnDelete = main.BtnDelete;
            //       btnClear = main.BtnClear;
        }
 private void btn_login_Click(object sender, EventArgs e)
 {
     strUsername = tb_username.Text;
     strPassword = tb_passsword.Text;
     if (Validation.isValidUser(strUsername, strPassword))
     {
         this.Hide();
         frm_Main main = new frm_Main(strUsername);
         main.Show();
     }
     else
     {
         tb_passsword.Text = "";
         tb_username.Text  = "";
         MessageBox.Show("Username or Password is invalid!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Ejemplo n.º 4
0
        public void ControlSideToolStrip(object parentForm, bool btnNew = false, bool btnEdit = false, bool btnSave = false, bool btnPrint = false, bool btnDelete = false, bool btnCancal = false)
        {
            frm_Main frmMDIHome = new frm_Main();

            frmMDIHome = (frm_Main)parentForm;
            ToolStrip t = new ToolStrip();

            t = (ToolStrip)frmMDIHome.Controls["ts_side"];

            if (btnNew == true)
            {
                t.Items["btn_add"].Enabled = true;
            }
            else
            {
                t.Items["btn_add"].Enabled = false;
            }

            if (btnEdit == true)
            {
                t.Items["btn_edit"].Enabled = true;
            }
            else
            {
                t.Items["btn_edit"].Enabled = false;
            }

            if (btnSave == true)
            {
                t.Items["btn_save"].Enabled = true;
            }
            else
            {
                t.Items["btn_save"].Enabled = false;
            }

            if (btnPrint == true)
            {
                t.Items["btn_print"].Enabled = true;
            }
            else
            {
                t.Items["btn_print"].Enabled = false;
            }

            if (btnDelete == true)
            {
                t.Items["btn_delete"].Enabled = true;
            }
            else
            {
                t.Items["btn_delete"].Enabled = false;
            }

            if (btnCancal == true)
            {
                t.Items["btn_clear"].Enabled = true;
            }
            else
            {
                t.Items["btn_clear"].Enabled = false;
            }
        }
Ejemplo n.º 5
0
 public static void setToolTipButtonStates(bool all)
 {
     main = Program.getMainForm();
     //    main.BtnAdd = main.BtnDelete = main.BtnEdit = main.BtnSave = main.BtnPrint = main.BtnClear = all;
 }
Ejemplo n.º 6
0
 public static frm_Main getMainForm()
 {
     main = new frm_Main("");
     return(main);
 }