private void btnSave_Click(object sender, EventArgs e) { try { if (isValid()) { bindLObj(); if (saveState) { if (mMasterBLL.saveObj("LMS_Library", mLibrary)) { MessageBox.Show(Constant.save_successful_message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); saveState = false; } } else { if (mMasterBLL.updateObj("LMS_Library", mLibrary)) { MessageBox.Show(Constant.update_successful_message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); mUtility.message(ref lblHeader); } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (isValid()) { bindLObj(); if (saveState) { //if (mMasterBLL.saveObj("SYS_MENU", mMenu)) if (mMasterBLL.saveObj("LMS_Book", mBook)) { lblHeader.Text = Constant.save_successful_message; //this.Text = Constant.save_successful_message; //lblHeader.Text = Constant.save_successful_message; MessageBox.Show(Constant.save_successful_message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); saveState = false; //mUtility.message(ref lblHeader); } } else { //if (mMasterBLL.updateObj("SYS_MENU", mMenu)) if (mMasterBLL.updateObj("LMS_Book", mBook)) { lblHeader.Text = ""; //lblHeader.Text = Constant.update_successful_message; //this.Text = Constant.update_successful_message; //lblHeader.Text = Constant.update_successful_message; MessageBox.Show(Constant.update_successful_message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); mUtility.message(ref lblHeader); } //CHARS.HR.COMMON.PL.Process.Proloading loading = new CHARS.HR.COMMON.PL.Process.Proloading(); //loading.ShowDialog(); //dd.Opacity = 20; } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (isValid()) { #region BindHeader if (mReturnHeader.Ask == "0") { mReturnHeader.Ask = mUtility.getStrAsk().ToString(); } mReturnHeader.TS = ApplicationMember.mUserLevel; mReturnHeader.UD = ApplicationMember.mLoginUserAsk; mReturnHeader.Code = txtRentID.Text.Trim(); mReturnHeader.MemberID = Convert.ToString(cboMember.SelectedValue); mReturnHeader.RentDate = Utility.getDateString(dtpRentDate.Value); mReturnHeader.Remark = txtRemark.Text; #endregion if (saveState) { //if (mMasterBLL.saveObj("SYS_MENU", mMenu)) if (mMasterBLL.saveObj("LMS_Tra_Rent_Header", mReturnHeader)) { #region Bind and Save Detail for (int i = 0; i < dgvRent.Rows.Count; i++) { if (dgvRent.Rows[i].Cells[1].Value != null) { if (mReturnDetail.Ask == "0") { mReturnDetail.Ask = mUtility.getStrAsk().ToString(); } mReturnDetail.TS = ApplicationMember.mUserLevel; mReturnDetail.UD = ApplicationMember.mLoginUserAsk; mReturnDetail.BookID = Convert.ToString(dgvRent.Rows[i].Cells[1].Value); mReturnDetail.RentDate = Utility.getDateString(dgvdtpRentDate.Value); mReturnDetail.ExpireDate = Utility.getDateString(dgvdtpExpireDate.Value); mReturnDetail.RentStatus = Convert.ToString(dgvRent.Rows[i].Cells[5].Value); mReturnDetail.ReturnDate = Utility.getDateString(dgvdtpReturnDate.Value); mReturnDetail.OverDueDate = Utility.getDateString(dgvdtpOverDueDate.Value); if (mMasterBLL.saveObj("LMS_Tra_Rent_Detail", mReturnDetail)) { } } } lblHeader.Text = Constant.save_successful_message; //this.Text = Constant.save_successful_message; //lblHeader.Text = Constant.save_successful_message; MessageBox.Show(Constant.save_successful_message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); saveState = false; //mUtility.message(ref lblHeader); #endregion } } else { //if (mMasterBLL.updateObj("SYS_MENU", mMenu)) if (mMasterBLL.updateObj("LMS_Tra_Rent_Header", mReturnHeader)) { lblHeader.Text = ""; //lblHeader.Text = Constant.update_successful_message; //this.Text = Constant.update_successful_message; //lblHeader.Text = Constant.update_successful_message; MessageBox.Show(Constant.update_successful_message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); mUtility.message(ref lblHeader); } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }