public ActionResult _Delete(int id) { AccountBL.Delete(id, base._DB); return(new ContentResult() { Content = "OK" }); }
public bool SetSave() { bool ReturnValue = false; try { if (_Mode == (int)Common.Constant.Mode.Delete) { objAccountMasterBL.Delete(_AccountMasterID, "usp_Account_Delete", "Account - Delete"); if (CommDelRec.Exception == null) { if (CommDelRec.ErrorMessage != "") { lblErrorMessage.Text = CommDelRec.ErrorMessage; ReturnValue = false; } else { lblErrorMessage.Text = "No error"; ReturnValue = true; } } else { MessageBox.Show(CommDelRec.Exception.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Information); ReturnValue = false; } } else { if (DataValidator.IsValid(this.grpAccountMaster)) { if (DataValidator.IsValid(this.grpData)) { if (_Mode == (int)Common.Constant.Mode.Insert) { objAccountMasterBL.Insert(txtAccountCode.Text, txtAccountName.Text, Convert.ToDateTime(dtpDate.Value), Convert.ToDecimal(txtCrAmount.Text), Convert.ToDecimal(txtDbAmount.Text)); } else if (_Mode == (int)Common.Constant.Mode.Modify) { objAccountMasterBL.Update(_AccountMasterID, txtAccountCode.Text, txtAccountName.Text, Convert.ToDateTime(dtpDate.Value), Convert.ToDecimal(txtCrAmount.Text), Convert.ToDecimal(txtDbAmount.Text)); } if (objAccountMasterBL.Exception == null) { if (objAccountMasterBL.ErrorMessage != "") { lblErrorMessage.Text = objAccountMasterBL.ErrorMessage; txtAccountName.Focus(); ReturnValue = false; } else { lblErrorMessage.Text = "No error"; ReturnValue = true; } } else { MessageBox.Show(objAccountMasterBL.Exception.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Information); ReturnValue = false; } } } } } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("Account", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } return(ReturnValue); }
public bool DeleteUser(int id) { return(AccountBL.Delete(id)); }