Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            RuleManager RM   = new RuleManager();
            RuleTBx     rule = new RuleTBx();
            rule.status      = 1;
            rule.name        = Request["name"];
            rule.description = Request.Unvalidated["check"];
            rule.content     = Request.Unvalidated["contrule"];
            rule.point       = Request["point"];
            rule.task_id     = Convert.ToInt32(Request["task"]);
            rule.step        = Request["step"];
            RM.Add(rule);

            Response.Write(JsonConvert.SerializeObject(new
            {
                success = 1
            }));
        }
        catch (Exception ex)
        {
            Response.Write(JsonConvert.SerializeObject(new
            {
                success = -1,
                error   = ex
            }));
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        RuleManager RM = new RuleManager();

        rule = RM.GetByID(Convert.ToInt32(Request.QueryString["id"]));
        TaskManager TM = new TaskManager();

        listtask = TM.GetList();
    }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         RuleManager RM   = new RuleManager();
         RuleTBx     rule = new RuleTBx();
         int         id   = Convert.ToInt32(Request["id"]);
         rule        = RM.GetByID(id);
         rule.status = -1;
         RM.Save();
         Response.Write(JsonConvert.SerializeObject(new
         {
             success = 1
         }));
     }
     catch (Exception ex)
     {
         Response.Write(JsonConvert.SerializeObject(new
         {
             success = -1,
             error   = ex
         }));
     }
 }
Пример #4
0
 public void Add(RuleTBx rule)
 {
     DB.RuleTBxes.InsertOnSubmit(rule);
     DB.SubmitChanges();
 }