Esempio n. 1
0
    public void BindJobsOverdueList(int JobOverDueid)
    {
        BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();

        DataSet ds = objJobStatus.TecJobsOverdueList(Convert.ToInt32(ViewState["Job_OverDue_ID"].ToString()));
        DataRow dr = ds.Tables[0].Rows[0];

        txtDivJobTitle.Text                = dr["Job_Title"].ToString();
        txtDivOverDueReason.Text           = dr["Overdue_Reason"].ToString();
        txtDivTentativeCompletionDate.Text = dr["Tentative_Completion_Date"].ToString();

        if (dr["Modified_Completion_Date"].ToString() != "")
        {
            txtDivModifiedCompletionDate.Text = dr["Modified_Completion_Date"].ToString();
        }
        else
        {
            txtDivModifiedCompletionDate.Text = dr["Tentative_Completion_Date"].ToString();
        }

        txtDivSuptdResponse.Text = dr["Suptd_Response"].ToString();

        if (dr["MODIFIEDCOMPLETIONDATEFLAG"].ToString() == "1")
        {
            btnDivSave.Enabled = true;
        }
        else
        {
            btnDivSave.Enabled = false;
        }
    }
Esempio n. 2
0
    //private void BindJobIndividualDetails()
    //{

    //    BLL_PMS_Library_Jobs objJobs = new BLL_PMS_Library_Jobs();
    //    DataSet ds = objJobs.LibraryJobIndividualDetails(Convert.ToInt32(Request.QueryString["JobID"].ToString()));



    //    //if (ds.Tables[0].Rows.Count > 0)
    //    //{

    //    //    DataRow dr = ds.Tables[0].Rows[0];

    //    //    txtJobCode.Text = dr["JobCode"].ToString();
    //    //    txtVessel.Text = dr["Vessel_Name"].ToString();
    //    //    txtMachinery.Text = dr["Machinery"].ToString();

    //    //    txtSubsystem.Text = dr["Vessel_Name"].ToString();
    //    //    txtJobTitle.Text = dr["Job_Title"].ToString();
    //    //    txtJobDescription.Text = dr["Job_Description"].ToString();
    //    //    txtDepartment.Text = dr["DepartmentName"].ToString();
    //    //    txtRank.Text = dr["RankShortName"].ToString();
    //    //    txtcms.Text = dr["CMS"].ToString();

    //    //    if (dr["CMS"].ToString() == "Y")
    //    //        txtcms.BackColor = System.Drawing.Color.RosyBrown;

    //    //    if (dr["CRITICAL"].ToString() == "Y")
    //    //        txtCritical.BackColor = System.Drawing.Color.RosyBrown;


    //    //    txtCritical.Text = dr["CRITICAL"].ToString();
    //    //    txtFrequencyName.Text = dr["FrequencyName"].ToString();
    //    //    txtFrequencyType.Text = dr["Frequency"].ToString();

    //    //}

    //    //if (ds.Tables[1].Rows.Count > 0)
    //    //{

    //    //    DataRow dr = ds.Tables[1].Rows[0];
    //    //    txtLocation.Text = dr["Location"].ToString();
    //    //    txtDateOriginallyDue.Text = dr["DateOriginallyDue"].ToString();
    //    //    txtDateNextDue.Text = dr["DateNextDue"].ToString();
    //    //    txtDateJobDone.Text = dr["DateJobDone"].ToString();
    //    //    txtRhrsWhenJobDone.Text = dr["RhrsWhenJobDone"].ToString();
    //    //    txtJobRemark.Text = dr["History"].ToString();

    //    //    lbnCreatedBy.Text = dr["Created_By_Name"].ToString();
    //    //    txtCreatedOn.Text = dr["Created_On"].ToString();
    //    //    lbnVerifiedBy.Text = dr["Verified_By_Name"].ToString();
    //    //    txtVerifiedOn.Text = dr["Verified_On"].ToString();
    //    //    ViewState["CreatedByID"] = dr["CreatedByID"].ToString();
    //    //    ViewState["VerifiedByID"] = dr["VerifierID"].ToString();

    //    //}


    //}


    public void BindSparesItemUsed()
    {
        BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();

        int rowcount = ucCustomPagerItems.isCountRecord;


        int?vesselid = null;

        if (!string.IsNullOrEmpty(Request.QueryString["Vessel_ID"]))
        {
            vesselid = Convert.ToInt32(Request.QueryString["Vessel_ID"].ToString());
        }

        int?jobid = null;

        if (!string.IsNullOrEmpty(Request.QueryString["JobID"]))
        {
            jobid = Convert.ToInt32(Request.QueryString["JobID"].ToString());
        }

        int?jobhistoryid = null;

        if (!string.IsNullOrEmpty(Request.QueryString["JobHistoryID"]))
        {
            jobhistoryid = Convert.ToInt32(Request.QueryString["JobHistoryID"].ToString());
        }


        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }


        DataSet ds = objJobStatus.TecJobsSparesItemUsedSearch(vesselid, jobid, jobhistoryid, null, null, txtSearchtext.Text.Trim(), sortbycoloumn, sortdirection
                                                              , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        if (ds.Tables[0].Rows.Count > 0)
        {
            gvSpareItemUsed.DataSource = ds.Tables[0];
            gvSpareItemUsed.DataBind();
        }
        else
        {
            gvSpareItemUsed.DataSource = ds.Tables[0];
            gvSpareItemUsed.DataBind();
        }
    }
