Beispiel #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        model.job_name = KillSqlIn.Form_ReplaceByString(Request.Form["txtTitle"], 200);

        //string BackUrl = "CategoryTree.aspx";

        if (_id != "0")
        {
            model.job_id = _id;
            bll.Update(model);
            ClientScript.RegisterStartupScript(this.GetType(), "js", "<script>alert('修改成功!');layer_close_refresh();</script>");
            //JSUtility.AlertAndRedirect("修改成功!", BackUrl);

            /*日志归档*/
            //string sql1 = @"select Title as title from dbo.T_Category  where CategoryId = (" + _ACid + ")";
            //string function = "修改";
            //PubFunction.InsertLog1("文章类别管理", sql1, function);
        }
        else
        {
            model.if_leader = 0;
            model.job_id    = IdCreator.CreateId("T_Base_Job", "Job_id");
            bll.Add(model);
            JSUtility.AlertAndRedirect("添加成功,请继续添加!", Request.RawUrl.ToString());

            /*日志归档*/
            //string sql1 = @"select Title as title from dbo.T_Category  where CategoryId = (select top 1 CategoryId from T_Category order by CategoryId desc)";
            //string function = "添加";
            //PubFunction.InsertLog1("文章类别管理", sql1, function);
        }
    }
Beispiel #2
0
 /// <summary>
 /// 处理job更新
 /// </summary>
 /// <param name="jobDocStr"></param>
 private static void OnJobUpdate(string jobDocStr)
 {
     try
     {
         var dataDoc      = MongoDB.Bson.Serialization.BsonSerializer.Deserialize <BsonDocument>(jobDocStr);
         var jobId        = dataDoc.Text("jobId");
         var customerCode = dataDoc.Text("customerCode");
         dataDoc.Remove("jobId");
         dataDoc.Remove("customerCode");
         var result = jobBll.Update(jobId, dataDoc);
         if (result.Status != Status.Successful)
         {
             CallBack.OnExecFail(idMap["3"], 1, result.Message, jobDocStr);
         }
         else
         {
             queueMap["3"].SuccessTime = DateTime.Now;
         }
         var msg     = result.Status == Status.Successful ? "成功" : "失败";
         var message = ($"{dataDoc.Text("jobId")}处理结果:{msg}\n{jobDocStr}\n");
         ShowMessageInfo("OnJobUpdate", message);
     }
     catch (Exception e)
     {
         CallBack.OnExecFail(idMap["3"], 0, e.ToString(), jobDocStr);
     }
 }