protected void Page_Load(object sender, EventArgs e)
    {
        vUTPScheduleMessager vScheduleLogObj;
        tblScheduler         SchedulerObj;

        if (!IsPostBack)
        {
            if (Request.QueryString["KeyGuid"] != null && Request.QueryString["KeyGuid"] != string.Empty)
            {
                KeyId           = Request.QueryString["KeyGuid"].ToString();
                BLL_ScheduleLog = new vScheduleLogBLL();
                //显示UserName信息
                vScheduleLogObj = BLL_ScheduleLog.FindUserNameByScheduleId(KeyId);
                if (vScheduleLogObj != null)
                {
                    lbl_UserName.Text = vScheduleLogObj.UserName;
                }
                //显示TaskName
                BLL_ScheduleTasks = new ScheduleTasksBLL();
                SchedulerObj      = BLL_ScheduleTasks.FindSchedulerById(KeyId);
                lbl_TaskName.Text = SchedulerObj.TaskName.Substring(0, SchedulerObj.TaskName.LastIndexOf("-"));
            }
        }
        GridViewDataBinding(KeyId);
    }
Exemplo n.º 2
0
 protected void GetData()
 {
     if (this.KeyId != string.Empty)
     {
         BLL_ScheduleTasks = new ScheduleTasksBLL();
         SchedulerObj      = BLL_ScheduleTasks.FindSchedulerById(this.KeyId);
     }
 }
    protected void RadGrid_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        string strWhere;
        string getScheduleID;//获取的绑定MasterTableView的Guid值

        getScheduleID = (e.Item as GridDataItem).GetDataKeyValue("ScheduleID").ToString();

        BLL_ScheduleTasks = new ScheduleTasksBLL();
        SchedulerObj      = BLL_ScheduleTasks.FindSchedulerById(getScheduleID);

        this.OrderBy = " it.name desc ";
        strWhere     = " and it.name='" + SchedulerObj.TaskName + "'";
        BLL_vSysJobs = new vSysJobsBLL();
        vSysJobsObjs = BLL_vSysJobs.GetVSysJobs(strWhere, this.OrderBy);

        if (vSysJobsObjs.Count() > 0)
        {
            BLL_JOB = new JOB();
            count   = BLL_JOB.DeleteJob(SchedulerObj.JobID.ToString()); //删除job

            if (count == 1)                                             //删除作业成功
            {
                successFlag = BLL_ScheduleTasks.LogicDelete(getScheduleID);
                if (!successFlag.Equals("InsertError"))//删除ScheduleTasks内的数据成功
                {
                    GridViewDataBinding();

                    //删除ScheduleTask数据成功
                    MessageBox(true, false, false,
                               GetGlobalResourceObject("WebResource", "ScheduleTasksForm_DeleteTasksMessage_RightMessage").ToString());
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "reload", "<script>window.location=window.self.location;</script>");//强制刷页
                }
                else
                {
                    //删除ScheduleTask数据失败
                    MessageBox(false, false, true,
                               GetGlobalResourceObject("WebResource", "ScheduleTasksForm_DeleteTasksMessage_ErrorMessage").ToString());
                }
            }
            else
            {
                //删除job失败
                MessageBox(false, false, true,
                           GetGlobalResourceObject("WebResource", "ScheduleTasksForm_DeleteJobMessage_ErrorMessage").ToString());
            }
        }
        else
        {
            successFlag = BLL_ScheduleTasks.LogicDelete(getScheduleID);
            if (!successFlag.Equals("InsertError"))//删除ScheduleTasks内的数据成功
            {
                GridViewDataBinding();

                //删除ScheduleTask数据成功
                MessageBox(true, false, false,
                           GetGlobalResourceObject("WebResource", "ScheduleTasksForm_DeleteTasksMessage_RightMessage").ToString());
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "reload", "<script>window.location=window.self.location;</script>");//强制刷页
            }
            else
            {
                //删除ScheduleTask数据失败
                MessageBox(false, false, true,
                           GetGlobalResourceObject("WebResource", "ScheduleTasksForm_DeleteTasksMessage_ErrorMessage").ToString());
            }
        }
    }