Esempio n. 3
0
    protected void btnDivSave_Click(object sender, EventArgs e)
    {
        BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();

        objJobStatus.TecJobsOverdueResponse(Convert.ToInt32(Session["userid"].ToString()), Convert.ToInt32(ViewState["Job_OverDue_ID"].ToString())
                                            , Convert.ToDateTime(txtDivModifiedCompletionDate.Text)
                                            , txtDivSuptdResponse.Text, Convert.ToInt32(ViewState["Vessel_ID"].ToString()));

        ViewState["Jobid"] = null;

        BindOverDueJobs();
        //BindJobsOverdueHistory(Convert.ToInt32(ViewState["Jobid"].ToString()));
        DivSuptdResponse.Visible = false;
        //UpdPnlOverDueGrid.Update();
        // UpdPnlJobHistoryGrid.Update();
    }
    private void BindJobDoneAttachments()
    {
        BLL_PMS_Job_Status objJob = new BLL_PMS_Job_Status();

        //  DataTable dt = objJob.TecJobGetJobDoneAttachment(Convert.ToInt32(Request.QueryString["JobHistoryID"].ToString()), Convert.ToInt32(Request.QueryString["Vessel_ID"].ToString()));

        DataTable dt = objBLLPurc.GET_JOB_DONE_ATTACHMENT(Convert.ToInt32(Request.QueryString["Vessel_ID"].ToString())
                                                          , null
                                                          , Convert.ToInt32(Request.QueryString["JobHistoryID"].ToString()), UDFLib.ConvertToInteger(Request.QueryString["OFFICE_ID"]));

        if (dt.Rows.Count > 0)
        {
            //Bind the header

            txtVessel.Text   = dt.Rows[0]["Vessel_Name"].ToString();
            txtJobTitle.Text = dt.Rows[0]["Job_Title"].ToString();
            txtJobDesc.Text  = dt.Rows[0]["Job_Description"].ToString();

            txtFrequency.Text  = dt.Rows[0]["FrequencyName"].ToString();
            txtDateDone.Text   = dt.Rows[0]["JOB_DONE"].ToString();
            txtRHoursDone.Text = dt.Rows[0]["Rhrs_Done"].ToString();
            txtRemark.Text     = dt.Rows[0]["Remarks"].ToString();

            DataView dvImage = dt.DefaultView;
            dvImage.RowFilter = "Is_Image='1' ";


            ListView1.DataSource = dvImage;
            ListView1.DataBind();
            ListView2.DataSource = dvImage;
            ListView2.DataBind();
            hidenTotalrecords.Value = dvImage.Count.ToString();
            HCurrentIndex.Value     = "0";
            if (dvImage.Count == 0)
            {
                tdg.Visible = false;
            }
            else
            {
                tdg.Visible = true;
            }

            dt.DefaultView.RowFilter  = "Is_Image='0'  ";
            rptDrillImages.DataSource = dt.DefaultView;
            rptDrillImages.DataBind();
        }
    }
