public override int InsertOrUpdate(DayCloseDetails obj) { try { new DalDayCloseDetails().InsertOrUpdate(obj); return(1); } catch (Exception) { return(0); } }
public override DayCloseDetails LoadFromReader(DataTableReader reader) { var temp = new DayCloseDetails(); if (reader != null && !reader.IsClosed) { //temp.MenuCategoryId = reader.GetInt32(0); //if (!reader.IsDBNull(1)) temp.MenuCategoryName = reader.GetString(1); } return(temp); }
public void InsertOrUpdate(DayCloseDetails obj) { ClearParameter(); AddParameter("@id", obj.Id); AddParameter("@closingdate", obj.ClosingDate); AddParameter("@newdate", obj.NewDate); AddParameter("@entrydatetime", obj.EntryDateTime); AddParameter("@userid", obj.UserId); FetchData("sp_InsertUpdate_DayCloseDetails"); }
private void btnSave_Click(object sender, EventArgs e) { if (txtUsername.Text == "") { KryptonMessageBox.Show("Please provide Username.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); txtUsername.Focus(); return; } if (txtPassword.Text == "") { KryptonMessageBox.Show("Please provide Password.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPassword.Focus(); return; } if (IsLoggedIn(txtUsername.Text, txtPassword.Text)) { DialogResult dr = KryptonMessageBox.Show(Messages.SaveConfirmation, Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { DayCloseDetails dayClose = new DayCloseDetails(); dayClose.ClosingDate = dtpClosingDate.Value; dayClose.NewDate = dtpClosingDate.Value.AddDays(1); dayClose.EntryDateTime = DateTime.Now; dayClose.UserId = BaseObject.User_ID; new BllDayCloseDetails().InsertOrUpdate(dayClose); BackupDB(); txtUsername.Text = ""; txtPassword.Text = ""; dtpClosingDate.Value = dtpClosingDate.Value.AddDays(1); } } else { KryptonMessageBox.Show("Invalid Username or Password. Please provide valid credentials.", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }