コード例 #1
0
    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");
        }
    }
コード例 #2
0
    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");
        }
    }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
    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();
        }
    }
コード例 #5
0
        public static int UpdateCancelCharge(CancelCharge cancelCharge)
        {
            int result = 0;

            try
            {
                result = DataAccessHelper.GetCancelChargeDA().UpdateCancelCharge(cancelCharge);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: BLLCancelCharge.cs プロジェクト: rizkioa/ceurape1
 public static int InsertCancelCharge(CancelCharge cancelCharge)
 {
     int result = 0;
     try
     {
         result = DataAccessHelper.GetCancelChargeDA().InsertCancelCharge(cancelCharge);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
コード例 #8
0
ファイル: DALCancelCharge.cs プロジェクト: rizkioa/ceurape1
 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;
 }