Esempio n. 5
0
    public void BindJobsOverdueHistory(int?Jobid)
    {
        BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();

        mergeheadgvOverdueHistory = new MergeGridviewHeader_Info();
        mergeheadgvOverdueHistory.AddMergedColumns(new int[] { 6, 7 }, "Frequency", "PMSGridHeaderStyle-css");


        //mergeheadgvJobHistory = new MergeGridviewHeader_Info();
        //mergeheadgvOverdueHistory.AddMergedColumns(new int[] { 6, 7 }, "Frequency", "PMSGridHeaderStyle-css");

        int rowcount = ucCustomPagerItems.isCountRecord;

        int?jobid = null; if (ViewState["Jobid"] != null)
        {
            jobid = Convert.ToInt32(ViewState["Jobid"].ToString());
        }

        DataSet ds = objJobStatus.TecJobsOverdueHistorySearch(jobid, null
                                                              , null, null, null, null, null, null, null, null
                                                              , null, null, null, null, null, null
                                                              , null, null, ref rowcount);


        if (ds.Tables[0].Rows.Count > 0)
        {
            gvOverDueJobHistory.DataSource = ds.Tables[0];
            gvOverDueJobHistory.DataBind();

            //mergeheadgvJobHistory.AddMergedColumns(new int[] { 6, 7 }, "Frequency", "PMSGridHeaderStyle-css");

            gvJobHistory.DataSource = ds.Tables[1];
            gvJobHistory.DataBind();
        }
        else
        {
            gvOverDueJobHistory.DataSource = ds.Tables[0];
            gvOverDueJobHistory.DataBind();

            // mergeheadgvJobHistory.AddMergedColumns(new int[] { 6, 7 }, "Frequency", "PMSGridHeaderStyle-css");
            gvJobHistory.DataSource = ds.Tables[0];
            gvJobHistory.DataBind();
        }
    }
Esempio n. 6
0
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();
            int    rowcount       = ucCustomPagerItems.isCountRecord;
            int    odjobcount     = 1;
            int    critodjobcount = 1;
            int    totaljobcount  = 1;
            string sortbycoloumn  = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection  = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }
            string duedateflagesearch = (ViewState["OverDueSearchFlage"] == null) ? null : (ViewState["OverDueSearchFlage"].ToString());
            string QueryFlage = ViewState["Qflag"].ToString();
            int?   SafetyAlarm = null;
            int?   Calibration = null;
            int    JobStatus = 0;
            int    IsPendingOfcVerify = 0, PostponeJob = 0, FollowupAdded = 0, JobWithMandateRAssess = 0, JobWithSubRAssess = 0, JobDiffToDDock = 0;
            JobStatus = UDFLib.ConvertToInteger(rbtDueType.SelectedValue);
            if (chkAdvSafetyAlarm.Checked == true)
            {
                SafetyAlarm = 1;
            }
            if (chkAdvCalibration.Checked == true)
            {
                Calibration = 1;
            }

            int isCritical = 0;
            int isCMS = 0;

            int?Is_RAMandatory = null;      //Added by reshma for RA: For Filtering RA mandatory jobs
            int?Is_RASubmitted = null;      //Added by reshma for RA :For Filtering RA form submitted jobs

            if (rbtnMRA.SelectedItem.Value == "YES")
            {
                Is_RAMandatory = 1;
            }
            else if (rbtnMRA.SelectedItem.Value == "NO")
            {
                Is_RAMandatory = 2;
            }

            if (rbtnRASubmitted.SelectedItem.Value == "YES")
            {
                Is_RASubmitted = 1;
            }
            else if (rbtnRASubmitted.SelectedItem.Value == "NO")
            {
                Is_RASubmitted = 2;
            }

            DataTable dtVessel = new DataTable();
            dtVessel.Columns.Add("VID");
            if (rbtDueType.Items[0].Selected && rbtDueType.Items[1].Selected) // This will filter job history with all due and overdue job based on the date specified. If date between is not specified the default date is taken as current date
            {
                JobStatus = 3;

                txtFromDate.Enabled = true;
                txtToDate.Enabled   = true;
            }
            else if (rbtDueType.Items[0].Selected || rbtDueType.Items[1].Selected)// This will filter job history with either due or overdue job based on the date specified. If date between is not specified the default date is taken as current date
            {
                JobStatus = UDFLib.ConvertToInteger(rbtDueType.SelectedValue);
            }
            else if (rbtDueType.Items[0].Selected == false && rbtDueType.Items[1].Selected == false)/* This will display all the job  */
            {
                JobStatus        = 0;
                txtFromDate.Text = "";
                txtToDate.Text   = "";
            }
            foreach (DataRow dr in DDLVessel.SelectedValues.Rows)
            {
                dtVessel.Rows.Add(dr[0]);
            }


            if (chkOfcVerify.Checked == true)
            {
                IsPendingOfcVerify = 1;
            }


            if (chkAdvSafetyAlarm.Checked == true)
            {
                SafetyAlarm = 1;
            }
            if (chkAdvCalibration.Checked == true)
            {
                Calibration = 1;
            }
            int?jobid = null; if (ViewState["Jobid"] != null)
            {
                jobid = Convert.ToInt32(ViewState["Jobid"].ToString());
            }


            DataSet ds = objJobStatus.PMS_Get_OverdueJobs(jobid, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), dtVessel, UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0]),
                                                          ucf_DDLRank.SelectedValues, null, txtSearchJobTitle.Text != "" ? txtSearchJobTitle.Text.Trim() : null, isCritical, isCMS,
                                                          UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), 1, JobStatus, duedateflagesearch, IsPendingOfcVerify, SafetyAlarm, Calibration,
                                                          UDFLib.ConvertDateToNull(txtActFrmDate.Text), UDFLib.ConvertDateToNull(txtActToDate.Text), PostponeJob, FollowupAdded,
                                                          JobWithMandateRAssess, JobWithSubRAssess, JobDiffToDDock, Is_RAMandatory, Is_RASubmitted, sortbycoloumn, sortdirection, null, null,
                                                          ref rowcount, ref totaljobcount, ref odjobcount, ref critodjobcount);



            string[] HeaderCaptions  = { "Vessel", "System Location", "Sub-System Location", "Job Code", "Job Title", "Job Description", "Frequency", "Frequency Name", "Due Date", "Done", "OD.Days", "Next Due", "Rhrs", "Rem Rhrs", "CMS", "Critical", "Mandatory Risk Assessment", "Department", "Rank", "Remarks" };
            string[] DataColumnsName = { "Vessel_Name", "Location", "SUBLocation", "Job_Code", "JOB_TITLE", "Job_Description", "FREQUENCY", "Frequency_Name", "DUE_DATE", "NEXT_DONE", "OD_DAYS", "DATE_NEXT_DUE", "RHRS_DONE", "RemRhrs", "CMS", "Critical", "IsRAMandatory", "Department", "RankName", "FullRemarks" };


            string FileName           = "PMSJobHistory" + "_" + DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss") + ".xls";
            string FilePath           = Server.MapPath(@"~/Uploads\\Temp\\");
            string ExportTempFilePath = Server.MapPath(@"~/Uploads\\ExportTemplete\\");

            if ((sender as ImageButton).CommandArgument == "ExportFrom_IE")
            {
                GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Job History", "PMS Job History", "");
            }
            else
            {
                GridViewExportUtil.Export_To_Excel_Interop(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Job History", FilePath + FileName, ExportTempFilePath, @"~\\Uploads\\Temp\\" + FileName);
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }
Esempio n. 7
0
    /// <summary>
    /// Function to Bind Job Status to grid
    /// </summary>
    public void BindJobStatus()
    {
        try
        {
            BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();
            DataSet            ds           = new DataSet();

            BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib();
            int    rowcount            = ucCustomPagerItems.isCountRecord;
            int    odjobcount          = 1;
            int    critodjobcount      = 1;
            int    totaljobcount       = 1;
            string vesselcode          = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString());
            string sortbycoloumn       = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection       = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }
            int       isCritical = 0;
            int       isCMS = 0;
            int       JobStatus = 0;
            string    duedateflagesearch = (ViewState["OverDueSearchFlage"] == null) ? null : (ViewState["OverDueSearchFlage"].ToString());
            string    QueryFlage = ViewState["Qflag"].ToString();
            DataTable dtVessel = new DataTable();
            int       IsPendingOfcVerify = 0, PostponeJob = 0, FollowupAdded = 0, JobWithMandateRAssess = 0, JobWithSubRAssess = 0, JobDiffToDDock = 0;
            dtVessel.Columns.Add("VID");

            if (rbtDueType.Items[0].Selected && rbtDueType.Items[1].Selected) // This will filter job history with all due and overdue job based on the date specified. If date between is not specified the default date is taken as current date
            {
                JobStatus = 3;

                txtFromDate.Enabled = true;
                txtToDate.Enabled   = true;
            }
            else if (rbtDueType.Items[0].Selected || rbtDueType.Items[1].Selected)// This will filter job history with either due or overdue job based on the date specified. If date between is not specified the default date is taken as current date
            {
                JobStatus = UDFLib.ConvertToInteger(rbtDueType.SelectedValue);
            }
            else if (rbtDueType.Items[0].Selected == false && rbtDueType.Items[1].Selected == false)/* This will display all the job  */
            {
                JobStatus        = 0;
                txtFromDate.Text = "";
                txtToDate.Text   = "";
            }

            if (chkOfcVerify.Checked == true)
            {
                IsPendingOfcVerify = 1;
            }


            int?jobid = null;
            int?isHistory = 0;

            if (QueryFlage != "S")
            {
                isHistory = 1;

                if (QueryFlage == "H" && rbtnJobTypes.SelectedValue == "NONPMS")
                {
                    isHistory = 3;
                }

                jobid = null; if (ViewState["Jobid"] != null)
                {
                    jobid = Convert.ToInt32(ViewState["Jobid"].ToString());
                }
            }
            else if (QueryFlage == "S" && rbtnJobTypes.SelectedValue == "NONPMS")
            {
                isHistory = 2;
            }
            int?SafetyAlarm = null;
            int?Calibration = null;

            if (chkAdvSafetyAlarm.Checked == true)
            {
                SafetyAlarm = 1;
            }

            if (chkAdvCalibration.Checked == true)
            {
                Calibration = 1;
            }

            if (chkCritical.Checked == true)
            {
                isCritical = 1;
            }
            else
            {
                isCritical = 0;
            }
            if (chkCMS.Checked == true)
            {
                isCMS = 1;
            }
            else
            {
                isCMS = 0;
            }

            int?Is_RAMandatory = null;       //Added by reshma for RA :For Filtering RA form Mandatory jobs
            int?Is_RASubmitted = null;       //Added by reshma for RA :For Filtering RA form submitted jobs

            if (rbtnMRA.SelectedItem.Value == "YES")
            {
                Is_RAMandatory = 1;
            }
            else if (rbtnMRA.SelectedItem.Value == "NO")
            {
                Is_RAMandatory = 2;
            }

            if (rbtnRASubmitted.SelectedItem.Value == "YES")
            {
                Is_RASubmitted = 1;
            }
            else if (rbtnRASubmitted.SelectedItem.Value == "NO")
            {
                Is_RASubmitted = 2;
            }

            /* Call Webservice to get JobsCount  */
            List <string> wVessel = new List <string>();
            List <string> wRank   = new List <string>();

            foreach (DataRow dr in DDLVessel.SelectedValues.Rows)
            {
                wVessel.Add(dr[0].ToString());
            }

            foreach (DataRow dr in ucf_DDLRank.SelectedValues.Rows)
            {
                wRank.Add(dr[0].ToString());
            }


            string searchjobtitle = txtSearchJobTitle.Text != "" ? txtSearchJobTitle.Text.Trim() : "";

            String GetJobCount = "PMs_Get_OverdueJobsCount('" + jobid + "','" + UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue) + "'," + getArrayString(wVessel.ToArray()) + ",'" + UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue) + "','" + UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[1]) + "','" + UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]) + "','" + UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]) + "','" + UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0]) + "'," + getArrayString(wRank.ToArray()) + ",'" + null + "','" + UDFLib.ConvertStringToNull(searchjobtitle) + "','" + isCritical + "','" + isCMS + "','" + UDFLib.ConvertDateToNull(txtFromDate.Text) + "','" + UDFLib.ConvertDateToNull(txtToDate.Text) + "','" + isHistory + "','" + JobStatus + "','" + duedateflagesearch + "','" + IsPendingOfcVerify + "','" + SafetyAlarm + "','" + Calibration + "','" + UDFLib.ConvertDateToNull(txtActFrmDate.Text) + "','" + UDFLib.ConvertDateToNull(txtActToDate.Text) + "','" + PostponeJob + "','" + FollowupAdded + "','" + JobWithMandateRAssess + "','" + JobWithSubRAssess + "','" + JobDiffToDDock + "','" + Is_RAMandatory + "','" + Is_RASubmitted + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "GetJobCount", GetJobCount, true);

            /* Call Webservice to get JobsCount */

            ds = objJobStatus.PMS_Get_OverdueJobs(jobid, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), DDLVessel.SelectedValues, UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue),
                                                  UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]),
                                                  UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0]),
                                                  ucf_DDLRank.SelectedValues, null, txtSearchJobTitle.Text != "" ? txtSearchJobTitle.Text.Trim() : null, isCritical, isCMS,
                                                  UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), isHistory, JobStatus, duedateflagesearch, IsPendingOfcVerify, SafetyAlarm, Calibration,
                                                  UDFLib.ConvertDateToNull(txtActFrmDate.Text), UDFLib.ConvertDateToNull(txtActToDate.Text), PostponeJob, FollowupAdded,
                                                  JobWithMandateRAssess, JobWithSubRAssess, JobDiffToDDock, Is_RAMandatory, Is_RASubmitted, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize,
                                                  ref rowcount, ref totaljobcount, ref odjobcount, ref critodjobcount);


            DataTable dt = ds.Tables[0];


            if (ucCustomPagerItems.isCountRecord == 1)
            {
                ucCustomPagerItems.CountTotalRec = rowcount.ToString();
                ucCustomPagerItems.BuildPager();
            }



            gvStatus.DataSource = dt;
            gvStatus.DataBind();


            UpdPnlGrid.Update();
            UpdPnlFilter.Update();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 8
