Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            StepManager SM   = new StepManager();
            StepTBx     step = new StepTBx();


            step.status = 1;
            step.effect = Request["effect"];

            StepTBx temp = SM.GetbyStepnumber(int.Parse(Request["number"]));
            if (temp != null)
            {
                Response.Write(JsonConvert.SerializeObject(new
                {
                    success = 0,
                    error   = "Step was has Effect"
                }));
                return;
            }
            step.step_number = int.Parse(Request["number"]);
            SM.Add(step);
            Response.Write(JsonConvert.SerializeObject(new
            {
                success = 1
            }));
        }
        catch (Exception ex)
        {
            Response.Write(JsonConvert.SerializeObject(new
            {
                success = -1,
                error   = ex
            }));
        }
    }