Beispiel #1
0
    public DataSet GetJobListForTask(string UsrNam, string UsrPwd, Int32 TaskId, Boolean bOnlyActive)
    {
        DataSet oDs = null;

        try
        {
            Int32 UserId = GetUserId(UsrNam, UsrPwd);

            if (UserId > 0)
            {
                ClassJob oJob = new ClassJob();

                oDs = oJob.ShowJobsForTask(TaskId, bOnlyActive);
            }
        }

        catch (Exception ex)
        {
            Log.LogMsg(ex.Message);
        }

        return oDs;
    }
    private void ShowJobs(Int32 PageNo)
    {
        this.GridJob.DataSource = null;

        if (this.DdlTasks.Items.Count > 0)
        {
            ClassJob oJob = new ClassJob();
            DataSet oDs = oJob.ShowJobsForTask(Convert.ToInt32(this.DdlTasks.SelectedValue), false);

            if (oDs != null)
            {
                if (oDs.Tables.Count > 0)
                {
                    if (oDs.Tables[0].Rows.Count > 0)
                    {
                        this.GridJob.DataSource = oDs;

                        if (this.GridJob.Rows.Count > 0)
                            this.GridJob.PageIndex = PageNo;

                        this.GridJob.DataBind();
                    }
                }
            }
        }
    }
    private void ShowJobs(Int32 TskId)
    {
        //ClassTask oTsk = new ClassTask(Convert.ToInt32(this.DdlTasks.SelectedValue));

        //if ((oTsk.ValidationType & (Int32)Enum.ValidationType.UseDropDownListBox) != 0)
        //{
            //	We are using a dropdown listbox of possible job reference values.

            ClassJob oJob = new ClassJob();
            DataSet oDs = oJob.ShowJobsForTask(TskId, true);
            Boolean bShow = false;

            if (oDs != null)
            {
                if (oDs.Tables.Count > 0)
                {
                    if (oDs.Tables[0].Rows.Count > 0)
                        bShow = true;
                }
            }

            //this.DdlJobs.Items.Clear();

            if (bShow == true)
            {
                //this.DdlJobs.DataSource = oDs;
                //this.DdlJobs.DataTextField = "JobRef";
                //this.DdlJobs.DataValueField = "JobRef";
                //this.DdlJobs.DataBind();

                //this.TxtReference.Visible = false;
                //this.DdlJobs.Visible = true;
            }
            else
            {
                //	No pre-defined values exist for dropdown.
                //	User must enter a value.

                //this.TxtReference.Visible = true;
                //this.DdlJobs.Visible = false;
            }
        //}
        //else
        //{
            //	User needs to enter a value.

            //this.TxtReference.Visible = true;
            //this.DdlJobs.Visible = false;
        //}
    }