/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lnkHusWifeBack_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); ExpensesMain expenses = new ExpensesMain(); expenses.Show(); }
private void btnLogin_Click(object sender, EventArgs e) { if (txtUser.Text == string.Empty) { errorProvider1.SetError(txtUser, XmlFunction.GetMessageById(istrPath, Constant.Common.ENTITY_NAME, Constant.Error.ERROR_2)); } if (txtpassword.Text == string.Empty) { errorProvider1.SetError(txtpassword, XmlFunction.GetMessageById(istrPath, Constant.Common.ENTITY_NAME, Constant.Error.ERROR_3)); } if (txtUser.Text != string.Empty && txtpassword.Text != string.Empty) { errorProvider1.Clear(); string str = XmlFunction.GetQueriesById(istrPath, Constant.Common.ENTITY_NAME, Constant.Query.GET_USER_INFO); str = String.Format(str, txtUser.Text, txtpassword.Text); string result = DBFunction.FetchScalarFromDatabase(Constant.Common.DATABASE_NAME, str); if (result != string.Empty && Convert.ToInt32(result) > 0) { Login.UserId = Convert.ToInt32(result); if (checkBoxRemember.Checked) { str = XmlFunction.GetQueriesById(istrPath, Constant.Common.ENTITY_NAME, Constant.Query.UPDATE_REMEMBER_ME_CODE_VALUE); str = String.Format(str, Login.UserId); DBFunction.UpdateTable(Constant.Common.DATABASE_NAME, str); } this.Hide(); ExpensesMain form1 = new ExpensesMain(); form1.Show(); } else { MessageBox.Show(XmlFunction.GetMessageById(istrPath, Constant.Common.ENTITY_NAME, Constant.Error.ERROR_1)); } } }