Exemple #1
0
 public SocietyLogin(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
Exemple #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                string lastdbName = null;
                PublicClass.CreateConnection("route");

                DataTable dtt = new DataTable();
                dtt = DbClass.getdata(CommandType.Text, "select * from route.lastdatabase where Instrumentname='" + PublicClass.currentInstrument + "'");

                foreach (DataRow dr in dtt.Rows)
                {
                    lastdbName = Convert.ToString(dr["DBName"]);
                }
                PublicClass.User_DataBase = lastdbName;

                if (PublicClass.conn.State == ConnectionState.Open)
                {
                    PublicClass.conn.Close();
                }
                PublicClass.CreateConnection(lastdbName);
                if (String.IsNullOrEmpty(txtID.Text))
                {
                    MessageBox.Show(this, "Please Enter The ID.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                if (String.IsNullOrEmpty(txtPassword.Text))
                {
                    MessageBox.Show(this, "Please Enter The Password.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                if (cmbdata.SelectedIndex == 0)
                {
                    MessageBox.Show(this, "Please Select any Data Source.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                PublicClass.cUserName = Convert.ToString(txtID.Text).Trim();
                PublicClass.cPassword = Convert.ToString(txtPassword.Text).Trim();
                DataTable dt1 = new DataTable();
                dt1 = DbClass.getdata(CommandType.Text, "Select ID from userdetail where UserName = '******'  and Password = '******'");
                foreach (DataRow dr in dt1.Rows)
                {
                    PublicClass.cUID = Convert.ToString(dr["ID"]);
                }
                DataTable dt = new DataTable();
                dt = DbClass.getdata(CommandType.Text, "Select distinct  User_ID ,uPassword from login_data where  user_id= '" + Convert.ToString(txtID.Text).Trim() + "' and upassword = '******'");
                if (dt.Rows.Count <= 0)
                {
                    MessageBox.Show(this, "Please Enter the valid Id and Password", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtID.Text       = "";
                    txtPassword.Text = "";
                    return;
                }
                else
                {
                    int uchk = String.Compare(Convert.ToString(dt.Rows[0]["User_ID"]), PublicClass.cUserName);
                    int pchk = String.Compare(Convert.ToString(dt.Rows[0]["upassword"]), PublicClass.cPassword);

                    if (uchk == 0 && pchk == 0)
                    {
                        PublicClass.LoginStatus = true;
                        this.Close();
                        PublicClass.User_Name = Convert.ToString(txtID.Text).Trim();
                        DbClass.executequery(CommandType.Text, "Update userdetail set Login = '******' , LastloginDate = '" + PublicClass.GetDatetime() + "'where ID = '" + PublicClass.cUID + "'");
                    }
                    else
                    {
                        MessageBox.Show(this, "You have entered wrong user name or password...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtID.Text       = "";
                        txtPassword.Text = "";
                    }
                }
            }
            catch { }
        }
Exemple #3
0
 public RationCardType(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
Exemple #4
0
 public Mpwlc(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
Exemple #5
0
 public AgencyLogin(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
Exemple #6
0
 public RateMaster(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
Exemple #7
0
 public Rigion(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
Exemple #8
0
 public Division(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
 public PurchaseCenterWhtMp(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }
Exemple #10
0
 public LARO(Common cCommon)
 {
     db = new DbClass(cCommon.Connection);
 }