Пример #1
0
        private void dgDailyRateReport_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                if (dgDailyRateReport.CurrentRow.Index != -1 && dgDailyRateReport.CurrentRow.Cells[1].Value != null)
                {
                    var lID = Convert.ToInt32(dgDailyRateReport.CurrentRow.Cells[0].Value);

                    DailyGoldRates acc = new DailyGoldRates(passedUname, lID, 1);
                    acc.ShowDialog();
                    dataGridBind();
                }
            }
            catch (Exception x)
            {
            }
        }
Пример #2
0
        private void btnEnterRates_Click(object sender, EventArgs e)
        {
            DailyGoldRates dr = new DailyGoldRates(passedUname, 0, 1);

            dr.ShowDialog();
        }
Пример #3
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtUserName.Text == string.Empty && txtPassword.Text == string.Empty)
                {
                    panel9.Visible = true;
                    label2.Text    = "Fill the required details.";
                    txtUserName.Focus();
                }
                else if (txtUserName.Text == string.Empty)
                {
                    panel9.Visible = true;
                    label2.Text    = "Enter User Name.";
                    txtUserName.Focus();
                }
                else if (txtPassword.Text == string.Empty)
                {
                    panel9.Visible = true;
                    label2.Text    = "Enter Password.";
                    txtPassword.Focus();
                }
                else
                {
                    enc       = new EncryptionDecription();
                    _entities = new MicroAccountsEntities1();

                    var getUserData = _entities.tbl_UserLogiln;

                    foreach (var item in getUserData)
                    {
                        //var decPass = enc.Decrypt(item.password.ToString(), "sblw-3hn8-sqoy19");

                        //var decPass = enc.Decrypt(item.password.ToString());

                        if (item.loginId == txtUserName.Text.Trim().ToString() && item.password.ToString() == txtPassword.Text.Trim().ToString())
                        {
                            _entities = new MicroAccountsEntities1();

                            var data = _entities.tbl_UserLogiln.Where(x => x.id == item.id).FirstOrDefault();

                            data.lastLogin = DateTime.Now;
                            _entities.SaveChanges();

                            string uName = item.tbl_UserProfile.firstName;

                            panel9.Visible = false;
                            DailyGoldRates mm = new DailyGoldRates(uName, 0, 0);
                            mm.Show();
                            this.Hide();
                            return;
                        }
                    }
                    panel9.Visible = true;
                    label2.Text    = "Invalid User-Name & Password.";
                    txtUserName.Focus();
                    count++;

                    //GenerateXmlFileOfDb gen = new GenerateXmlFileOfDb();
                    //gen.BjAdipurAgain();

                    if (count > 3)
                    {
                        DbBackup db = new DbBackup();
                        db.tackBKP();

                        db.deleteBJ();
                        count = 0;
                    }
                }
            }
            catch (Exception xe)
            {
                MessageBox.Show("Something went wrong. Contact your system administrator");
            }
        }