0
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();
            int rowcount = ucCustomPagerItems.isCountRecord;

            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }
            string duedateflagesearch = (ViewState["OverDueSearchFlage"] == null) ? null : (ViewState["OverDueSearchFlage"].ToString());
            string QueryFlage = ViewState["Qflag"].ToString();
            int    IsPendingOfcVerify = 0, PostponeJob = 0, FollowupAdded = 0, JobWithMandateRAssess = 0, JobWithSubRAssess = 0, JobDiffToDDock = 0;
            int?   SafetyAlarm = null;
            int?   Calibration = null;
            int?   isCritical  = 0;
            int?   isCMS = 0;
            if (chkAdvSftyAlarm.Checked == true)
            {
                SafetyAlarm = 1;
            }
            if (chkAdvCalibration.Checked == true)
            {
                Calibration = 1;
            }

            if (chkCritical.Checked == true)/* For Filtering Critical jobs */
            {
                isCritical = 1;
            }


            if (chkCMS.Checked == true)/* For Filtering CMS jobs */
            {
                isCMS = 1;
            }

            if (chkOfcVerify.Checked == true) /* For Filtering jobs pending for office verification */
            {
                IsPendingOfcVerify = 1;
            }



            if (chkAdvSftyAlarm.Checked == true) /* For Filtering Safety alarm jobs*/
            {
                SafetyAlarm = 1;
            }
            if (chkAdvCalibration.Checked == true)/* For Filtering Calibration jobs */
            {
                Calibration = 1;
            }

            int?Is_RAMandatory = null;     //Added by reshma for RA: For Filtering RA mandatory jobs
            int?Is_RASubmitted = null;     //Added by reshma for RA :For Filtering RA form submitted jobs

            if (rbtnMRA.SelectedItem.Value == "YES")
            {
                Is_RAMandatory = 1;
            }

            if (rbtnMRA.SelectedItem.Value == "NO")
            {
                Is_RAMandatory = 2;
            }
            if (rbtnRASubmitted.SelectedItem.Value == "YES")
            {
                Is_RASubmitted = 1;
            }
            if (rbtnRASubmitted.SelectedItem.Value == "NO")
            {
                Is_RASubmitted = 2;
            }


            /* Below Filters will be added in next phase of development*/
            //if (chkAdvPPJobs.Checked == true)
            //    PostponeJob = 1;

            //if (chkAdvJWMRA.Checked == true)
            //    JobWithMandateRAssess = 1;
            //if (chkAdvJWSRA.Checked == true)
            //    JobWithSubRAssess = 1;
            //if (chkAdvJDTDD.Checked == true)
            //    JobDiffToDDock = 1;
            /* upto this Filters will be added in next phase of development*/

            if (QueryFlage == "S")
            {
                DataSet ds = objJobStatus.TecJobStatusIndex(null, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0])
                                                            , ucf_DDLRank.SelectedValues, null, txtSearchJobTitle.Text != "" ? txtSearchJobTitle.Text.Trim() : null
                                                            , isCritical, isCMS, UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), UDFLib.ConvertDateToNull(txtActFrmDate.Text), UDFLib.ConvertDateToNull(txtActToDate.Text), 0, duedateflagesearch,
                                                            IsPendingOfcVerify, SafetyAlarm, Calibration, PostponeJob, FollowupAdded, JobWithMandateRAssess, JobWithSubRAssess, JobDiffToDDock, sortbycoloumn, sortdirection, null, null, RHDone, Is_RAMandatory, Is_RASubmitted, ref rowcount);


                string[] HeaderCaptions  = { "Vessel", "System Location", "Sub-System Location", "Job Code", "Job Title", "Job Description", "Frequency", "Frequency Name", "Done", "Next Due", "Rhrs", "Rem. Rhrs", "CMS", "Critical", "Mandatory Risk Assessment", "Department", "Rank", "Remarks" };
                string[] DataColumnsName = { "Vessel_Name", "Location", "SUBLocation", "Job_Code", "JOB_TITLE", "Job_Description", "FREQUENCY", "Frequency_Name", "LAST_DONE", "DATE_NEXT_DUE", "RHRS_DONE", "RemRhrs", "CMS", "Critical", "IsRAMandatory", "Department", "RankName", "FullRemarks" };

                string FileName = "PMSStatus" + "_" + DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss") + ".xls";
                string FilePath = Server.MapPath(@"~/Uploads\\Temp\\"); string ExportTempFilePath = Server.MapPath(@"~/Uploads\\ExportTemplete\\");

                if ((sender as ImageButton).CommandArgument == "ExportFrom_IE")
                {
                    GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Status", "PMS Status", "");
                }
                else
                {
                    GridViewExportUtil.Export_To_Excel_Interop(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Status", FilePath + FileName, ExportTempFilePath, @"~\\Uploads\\Temp\\" + FileName);
                    //GridViewExportUtil.Show_CSV_TO_Excel(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Status", "PMS Status", "");
                }
            }
            else
            {
                if (chkAdvSftyAlarm.Checked == true)
                {
                    SafetyAlarm = 1;
                }
                if (chkAdvCalibration.Checked == true)
                {
                    Calibration = 1;
                }
                int?jobid = null; if (ViewState["Jobid"] != null)
                {
                    jobid = Convert.ToInt32(ViewState["Jobid"].ToString());
                }


                DataSet ds = objJobStatus.TecJobStatusIndex(jobid, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0])
                                                            , ucf_DDLRank.SelectedValues, null, txtSearchJobTitle.Text != "" ? txtSearchJobTitle.Text.Trim() : null
                                                            , isCritical, isCMS, UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), UDFLib.ConvertDateToNull(txtActFrmDate.Text), UDFLib.ConvertDateToNull(txtActToDate.Text), 1, duedateflagesearch,
                                                            IsPendingOfcVerify, SafetyAlarm, Calibration, PostponeJob, FollowupAdded, JobWithMandateRAssess, JobWithSubRAssess, JobDiffToDDock, sortbycoloumn, sortdirection, null, null, RHDone, Is_RAMandatory, Is_RASubmitted, ref rowcount);


                string[] HeaderCaptions  = { "Job History ID", "Vessel", "Location", "SubSystem", "Job Code", "Job Title", "Job Description", "Frequency", "Frequency Name", "Last Done", "Rhrs", "Rem. Rhrs", "Next Due", "CMS", "Critical", "Mandatory Risk Assessment", "Department", "Rank", "Remarks" };
                string[] DataColumnsName = { "JobHistoryID", "Vessel_Name", "Location", "SubSystem", "Job_Code", "JOB_TITLE", "Job_Description", "FREQUENCY", "Frequency_Name", "LAST_DONE", "RHRS_DONE", "RemRhrs", "DATE_NEXT_DUE", "CMS", "Critical", "IsRAMandatory", "Department", "RankName", "FullRemarks" };


                string FileName = "PMSJobHistory" + "_" + DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss") + ".xls";
                string FilePath = Server.MapPath(@"~/Uploads\\Temp\\"); string ExportTempFilePath = Server.MapPath(@"~/Uploads\\ExportTemplete\\");

                if ((sender as ImageButton).CommandArgument == "ExportFrom_IE")
                {
                    GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Job History", "PMS Job History", "");
                }
                else
                {
                    GridViewExportUtil.Export_To_Excel_Interop(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Job History", FilePath + FileName, ExportTempFilePath, @"~\\Uploads\\Temp\\" + FileName);
                    //GridViewExportUtil.Show_CSV_TO_Excel(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Job History", "PMS Job History", "");
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }
Esempio n. 9
0
    /// <summary>
    /// Bind jobs status
    /// </summary>
    /// <param name="VesselId">Vessel Id</param>
    /// <param name="LocationId">location Id</param>
    /// <param name="SystemLocation">system location of system</param>
    /// <param name="SubSystemLocation">sub system location of system</param>
    /// <param name="DepartmentID">Department Id for system</param>
    /// <param name="RankID">Rank Id</param>
    /// <param name="SearchText">Search text like job code or title</param>
    /// <param name="critical">Check for critical jobs</param>
    /// <param name="cms">Check for CMS jobs</param>
    /// <param name="fromdate">from date</param>
    /// <param name="todate">To date</param>
    /// <param name="DueDateFlageSearch">For filter like "This Month","Overdue"</param>
    /// <param name="VerifyFlag">Check for job is verifie or not</param>
    /// <param name="JobFreq">Set frequency for job</param>
    /// <param name="IsSafetyAlarm">check IsSafetyAlarm for job</param>
    /// <param name="IsCalibration">check IsCalibration for job</param>
    /// <param name="sortby">for sorting </param>
    /// <param name="sortdirection">for sortdirection</param>
    /// <param name="pagenumber">used for page number</param>
    /// <param name="pagesize">used for page size</param>
    /// <param name="RHDone">for search RunHours done</param>
    /// <param name="isfetchcount"></param>
    /// <returns></returns>
    public void BindJobStatus()
    {
        try
        {
            BLL_PMS_Job_Status objJobStatus = new BLL_PMS_Job_Status();
            DataSet            ds           = new DataSet();

            int    rowcount      = ucCustomPagerItems.isCountRecord;
            string vesselcode    = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString());
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            string duedateflagesearch = (ViewState["OverDueSearchFlage"] == null) ? null : (ViewState["OverDueSearchFlage"].ToString());
            int    IsPendingOfcVerify = 0, PostponeJob = 0, FollowupAdded = 0, JobWithMandateRAssess = 0, JobWithSubRAssess = 0, JobDiffToDDock = 0;
            string QueryFlage = ViewState["Qflag"].ToString();
            int    isCritical = 0;
            int    isCMS = 0;
            EnableButton();
            int?jobid     = null;
            int?isHistory = 0;

            if (QueryFlage != "S")
            {
                isHistory = 1;

                if (QueryFlage == "H" && rbtnJobTypes.SelectedValue == "NONPMS")
                {
                    isHistory = 3;
                }

                jobid = null; if (ViewState["Jobid"] != null)
                {
                    jobid = Convert.ToInt32(ViewState["Jobid"].ToString());
                }
            }
            else if (QueryFlage == "S" && rbtnJobTypes.SelectedValue == "NONPMS")
            {
                isHistory = 2;
            }

            if (chkCritical.Checked == true)/* For Filtering Critical jobs */
            {
                isCritical = 1;
            }


            if (chkCMS.Checked == true)/* For Filtering CMS jobs */
            {
                isCMS = 1;
            }

            if (chkOfcVerify.Checked == true) /* For Filtering jobs pending for office verification */
            {
                IsPendingOfcVerify = 1;
            }


            int?SafetyAlarm = null;
            int?Calibration = null;

            if (chkAdvSftyAlarm.Checked == true) /* For Filtering Safety alarm jobs*/
            {
                SafetyAlarm = 1;
            }
            if (chkAdvCalibration.Checked == true)/* For Filtering Calibration jobs */
            {
                Calibration = 1;
            }

            int?Is_RAMandatory = null;     //Added by reshma for RA:  For Filtering RA mandatory jobs
            int?Is_RASubmitted = null;     //Added by reshma for RA : For Filtering RA form submitted jobs

            if (rbtnMRA.SelectedItem.Value == "YES")
            {
                Is_RAMandatory = 1;
            }
            else if (rbtnMRA.SelectedItem.Value == "NO")
            {
                Is_RAMandatory = 2;
            }

            if (rbtnRASubmitted.SelectedItem.Value == "YES")
            {
                Is_RASubmitted = 1;
            }
            else if (rbtnRASubmitted.SelectedItem.Value == "NO")
            {
                Is_RASubmitted = 2;
            }


            /* Below Filters will be added in next phase of development*/
            //if (chkAdvPPJobs.Checked == true)
            //    PostponeJob = 1;

            //if (chkAdvJWMRA.Checked == true)
            //    JobWithMandateRAssess = 1;
            //if (chkAdvJWSRA.Checked == true)
            //    JobWithSubRAssess = 1;
            //if (chkAdvJDTDD.Checked == true)
            //    JobDiffToDDock = 1;
            /* upto this Filters will be added in next phase of development*/

            ds = objJobStatus.TecJobStatusIndex(jobid, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0])
                                                , ucf_DDLRank.SelectedValues, null, txtSearchJobTitle.Text != "" ? txtSearchJobTitle.Text.Trim() : null
                                                , isCritical, isCMS, UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), UDFLib.ConvertDateToNull(txtActFrmDate.Text), UDFLib.ConvertDateToNull(txtActToDate.Text), isHistory, duedateflagesearch,
                                                IsPendingOfcVerify, SafetyAlarm, Calibration, PostponeJob, FollowupAdded, JobWithMandateRAssess, JobWithSubRAssess, JobDiffToDDock, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, RHDone, Is_RAMandatory, Is_RASubmitted, ref rowcount);


            DataTable dt = ds.Tables[0];

            DataColumnCollection columns = dt.Columns;
            if (columns.Contains("RemRhrs"))
            {
                for (int k = 0; k < dt.Rows.Count; k++)
                {
                    if (dt.Rows[k]["FREQUENCY_TYPE"] == "2484" || dt.Rows[k]["FREQUENCY_TYPE"] == "2485")
                    {
                        dt.Rows[k]["RemRhrs"] = System.DBNull.Value;
                    }
                }
            }

            if (ucCustomPagerItems.isCountRecord == 1)
            {
                ucCustomPagerItems.CountTotalRec = rowcount.ToString();
                ucCustomPagerItems.BuildPager();
            }
            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    gvStatus.DataSource = dt;
                    gvStatus.DataBind();
                }
                else
                {
                    gvStatus.DataSource = dt;
                    gvStatus.DataBind();
                }
            }

            UpdPnlGrid.Update();
            UpdPnlFilter.Update();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }