Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Database.databaseName = "ColdStorage";
            Database.ldate = dateTimePicker1.Value.Date;

            if (textBox1.Text == "")
            {
                MessageBox.Show("Enter Username");
                textBox1.Focus();
                return;
            }
            if (textBox2.Text == "")
            {
                MessageBox.Show("Enter Password");
                textBox2.Focus();
                return;
            }

            if (textBox3.Text == "")
            {
                MessageBox.Show("Enter Financial Period");
                textBox3.Focus();
                return;
            }
            string    str     = "select * from tbllogininfo where user_name='" + textBox1.Text + "' and password='******' ";
            DataTable dtlogin = new System.Data.DataTable();

            Database.GetSqlData(str, dtlogin);
            if (Database.ldate < Database.stDate)
            {
                MessageBox.Show("Login Date Can't be less then Start Date");
                dateTimePicker1.Focus();
                return;
            }
            else if (Database.ldate > Database.enDate)
            {
                MessageBox.Show("Login Date Can't be greater then End Date");
                dateTimePicker1.Focus();
                return;
            }


            if (dtlogin.Rows.Count == 1)
            {
                str_main m = new str_main();
                Database.ldate = dateTimePicker1.Value;
                m.Show();
                Update();
                Postfix();
                this.Hide();
                Database.F_id = Database.GetScalarInt("Select id from Financialyear where Financial_period='" + textBox3.Text + "'");
            }
            else
            {
                MessageBox.Show("Name or Password Mismatch");
                Database.setFocus(textBox1);
            }
        }
Example #2
0
 internal static string ComboKeypress(str_main str_main, Report gg, string strCombo, string p, int p_2)
 {
     throw new NotImplementedException();
 }