Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    voucherid   = Convert.ToInt32(Request["voucherid"]);
        string vouchername = Request["voucherlevel"];

        decimal vouchermincost     = Convert.ToDecimal(Request["vouchermincost"]);
        decimal voucherdefaultcost = Convert.ToDecimal(Request["voucherdefaultcost"]);
        string  voucherdesc        = Request["voucherdesc"];

        try
        {
            VouchersTBx voucher = new VouchersTBx();
            voucher = VM.GetByID(voucherid);

            voucher.VoucherName        = vouchername;
            voucher.VoucherDescription = voucherdesc;
            voucher.VoucherMinCost     = vouchermincost;
            voucher.VoucherDefaultCost = voucherdefaultcost;
            VM.Save();
            Response.Write(1);
        }
        catch (Exception ex)
        {
            Response.Write(0);
        }
    }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         int            id = Convert.ToInt32(Request["id"]);
         VoucherManager cm = new VoucherManager();
         delete = cm.GetByID(id);
         delete.VoucherStatus = -1;
         cm.Save();
         Response.Write(JsonConvert.SerializeObject(new
         {
             success = 1
         }));
     }
     catch (Exception ex)
     {
         Response.Write(JsonConvert.SerializeObject(new
         {
             success = -1,
             error   = ex
         }));
     }
 }