protected void lnkBtnSave_Click(object sender, EventArgs e) { string name = CancelChargeName.Text.Trim(); string price = PercentPrice.Text; string date = DateCancel.Text; if ((!cancel.CancelChargeName.Equals(name)) && (BLLCancelCharge.checkCancelChargeExist(name) != 0)) { ClientScript.RegisterStartupScript(this.GetType(), "Notify", "alert('!!!Cancel Charge Name existed. Please try again');", true); } else { CancelCharge newCancel = new CancelCharge(); newCancel.CancelChargeNo = cancel.CancelChargeNo; newCancel.CancelChargeName = name; newCancel.PercentPrice = Int32.Parse(price); newCancel.DateCancel = Int32.Parse(date); if (cbStatus.Checked) { newCancel.Status = true; } else { newCancel.Status = true; } BLLCancelCharge.UpdateCancelCharge(newCancel); Response.Redirect("CancelChargeList.aspx"); } }
protected void lnkBtnSave_Click(object sender, EventArgs e) { string name = CancelChargeName.Text.Trim(); string price = PercentPrice.Text; string date = DateCancel.Text; if ((!cancel.CancelChargeName.Equals(name)) && (BLLCancelCharge.checkCancelChargeExist(name)!=0)) { ClientScript.RegisterStartupScript(this.GetType(), "Notify", "alert('!!!Cancel Charge Name existed. Please try again');", true); } else { CancelCharge newCancel = new CancelCharge(); newCancel.CancelChargeNo = cancel.CancelChargeNo; newCancel.CancelChargeName = name; newCancel.PercentPrice = Int32.Parse(price); newCancel.DateCancel = Int32.Parse(date); if(cbStatus.Checked) newCancel.Status = true; else newCancel.Status = true; BLLCancelCharge.UpdateCancelCharge(newCancel); Response.Redirect("CancelChargeList.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { int cancelId = Convert.ToInt32(Request.QueryString["CancelChargeNo"].ToString()); cancel = BLLCancelCharge.getCancelChargeByID(cancelId)[0]; if (!Page.IsPostBack) { fillData(); } }
public static int UpdateCancelCharge(CancelCharge cancelCharge) { int result = 0; try { result = DataAccessHelper.GetCancelChargeDA().UpdateCancelCharge(cancelCharge); } catch (Exception ex) { throw ex; } return(result); }
public int InsertCancelCharge(CancelCharge cancelCharge) { int result = 0; try { String[] columns = { cancelChargeName, percentPrice, dateCancel, status }; Object[] values = { cancelCharge.CancelChargeName, cancelCharge.PercentPrice, cancelCharge.DateCancel, cancelCharge.Status }; result = DALBase.InsertTable(tableName, columns, values); } catch (Exception ex) { throw ex; } return(result); }
public static int InsertCancelCharge(CancelCharge cancelCharge) { int result = 0; try { result = DataAccessHelper.GetCancelChargeDA().InsertCancelCharge(cancelCharge); } catch (Exception ex) { throw ex; } return result; }
public int UpdateCancelCharge(CancelCharge cancelCharge) { int result = 0; try { String[] columnNames = { cancelChargeName, percentPrice, dateCancel, status }; Object[] values = { cancelCharge.CancelChargeName, cancelCharge.PercentPrice, cancelCharge.DateCancel, cancelCharge.Status }; String[] keyColumnNames = {cancelChargeNo}; Object[] keyColumnValues = {cancelCharge.CancelChargeNo}; result = DALBase.UpdateTable(tableName, columnNames, values, keyColumnNames, keyColumnValues); } catch (Exception ex) { throw ex; } return result; }