public void BindGrid()
    {
        int rowcount = 0;

        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());
        }

        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(null, null, null, null
                                                             , null, null, sortbycoloumn, sortdirection
                                                             , 1, 100, ref rowcount);



        if (dt.Rows.Count > 0)
        {
            gvDeckLogBook.DataSource = dt;
            gvDeckLogBook.DataBind();
        }
        else
        {
            gvDeckLogBook.DataSource = dt;
            gvDeckLogBook.DataBind();
        }
    }
Ejemplo n.º 2
0
    public void BindGrid()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;
        //int? isfavorite = null; if (ddlFavorite.SelectedValue != "2") isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString());
        //int? Rulecode = null; if (ddlSearchRule.SelectedValue != "0") Rulecode = Convert.ToInt32(ddlSearchRule.SelectedValue.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 = BLL_QMS_RestHours.GetRestHoursRulesSearch(null, 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)
        {
            GridViewRHRules.DataSource = ds.Tables[0];
            GridViewRHRules.DataBind();
        }
        else
        {
            GridViewRHRules.DataSource = ds.Tables[0];
            GridViewRHRules.DataBind();
        }
    }
Ejemplo n.º 3
0
    public void BindGrid()
    {
        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());
        }

        DataSet ds = BLL_QMS_RestHours.GetRestHoursRulesSearch(null, 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)
        {
            gvDeckLogBook.DataSource = ds.Tables[0];
            gvDeckLogBook.DataBind();
        }
        else
        {
            gvDeckLogBook.DataSource = ds.Tables[0];
            gvDeckLogBook.DataBind();
        }
    }
Ejemplo n.º 4
0
    public void BindGrid()
    {
        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());
        }

        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue)
                                                             , UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection
                                                             , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

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

        if (dt.Rows.Count > 0)
        {
            gvDeckLogBook.DataSource = dt;
            gvDeckLogBook.DataBind();
        }
        else
        {
            gvDeckLogBook.DataSource = dt;
            gvDeckLogBook.DataBind();
        }
    }
Ejemplo n.º 5
0
    protected void onUpdate(object source, CommandEventArgs e)
    {
        HiddenFlag.Value = "Edit";
        OperationMode    = "Edit Rule";

        DataTable dt = new DataTable();

        //dt.DefaultView.RowFilter = "ID= '" + e.CommandArgument.ToString() + "'";
        dt = BLL_QMS_RestHours.Get_RestHours_Rules_Details(int.Parse(e.CommandArgument.ToString()));

        txtDescriptionID.Text = dt.Rows[0]["ID"].ToString();
        txtDescription.Text   = dt.Rows[0]["RULE_DESCRIPTION"].ToString();
        txtValues.Text        = dt.Rows[0]["Rule_Value"].ToString();
        txtPeriod.Text        = dt.Rows[0]["Rule_Period"].ToString();
        DDLUnit.SelectedValue = dt.Rows[0]["Rule_Unit"].ToString();



        string InfoDiv = "Get_Record_Information_Details('LIB_Rule','ID=" + txtDescriptionID.Text + "')";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "InfoDiv", InfoDiv, true);



        string Rulemodal = String.Format("showModal('divadd',false);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Rulemodal", Rulemodal, true);
    }
Ejemplo n.º 6
0
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        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());
        }


        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue),
                                                             UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection
                                                             , 1, null, ref rowcount);


        string[] HeaderCaptions  = { "Vessel", "Date", "Code", "Crew Name", "Rank", "Ship's Clocked Hours", "Working Hours", "Rest Hours", "Rest Hours Any 24", "Over Time", "Seafarer's Remarks", "Verifier's Remarks" };
        string[] DataColumnsName = { "Vessel_Name", "REST_HOURS_DATE", "Staff_Code", "Staff_Name", "Staff_rank_Code", "SHIPS_CLOCKED_HOURS", "WORKING_HOURS", "REST_HOURS", "REST_HOURS_ANY24", "OverTime_HOURS", "Seafarer_Remarks", "Verifier_Remarks" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Rest Hour", "Rest_Hours_Index", "");

        //ExcelDataExport objexp = new ExcelDataExport();
        //objexp.WriteExcell(dt);
    }
Ejemplo n.º 7
0
    protected void ddlVesselList_SelectedIndexChanged(object sender, EventArgs e)
    {
        ddlCrewList.DataSource     = BLL_QMS_RestHours.CrewList_by_Date(UDFLib.ConvertDateToNull(txtFrom.Text), UDFLib.ConvertDateToNull(txtTo.Text), UDFLib.ConvertToInteger(ddlVesselList.SelectedValue));
        ddlCrewList.DataTextField  = "staff_name";
        ddlCrewList.DataValueField = "CrewID";

        ddlCrewList.DataBind();
    }
Ejemplo n.º 8
0
    private void BindRestHoursDetails()
    {
        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Report(UDFLib.ConvertDateToNull(txtFrom.Text), UDFLib.ConvertDateToNull(txtTo.Text), UDFLib.ConvertToInteger(ddlCrewList.SelectedValue), UDFLib.ConvertToInteger(ddlVesselList.SelectedValue));

        if (dt.Rows.Count > 0)
        {
            lblStaffCode.Text = dt.Rows[0]["Staff_Code"].ToString();
            lblStaffName.Text = dt.Rows[0]["Staff_Name"].ToString();
            lblStaffRank.Text = dt.Rows[0]["Staff_rank_Code"].ToString();

            txtSeafarerRemarks.Text = dt.Rows[0]["Seafarer_Remarks"].ToString();
            txtVerifierRemarks.Text = dt.Rows[0]["Verifier_Remarks"].ToString();
            lblManage.Text          = dt.Rows[0]["Manager_Code"].ToString() + "-" + dt.Rows[0]["Manager_Rank"].ToString() + "-" + dt.Rows[0]["Manager_Name"].ToString();
            lblDateofjoing.Text     = dt.Rows[0]["Joining_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Joining_Date"]).ToString("dd/MMM/yyyy") : "";
            lblDateofsignoff.Text   = dt.Rows[0]["Sign_Off_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Sign_Off_Date"]).ToString("dd/MMM/yyyy") : "";
            lblSignOn.Text          = dt.Rows[0]["Sign_On_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Sign_On_Date"]).ToString("dd/MMM/yyyy") + " " + Convert.ToDateTime(dt.Rows[0]["Sign_On_Date"]).ToString("HH:MM") : "";
            // lblManagerRank.Text = dt.Rows[0]["Manager_Rank"].ToString();
            lblRestHourDate.Text = "    Date :   " + dt.Rows[0]["REST_HOURS_DATE"].ToString();
            if (dt.Rows[0]["IsEmergency"].ToString() == "1")
            {
                chkEmergency.Checked = true;
            }
            if (dt.Rows[0]["IsArrival"].ToString() == "1")
            {
                chkArrival.Checked = true;
            }
            if (dt.Rows[0]["IsDeparture"].ToString() == "1")
            {
                chkDeparture.Checked = true;
            }
            if (dt.Rows[0]["IsDrill"].ToString() == "1")
            {
                chkDrill.Checked = true;
            }
            if (dt.Rows[0]["IsEmergencyVerify"].ToString() == "1")
            {
                chkEmergencyVerify.Checked = true;
            }
        }
        else
        {
            lblStaffCode.Text       = "";
            lblStaffName.Text       = "";
            lblStaffRank.Text       = "";
            lblDateofjoing.Text     = "";
            lblDateofsignoff.Text   = "";
            txtSeafarerRemarks.Text = "";
            txtVerifierRemarks.Text = "";
            lblManage.Text          = "";
            lblSignOn.Text          = "";
            // lblManagerRank.Text = dt.Rows[0]["Manager_Rank"].ToString();
            lblRestHourDate.Text = "";
        }
        rpDeckLogBook01.DataSource = dt;
        rpDeckLogBook01.DataBind();
    }
Ejemplo n.º 9
0
    public string asyncGet_RestHourExceptions(int RestHourID, int Vessel_ID)
    {
        Dictionary <string, UDCHyperLink> dicLink = new Dictionary <string, UDCHyperLink>();


        return(UDFLib.CreateHtmlTableFromDataTable(BLL_QMS_RestHours.Get_RestHours_Exceptions(RestHourID, Vessel_ID),
                                                   new string[] { },
                                                   new string[] { "RULE_DESCRIPTION" },
                                                   dicLink,
                                                   new Dictionary <string, UDCToolTip>(),
                                                   new string[] { "left" },
                                                   "CreateHtmlTableFromDataTable-table",
                                                   "CreateHtmlTableFromDataTable-DataHedaer",
                                                   "CreateHtmlTableFromDataTable-Data"));
    }
Ejemplo n.º 10
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (HiddenFlag.Value == "Add")
        {
            int responseid = BLL_QMS_RestHours.Insert_RestHours_Rules(txtDescription.Text.Trim(), UDFLib.ConvertIntegerToNull(txtValues.Text), UDFLib.ConvertIntegerToNull(txtPeriod.Text), DDLUnit.SelectedValue, 1, Convert.ToInt32(Session["USERID"]));
        }
        else
        {
            int responseid = BLL_QMS_RestHours.Update_RestHours_Rules(int.Parse(txtDescriptionID.Text), txtDescription.Text.Trim(), UDFLib.ConvertIntegerToNull(txtValues.Text), UDFLib.ConvertIntegerToNull(txtPeriod.Text), DDLUnit.SelectedValue, 1, Convert.ToInt32(Session["USERID"]));
        }

        BindGrid();

        string hidemodal = String.Format("hideModal('divadd')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
Ejemplo n.º 11
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        int rowcount = ucCustomPagerItems.isCountRecord;
        //int? isfavorite = null; if (ddlFavorite.SelectedValue != "2") isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString());
        //int? Rulecode = null; if (ddlSearchRule.SelectedValue != "0") Rulecode = Convert.ToInt32(ddlSearchRule.SelectedValue.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 = BLL_QMS_RestHours.GetRestHoursRulesSearch(null, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        string[] HeaderCaptions  = { "Description", "Value", "Period" };
        string[] DataColumnsName = { "Rule_Description", "Rule_Value", "Rule_Period" };

        GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "Rest Hour rules", "Resthour rules", "");
    }
Ejemplo n.º 12
0
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        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());
        }


        DataTable dt = BLL_QMS_RestHours.Get_RestHours_OverTime(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text)
                                                                , sortbycoloumn, sortdirection, 1, UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CountTotalRec), ref rowcount);


        string[] HeaderCaptions  = { "Vessel", "Staff Code", "Staff Name", "Rank", "Ship's Clocked Hours", "Rest Hours", "Work Hours", "Overtime (Hours)" };
        string[] DataColumnsName = { "Vessel_Name", "Staff_Code", "Staff_Name", "Staff_rank_Code", "Total_SHIPS_CLOCKED_HOURS", "Total_REST_HOURS", "Total_WORKING_HOURS", "Total_OVERTIME" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Overtime", "Over Time Details from  " + UDFLib.ConvertDateToNull(txtfrom.Text).Value.ToString("dd/MMM/yyyy") + " to " + UDFLib.ConvertDateToNull(txtto.Text).Value.ToString("dd/MMM/yyyy"), "");
    }
Ejemplo n.º 13
0
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        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());
        }


        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), null, null
                                                             , UDFLib.ConvertDateToNull(null), UDFLib.ConvertDateToNull(null), sortbycoloumn, sortdirection
                                                             , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        string[] HeaderCaptions  = { "Vessel", "From Date", "To Date", "Remarks" };
        string[] DataColumnsName = { "Vessel_Name", "From_Date", "To_Date", "Remarks" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "DeckLogBook", "Deck Log Book", "");
    }
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        int rowcount = 0;

        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());
        }


        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(null, null, null, null
                                                             , null, null, sortbycoloumn, sortdirection
                                                             , 1, 100, ref rowcount);


        string[] HeaderCaptions  = { "Vessel", "From Date", "To Date", "Remarks" };
        string[] DataColumnsName = { "Vessel_Name", "From_Date", "To_Date", "Remarks" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "DeckLogBook", "Deck Log Book", "");
    }
Ejemplo n.º 15
0
    private void BindRestHoursDetails()
    {
        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Details(int.Parse(Request.QueryString["ID"].ToString()), int.Parse(Request.QueryString["Vessel_ID"].ToString()));

        if (dt.Rows.Count > 0)
        {
            if (dt.Rows[0]["ReverificationRemark"].ToString().Trim().Length > 0)
            {
                txtReverification.Text    = dt.Rows[0]["ReverificationRemark"].ToString();
                txtReverification.Visible = true;
                lblRev.Visible            = true;
            }
            lblStaffCode.Text       = dt.Rows[0]["Staff_Code"].ToString();
            lblStaffName.Text       = dt.Rows[0]["Staff_Name"].ToString();
            lblStaffRank.Text       = dt.Rows[0]["Staff_rank_Code"].ToString();
            lblDateofjoing.Text     = dt.Rows[0]["Joining_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Joining_Date"]).ToString("dd/MMM/yyyy") : "";
            lblDateofsignoff.Text   = dt.Rows[0]["Sign_Off_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Sign_Off_Date"]).ToString("dd/MMM/yyyy") : "";
            lblSignOn.Text          = dt.Rows[0]["Sign_On_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Sign_On_Date"]).ToString("dd/MMM/yyyy") + " " + Convert.ToDateTime(dt.Rows[0]["Sign_On_Date"]).ToString("HH:MM") : "";
            txtSeafarerRemarks.Text = dt.Rows[0]["Seafarer_Remarks"].ToString();
            txtVerifierRemarks.Text = dt.Rows[0]["Verifier_Remarks"].ToString();
            lblManage.Text          = dt.Rows[0]["Manager_Code"].ToString() + "-" + dt.Rows[0]["Manager_Rank"].ToString() + "-" + dt.Rows[0]["Manager_Name"].ToString();
            // lblManagerRank.Text = dt.Rows[0]["Manager_Rank"].ToString();
            lblRestHourDate.Text = "    Date :   " + dt.Rows[0]["REST_HOURS_DATE"].ToString();
            if (dt.Rows[0]["IsEmergency"].ToString() == "1")
            {
                chkEmergency.Checked = true;
            }
            if (dt.Rows[0]["IsArrival"].ToString() == "1")
            {
                chkArrival.Checked = true;
            }
            if (dt.Rows[0]["IsDeparture"].ToString() == "1")
            {
                chkDeparture.Checked = true;
            }
            if (dt.Rows[0]["IsDrill"].ToString() == "1")
            {
                chkDrill.Checked = true;
            }
            if (dt.Rows[0]["IsEmergencyVerify"].ToString() == "1")
            {
                chkEmergencyVerify.Checked = true;
            }
            if (dt.Rows[0]["IsOthers"].ToString() == "1")
            {
                chkOther.Checked = true;
            }
            rpDeckLogBook01.DataSource = dt;
            rpDeckLogBook01.DataBind();

            lnkCreated.Text        = dt.Rows[0]["Created_By_name"].ToString();
            lnkCreated.NavigateUrl = "~/crew/crewdetails.aspx?ID=" + dt.Rows[0]["Created_By_Crew"].ToString();
            lnkCreated.Target      = "_blank";
            imgCreated.ImageUrl    = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/uploads/CrewImages/" + dt.Rows[0]["PhotoUrl3"].ToString();
            lnkCreated.Visible     = true;
            imgCreated.Visible     = true;



            lnkModif.Text        = dt.Rows[0]["Modified_By_name"].ToString();
            lnkModif.NavigateUrl = "~/crew/crewdetails.aspx?ID=" + dt.Rows[0]["Modified_By_Crew"].ToString();
            lnkModif.Target      = "_blank";
            imgModif.ImageUrl    = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/uploads/CrewImages/" + dt.Rows[0]["PhotoURL4"].ToString();
            lnkModif.Visible     = true;
            imgModif.Visible     = true;

            lnkVerified.Text        = dt.Rows[0]["Modified_By_name"].ToString();
            lnkVerified.NavigateUrl = "~/crew/crewdetails.aspx?ID=" + dt.Rows[0]["Modified_By_Crew"].ToString();
            lnkVerified.Target      = "_blank";
            imgVerified.ImageUrl    = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/uploads/CrewImages/" + dt.Rows[0]["PhotoURL4"].ToString();
            lnkVerified.Visible     = true;
            imgVerified.Visible     = true;
        }
    }
Ejemplo n.º 16
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Report(UDFLib.ConvertDateToNull(txtFrom.Text), UDFLib.ConvertDateToNull(txtTo.Text), UDFLib.ConvertToInteger(ddlCrewList.SelectedValue), UDFLib.ConvertToInteger(ddlVesselList.SelectedValue));



        string[] HeaderCaptions = { "Date",       "Ship's Clocked Hours",
                                    "0",          "0",                   "1",                           "0",         "2",
                                    "0",          "3",                   "0",                           "4",
                                    "0",          "5",                   "0",                           "6",
                                    "0",          "7",                   "0",                           "8",
                                    "0",          "9",                   "1",                           "0",
                                    "1",          "1",                   "1",                           "2",
                                    "1",          "3",                   "1",                           "4",
                                    "1",          "5",                   "1",                           "6",
                                    "1",          "7",                   "1",                           "8",
                                    "1",          "9",                   "2",                           "0",
                                    "2",          "1",                   "2",                           "2",
                                    "2",          "3",                   "",
                                    "Work Hours", "Rest Hours",          "Rest Hours in Any 24 Hours",  "Over Time", "Rest Hour In 7-Day Period","Seafarer's Remark", "Verifier's Remark" };
        string[] DataColumnsName = { "REST_HOURS_DATE", "SHIPS_CLOCKED_HOURS",
                                     "WH_0000_0030",    "WH_0030_0100",       "WH_0100_0130",      "WH_0130_0200",
                                     "WH_0200_0230",    "WH_0230_0300",       "WH_0300_0330",      "WH_0330_0400",
                                     "WH_0400_0430",    "WH_0430_0500",       "WH_0500_0530",      "WH_0530_0600",
                                     "WH_0600_0630",    "WH_0630_0700",       "WH_0700_0730",      "WH_0730_0800",
                                     "WH_0800_0830",    "WH_0830_0900",       "WH_0900_0930",      "WH_0930_1000",
                                     "WH_1000_1030",    "WH_1030_1100",       "WH_1100_1130",      "WH_1130_1200",
                                     "WH_1200_1230",    "WH_1230_1300",       "WH_1300_1330",      "WH_1330_1400",
                                     "WH_1400_1430",    "WH_1430_1500",       "WH_1500_1530",      "WH_1530_1600",
                                     "WH_1600_1630",    "WH_1630_1700",       "WH_1700_1730",      "WH_1730_1800",
                                     "WH_1800_1830",    "WH_1830_1900",       "WH_1900_1930",      "WH_1930_2000",
                                     "WH_2000_2030",    "WH_2030_2100",       "WH_2100_2130",      "WH_2130_2200",
                                     "WH_2200_2230",    "WH_2230_2300",       "WH_2300_2330",      "WH_2330_2400",

                                     "WORKING_HOURS",   "REST_HOURS",         "REST_HOURS_ANY24",  "OverTime_HOURS","RestHrs7Day","Seafarer_Remarks", "Verifier_Remarks" };



        List <string> lColName = new List <string>();

        for (int i = 0; i < dt.Columns.Count; i++)
        {
            string lCoumnName = dt.Columns[i].ToString();
            if (lCoumnName.StartsWith("WH_"))
            {
                lColName.Add(lCoumnName);
            }
        }

        foreach (string itemc in lColName)
        {
            ChangeColumnDataType(dt, itemc, typeof(string));
        }

        foreach (DataRow item in dt.Rows)
        {
            foreach (DataColumn ColumnName in dt.Columns)
            {
                if (ColumnName.ToString().StartsWith("WH_"))
                {
                    if (item[ColumnName.ToString()].ToString() == "0")
                    {
                        item[ColumnName.ToString()] = DBNull.Value;
                    }
                    else
                    {
                        item[ColumnName.ToString()] = "&#10003;";
                    }
                }
            }
        }



        //GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "CrewHandOver.xls", "Crew Handover");
        if (dt.Rows.Count > 0)
        {
            GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "CrewRestHoursReport.xls", "Rest/Work Hour Report for " + dt.Rows[0]["Staff_rank_Code"] + "-" + dt.Rows[0]["Staff_Code"] + "-" + dt.Rows[0]["Staff_Name"]);
        }
        else
        {
            string msg = String.Format("alert('Records not found!');");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
        }
    }
Ejemplo n.º 17
0
    protected void onDelete(object source, CommandEventArgs e)
    {
        int retval = BLL_QMS_RestHours.Delete_RestHours_Rules(Convert.ToInt32(e.CommandArgument.ToString()), Convert.ToInt32(Session["USERID"]));

        BindGrid();
    }