예제 #1
0
        private void LoadList()
        {
            EUser  c = new EUser();
            DataSet ds = c.GetListSpecific(txtUserName.Text,txtPassword.Text,Convert.ToInt32(cbxRole.SelectedValue));
            if (ds.Tables[0].Rows.Count > 0)
            {
                
                

                frmMain frm = new frmMain();
                
                frm.curruserid = Convert.ToInt32(ds.Tables[0].Rows[0]["UID"]);
                
                frm.currusername = txtUserName.Text;
                frm.pwd = txtPassword.Text;
                frm.role = cbxRole.Text;
                MISCurrentSettings.curruid = Convert.ToInt32(ds.Tables[0].Rows[0]["UID"]);
                frm.Show();
                this.Hide();
               
            }
            else
            {
               SpeechSynthesizer  ss = new SpeechSynthesizer();
               // MessageBox.Show("Sorry Your Login Information not Valid, Try Again");
                ttp.Show("Sorry Your Login Information not Valid, Please Try Again", txtPassword, 3000);
                ss.SpeakAsync("Sorry Your Login Information not Valid, Please Try Again");
               
            }

            
        }
예제 #2
0
 private void LoadList()
 {
     EUser d = new EUser();
     DataSet ds = d.GetList();
     //DataView dv = ds.Tables[0].DefaultView;
     //dv.Sort = "Cour";
     grdList.AutoGenerateColumns = false;
     grdList.DataSource = ds.Tables[0];
 }
예제 #3
0
        private void FillRoleCombo()
        {
            
            EUser c = new EUser();
            DataTable dt = c.GetRole();
            cbxRole.DataSource = dt;
            cbxRole.DisplayMember = "RoleName";
            cbxRole.ValueMember = "RoleID";
            

        }
예제 #4
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (!IsValid())
     {
         return;
     }
     frmMain frmmain = new frmMain();
     frmmain.pwd = this.txtNewPwd.Text;
     frmmain.Close();
    
     EUser d = new EUser();
     d.ChangePwd(userid, txtNewPwd.Text);
     MessageBox.Show("Password Changed");
             
     this.Close();
     
 }
예제 #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            EUser d = new EUser();
            try
            {
                if (!IsValid())
                {
                    return;
                }
                d.UserName = txtUserName.Text;
                d.Password = txtPassword.Text;
                d.RoleID = Convert.ToInt32(cbxRole.SelectedValue);
                d.Department = txtDept.Text;
                d.Designation = txtDesig.Text;
                d.CNIC = txtCNIC.Text;

               
                if (dataBoundItem != null)
                {

                    d.UserID = Convert.ToInt32(dataBoundItem["UID"]);
                    d.Update();
                }
                else
                {
                    d.Insert();
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                Utility.WriteToLog(ex, this);
            }
        }