예제 #1
0
 private void btnChangePW_Click(object sender, EventArgs e)
 {
     if (txtUser.Text == "")
     {
         XtraMessageBox.Show("Please enter the Username", "HAMACO", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         string username2 = gen.GetString3("MSC_User", "UserName", "UserName", txtUser.Text, "CompanyCode", Globals.companycode);
         if (username2 != "")
         {
             Frm_UserSetPW F = new Frm_UserSetPW();
             F.getusername(txtUser.Text);
             F.Show();
         }
         else
         {
             XtraMessageBox.Show("This user is not existed", "HAMACO", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
예제 #2
0
        private void barManager1_ItemClick(object sender, ItemClickEventArgs e)
        {
            BarSubItem subMenu = e.Item as BarSubItem;

            if (subMenu != null)
            {
                return;
            }
            switch (e.Item.Caption)
            {
            case "Exit":
                this.Close();
                break;

            case "Change Password":
                Frm_UserSetPW F = new Frm_UserSetPW();     // goi form change password
                F.getusername(Globals.username);
                F.Show();
                break;

            case "Old version":
                Form1 F1 = new Form1();   // goi form1
                //F1.getform(this); //-- cua Form1
                F1.getuserid(userid);     //-- cua Form1
                F1.Show();
                break;

            default:
                string   chuoi  = e.Item.Caption;
                string[] tcode2 = chuoi.Split('-');
                //MessageBox.Show(tcode2[0]);
                string fname = gen.GetString2("Transactions", "FormName", "TransactionCode", tcode2[0], clientid);
                Globals.transactioncode = tcode2[0].ToUpper().Trim();
                //MessageBox.Show(fname);
                var type = Type.GetType("HAMACO." + fname);
                var F2   = Activator.CreateInstance(type) as Form;
                F2.Show();
                break;
            }
        }