示例#1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        try
        {
            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());
            }

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataTable      dt     = objBLL.CRUD_School("", "R", 0, 0, txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection, null, null, ref rowcount, ref Result);

            string[] HeaderCaptions  = { "School" };
            string[] DataColumnsName = { "School" };

            GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "School", "School", "");
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
示例#2
0
    private void BindGrid()
    {
        BLL_Crew_Admin obj = new BLL_Crew_Admin();
        DataTable      dt  = obj.Get_Manning_Report();

        grdManning.DataSource = dt;
        grdManning.DataBind();
    }
示例#3
0
    protected void LoadInterviewSheet(int RankId)
    {
        ddlInterviewSheet.Items.Clear();
        BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();

        ddlInterviewSheet.DataSource = objCrewAdmin.Get_InterviewSheets(RankId, "Interview");
        ddlInterviewSheet.DataBind();
        ddlInterviewSheet.Items.Insert(0, new ListItem("-Select-", "0"));
    }
    public void Load_RankList()
    {
        BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();

        ddlRank.DataSource     = objCrewAdmin.Get_RankList();
        ddlRank.DataTextField  = "Rank_Short_Name";
        ddlRank.DataValueField = "ID";
        ddlRank.DataBind();
        ddlRank.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
    }
    protected void Load_Rank_Category()
    {
        BLL_Crew_Admin objBLL = new BLL_Crew_Admin();

        ddlRankCategory.DataSource     = objBLL.Get_RankCategories();
        ddlRankCategory.DataTextField  = "category_name";
        ddlRankCategory.DataValueField = "id";
        ddlRankCategory.DataBind();
        ddlRankCategory.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
    }
    public void Load_RankList()
    {
        BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
        DataTable      dt           = objCrewAdmin.Get_RankList();

        DDLRank.DataSource     = dt;
        DDLRank.DataTextField  = "Rank_Short_Name";
        DDLRank.DataValueField = "ID";
        DDLRank.DataBind();
    }
    public void Load_RankList()
    {
        BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
        DataTable      dt           = objCrewAdmin.Get_RankList();

        ddlCrewInvloveRank.DataSource     = dt;
        ddlCrewInvloveRank.DataTextField  = "Rank_Short_Name";
        ddlCrewInvloveRank.DataValueField = "ID";
        ddlCrewInvloveRank.DataBind();
        ddlCrewInvloveRank.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
        ddlCrewInvloveRank.SelectedIndex = 0;
    }
    /// <summary>
    /// Method to load cre  ranks drop down
    /// </summary>
    protected void BindRanks()
    {
        BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
        DataTable      dt           = objCrewAdmin.Get_RankList();

        ddlRank.DataSource     = dt;
        ddlRank.DataTextField  = "Rank_Short_Name";
        ddlRank.DataValueField = "ID";
        ddlRank.DataBind();

        ddlRank.Items.Insert(0, new ListItem("--Select--", "0"));
    }
示例#9
0
    protected void btnSaveUnionBranch_OnClick(object sender, EventArgs e)
    {
        try
        {
            DataTable      dt       = new DataTable();
            BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
            int            rowcount = 0;

            if (Convert.ToInt32(hdnUnionBranchID.Value) > 0)
            {
                if (hdnAddressType.Value == "1")
                {
                    dt = objBLL.CRUD_UnionBranchUS(txtUnionBranch.Text.Trim(), Convert.ToInt32(hdnUnionBranchID.Value), Convert.ToInt32(drpUnion.SelectedValue), txtAddress.Text.Trim(), Convert.ToInt32(drpCountry.SelectedValue), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "U", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }
                else
                {
                    dt = objBLL.CRUD_UnionBranch(txtUnionBranch.Text.Trim(), Convert.ToInt32(hdnUnionBranchID.Value), Convert.ToInt32(drpUnion.SelectedValue), txtAddressLine1.Text.Trim(), txtAddressLine2.Text.Trim(), txtCity.Text.Trim(), txtState.Text, Convert.ToInt32(drpCountry.SelectedValue), txtZipCode.Text.Trim(), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "U", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }

                if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/UpdateMessage") + "');hideModal('divAddUnionBranch');", true);
                }
            }
            else
            {
                if (hdnAddressType.Value == "1")
                {
                    dt = objBLL.CRUD_UnionBranchUS(txtUnionBranch.Text.Trim(), 0, Convert.ToInt32(drpUnion.SelectedValue), txtAddress.Text.Trim(), Convert.ToInt32(drpCountry.SelectedValue), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "I", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }
                else
                {
                    dt = objBLL.CRUD_UnionBranch(txtUnionBranch.Text.Trim(), 0, Convert.ToInt32(drpUnion.SelectedValue), txtAddressLine1.Text.Trim(), txtAddressLine2.Text.Trim(), txtCity.Text.Trim(), txtState.Text, Convert.ToInt32(drpCountry.SelectedValue), txtZipCode.Text.Trim(), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "I", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }

                if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/SaveMessage") + "');hideModal('divAddUnionBranch');", true);
                }
            }

            if (Result < 0)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('The selected Union Branch already exist in the system');showModal('divAddUnionBranch', false);", true);
            }
            BindUnionBranch();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
示例#10
0
    public void Load_RankList(DropDownList ddlRank)
    {
        if (ddlRank.Items.Count == 0)
        {
            BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
            DataTable      dt           = objCrewAdmin.Get_RankList();

            ddlRank.DataSource     = dt;
            ddlRank.DataTextField  = "Rank_Short_Name";
            ddlRank.DataValueField = "ID";
            ddlRank.DataBind();
            ddlRank.Items.Insert(0, new ListItem("-SELECT-", "0"));
        }
    }
    protected void LoadInterviewSheet(int RankId)
    {
        (frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).Items.Clear();
        BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
        DataTable      dt           = objCrewAdmin.Get_InterviewSheets(RankId, "Interview");

        (frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).DataSource     = dt;
        (frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).DataTextField  = "INTERVIEW_NAME";
        (frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).DataValueField = "ID";
        (frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).DataBind();

        (frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).Items.Insert(0, new ListItem("-SELECT-", "0"));
        (frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).SelectedIndex = 0;
    }
    public void BindRank()
    {
        BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
        DataTable      dt           = objCrewAdmin.Get_RankList();

        chkRank1.DataSource     = dt;
        chkRank1.DataTextField  = "Rank_Name";
        chkRank1.DataValueField = "ID";
        chkRank1.DataBind();


        chkRank2.DataSource     = dt;
        chkRank2.DataTextField  = "Rank_Name";
        chkRank2.DataValueField = "ID";
        chkRank2.DataBind();
    }
示例#13
0
    /// <summary>
    /// Delete Oil Major
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void onDeleteUnionBook(object source, CommandEventArgs e)
    {
        try
        {
            int            rowcount = 0;
            BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
            DataTable      dt       = objBLL.CRUD_UnionBook("", "D", GetSessionUserID(), Convert.ToInt32(e.CommandArgument.ToString()), null, "", null, null, null, ref rowcount, ref Result);
            if (Result > 0)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ShowMessage", "alert('Record deleted successfully')", true);
            }

            BindUnionBook();
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
示例#14
0
    protected void btnSavePermanent_Click(object sender, EventArgs e)
    {
        int Result = 1;

        try
        {
            if (Convert.ToInt32(hdnStatusID.Value) > 0)
            {
                int            rowcount = 0;
                BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
                DataTable      dt       = objBLL.CRUD_PermanentStatus(txtPermanent.Text.Trim(), "U", GetSessionUserID(), Convert.ToInt32(hdnStatusID.Value), "", "", null, null, null, ref rowcount, ref Result).Tables[0];

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('The selected status already exist in the system');showModal('divAddStatus', false);", true);
                }
                else if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/UpdateMessage") + "');hideModal('divAddStatus');", true);
                    BindPermamnentStatus();
                }
            }
            else
            {
                int            rowcount = 0;
                BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
                DataTable      dt       = objBLL.CRUD_PermanentStatus(txtPermanent.Text.Trim(), "I", GetSessionUserID(), 0, "", "", null, null, null, ref rowcount, ref Result).Tables[0];

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('The selected status already exist in the system');showModal('divAddStatus', false);", true);
                }
                else if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/SaveMessage") + "');hideModal('divAddStatus');", true);
                    BindPermamnentStatus();
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    public void BindRank()
    {
        try
        {
            BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
            DataTable      dt           = objCrewAdmin.Get_RankList();

            chkRank.DataSource     = dt;
            chkRank.DataTextField  = "Rank_Name";
            chkRank.DataValueField = "ID";
            chkRank.DataBind();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
示例#16
0
    private void BindRankDDL()
    {
        try
        {
            BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
            DataTable      dtRank       = new DataTable();
            dtRank = objCrewAdmin.Get_RankList();

            ddlRank.DataSource     = dtRank;
            ddlRank.DataTextField  = "Rank_Short_Name";
            ddlRank.DataValueField = "ID";

            ddlRank.DataBind();
            ddlRank.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
        }
        catch
        {
        }
    }
示例#17
0
    protected void BindPermamnentStatus()
    {
        try
        {
            int    rowcount      = ucCustomPagerPermanent.isCountRecord;
            int    Result        = 1;
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataSet        dt     = objBLL.CRUD_PermanentStatus("", "R", 0, 0, txtPermanentFilter.Text != "" ? txtPermanentFilter.Text : null, sortbycoloumn, sortdirection
                                                                , ucCustomPagerPermanent.CurrentPageIndex, ucCustomPagerPermanent.PageSize, ref rowcount, ref Result);

            if (dt != null)
            {
                if (ucCustomPagerPermanent.isCountRecord == 1)
                {
                    ucCustomPagerPermanent.CountTotalRec = rowcount.ToString();
                    ucCustomPagerPermanent.BuildPager();
                }
                if (dt.Tables[0].Rows.Count > 0)
                {
                    gvPermanentStatus.DataSource = dt.Tables[0];
                    gvPermanentStatus.DataBind();
                }
                else
                {
                    gvPermanentStatus.DataSource = null;
                    gvPermanentStatus.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
示例#18
0
    /// <summary>
    /// Bind School
    /// </summary>
    public void BindUnionBook()
    {
        try
        {
            int rowcount = ucCustomPager1UnionBook.isCountRecord;

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

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataTable      dt     = objBLL.CRUD_UnionBook("", "R", 0, 0, txtUnionBookFilter.Text != "" ? txtUnionBookFilter.Text : null, sortbycoloumn, sortdirection
                                                          , ucCustomPager1UnionBook.CurrentPageIndex, ucCustomPager1UnionBook.PageSize, ref rowcount, ref Result);


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

            if (dt.Rows.Count > 0)
            {
                gvUnionBook.DataSource = dt;
                gvUnionBook.DataBind();
                ImgBtnExportUnionBook.Visible = true;
            }
            else
            {
                gvUnionBook.DataSource = null;
                gvUnionBook.DataBind();
                ImgBtnExportUnionBook.Visible = false;
            }
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
    private void BindVeteranStatus()
    {
        try
        {
            int rowcount = ucCustomPagerItemsVeteranStatus.isCountRecord;

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

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataTable      dt     = objBLL.CRUD_VeteranStatus("", "R", 0, 0, txtVeteranStatusFilter.Text != "" ? txtVeteranStatusFilter.Text : null, sortbycoloumn, sortdirection
                                                              , ucCustomPagerItemsVeteranStatus.CurrentPageIndex, ucCustomPagerItemsVeteranStatus.PageSize, ref rowcount, ref Result);


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

            if (dt.Rows.Count > 0)
            {
                gvVeteranStatus.DataSource = dt;
                gvVeteranStatus.DataBind();
                ImgExpExcelVeteran.Visible = true;
            }
            else
            {
                gvVeteranStatus.DataSource = null;
                gvVeteranStatus.DataBind();
                ImgExpExcelVeteran.Visible = false;
            }
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
    protected void rdblstAppType_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (hfType.Value != null && hfType.Value.ToString() != "")
        {
            if (hfType.Value.ToString() == "1")
            {
                pnlOffice.Visible           = true;
                pnlVessel.Visible           = false;
                rdblstAppType.SelectedIndex = 0;
            }
            else
            {
                pnlOffice.Visible           = false;
                pnlVessel.Visible           = true;
                rdblstAppType.SelectedIndex = 1;
                BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
                DataTable      dt           = objCrewAdmin.Get_RankList();
                gvRankList.DataSource = dt;
                gvRankList.DataBind();
            }
        }
        //if (rdblstAppType.SelectedValue == "1")
        //{
        //    pnlOffice.Visible = true;
        //    pnlVessel.Visible = false;
        //    ViewState["Mode"] = "1";
        //}
        //else
        //{
        //    pnlOffice.Visible = false;
        //    pnlVessel.Visible = true;
        //    ViewState["Mode"] = "0";
        //}



        //BindApprovar(  Work_Categ_ID,"RD");
    }
示例#21
0
    /// <summary>
    /// Bind Oil Majors
    /// </summary>
    public void BindOilMajors()
    {
        try
        {
            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());
            }

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataTable      dt     = objBLL.CRUD_OilMajors("", "", "R", 0, 0, txtfilter.Text != "" ? txtfilter.Text.Trim() : null, sortbycoloumn, sortdirection
                                                          , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, txtRemarks.Text, 0, "", ref rowcount, ref Result);


            if (ucCustomPagerItems.isCountRecord == 1)
            {
                ucCustomPagerItems.CountTotalRec = rowcount.ToString();
                ucCustomPagerItems.BuildPager();
            }
            gvOilMajors.DataSource = dt;
            gvOilMajors.DataBind();

            if (dt.Rows.Count > 0)
            {
                ImgExpExcel.Visible = true;
            }
            else
            {
                ImgExpExcel.Visible = false;
            }
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
 /// <summary>
 /// Method is used to bind Oil major dropdown
 /// </summary>
 public void FillOilMajorDropdown()
 {
     try
     {
         DataSet        dsOilMajor = new DataSet();
         BLL_Crew_Admin objCrew    = new BLL_Crew_Admin();
         dsOilMajor = objCrew.GetOilMajor();
         if (dsOilMajor.Tables.Count > 0)
         {
             if (dsOilMajor.Tables[0].Rows.Count > 0)
             {
                 ddlOilMajor.DataSource     = dsOilMajor.Tables[0];
                 ddlOilMajor.DataTextField  = dsOilMajor.Tables[0].Columns["Display_Name"].ToString();
                 ddlOilMajor.DataValueField = dsOilMajor.Tables[0].Columns["ID"].ToString();
                 ddlOilMajor.DataBind();
                 ddlOilMajor.Items.Insert(0, new ListItem("-SELECT-", "0"));
             }
         }
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
     }
 }
示例#23
0
    /// <summary>
    /// Bind Union
    /// </summary>
    public void BindUnion()
    {
        try
        {
            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());
            }

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataSet        dt     = objBLL.CRUD_Union("", "R", 0, 0, txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection
                                                      , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount, ref Result);


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

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

                drpUnion.DataSource     = dt.Tables[0];
                drpUnion.DataTextField  = "UnionName";
                drpUnion.DataValueField = "ID";
                drpUnion.DataBind();
                drpUnion.Items.Insert(0, new ListItem()
                {
                    Text = "-Select-", Value = "0"
                });

                divBranch.Visible        = false;
                gvUnionBranch.DataSource = null;
                gvUnionBranch.DataBind();
            }
            else
            {
                gvUnion.DataSource = null;
                gvUnion.DataBind();
            }
            if (dt.Tables[1].Rows.Count > 0)
            {
                drpCountry.DataSource     = dt.Tables[1];
                drpCountry.DataTextField  = "Country_Name";
                drpCountry.DataValueField = "ID";
                drpCountry.DataBind();
                drpCountry.Items.Insert(0, new ListItem()
                {
                    Text = "-Select-", Value = "0"
                });

                dt.Tables[1].DefaultView.RowFilter = "";
                dt.Tables[1].DefaultView.RowFilter = "ISO_Code='US'";
                if (dt.Tables[1].DefaultView.Count > 0)
                {
                    hdnUSCountryID.Value = Convert.ToString(dt.Tables[1].DefaultView[0]["ID"]);
                }
            }
            if (dt.Tables[2].Rows.Count > 0)
            {
                ///0- US Client
                ///1- International Client
                if (Convert.ToInt32(dt.Tables[2].Rows[0]["Value"]) == 0)
                {
                    hdnAddressType.Value         = "0";
                    trUSAddress.Visible          = true;
                    trInternationAddress.Visible = false;
                }
                else
                {
                    hdnAddressType.Value         = "1";
                    trInternationAddress.Visible = true;
                    trUSAddress.Visible          = false;
                }
            }
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
示例#24
0
    /// <summary>
    /// To save or update oil major
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnsave_OnClick(object sender, EventArgs e)
    {
        string path         = "";
        int    ActiveStatus = 0;

        if (chkIsActive.Checked == true)
        {
            ActiveStatus = 1;
        }
        else
        {
            ActiveStatus = 0;
        }
        try
        {
            if (hdnUploadFileName.Value != "")
            {
                FileInfo fn       = new FileInfo(hdnUploadFileName.Value);
                Guid     gid      = Guid.NewGuid();
                string   filename = "OLM_" + gid + fn.Extension;
                path = "~/Uploads/OilMajorLogo/" + filename;

                FileUpload1.SaveAs(Server.MapPath("~/Uploads/OilMajorLogo/" + filename));
            }
            if (txtDisplayName.Text == "")
            {
                txtDisplayName.Text = txtOilMajorName.Text.Trim();
            }
            if (Convert.ToInt32(hdnOilMajorID.Value) > 0)
            {
                OperationMode = "Add/Edit Oil Major";

                int            rowcount = 0;
                BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
                DataTable      dt       = objBLL.CRUD_OilMajors(txtOilMajorName.Text.Trim(), txtDisplayName.Text.Trim(), "U", GetSessionUserID(), Convert.ToInt32(hdnOilMajorID.Value), null, "", null, null, null, txtRemarks.Text, ActiveStatus, path, ref rowcount, ref Result);

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("InformationMessage/DataExists") + "');showModal('divadd', false);", true);
                }
                if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/UpdateMessage") + "');hideModal('divadd');", true);
                    hdnUploadFileName.Value = "";
                    BindOilMajors();
                }
            }
            else
            {
                OperationMode = "Add Oil Major";
                int            rowcount = 0;
                BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
                DataTable      dt       = objBLL.CRUD_OilMajors(txtOilMajorName.Text.Trim(), txtDisplayName.Text.Trim(), "I", GetSessionUserID(), 0, null, "", null, null, null, txtRemarks.Text, ActiveStatus, path, ref rowcount, ref Result);

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("InformationMessage/DataExists") + "');showModal('divadd', false);", true);
                }
                if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/SaveMessage") + "');hideModal('divadd');", true);
                    BindOilMajors();
                }
            }
            // it will clear all the values and avoid adding the Duplicate records !Desc:- when one intend to page refreseh ,javascript alert msg raise, says it will perform the same action again,so value might gets duplicate , so we can avoid this by below code
            //Response.Redirect(Request.Url.AbsoluteUri);
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
示例#25
0
    protected void lnkEditInterviewPlanning_Click()
    {
        BLL_Crew_Admin       objCrewAdmin = new BLL_Crew_Admin();
        BLL_Crew_CrewDetails objCrewBLL   = new BLL_Crew_CrewDetails();
        BLL_Infra_TimeZones  objTimeZone  = new BLL_Infra_TimeZones();

        try
        {
            int CrewID        = int.Parse(hdnCrewID.Value);
            int CurrentRankId = 0;
            if (objCrewBLL.Get_CrewPersonalDetailsByID(CrewID, "CurrentRankID") != null && objCrewBLL.Get_CrewPersonalDetailsByID(CrewID, "CurrentRankID") != "")
            {
                CurrentRankId = int.Parse(objCrewBLL.Get_CrewPersonalDetailsByID(CrewID, "CurrentRankID"));
            }
            LoadInterviewSheet(CurrentRankId);
            ddlPlanRank.DataSource = objCrewAdmin.Get_RankList();
            ddlPlanRank.DataBind();
            ddlPlanRank.Enabled = false;

            ddlInterviewRank.DataSource = objCrewAdmin.Get_RankList();
            ddlInterviewRank.DataBind();

            DataTable dt = objTimeZone.Get_TimeZoneList();
            ddlTimeZone.DataSource     = dt;
            ddlTimeZone.DataTextField  = "DisplayName";
            ddlTimeZone.DataValueField = "TimeZone";
            ddlTimeZone.DataBind();
            try
            {
                DataRow[] dr = dt.Select("DefaultTimeZone=1");
                if (dr.Length > 0)
                {
                    ddlTimeZone.SelectedValue = dr[0]["TimeZone"].ToString();
                }
            }
            catch { }

            string rank = objCrewBLL.Get_CrewPersonalDetailsByID(CrewID, "CurrentRankID");
            if (rank != "")
            {
                ddlPlanRank.SelectedValue      = rank;
                ddlInterviewRank.SelectedValue = rank;
            }
            else
            {
                ddlPlanRank.SelectedIndex = 0;
            }

            int IsMandatoryDocumentsUploaded = objCrewBLL.IsMandatoryDocumentsUploaded(CrewID);

            if (IsMandatoryDocumentsUploaded == 0)
            {
                lblMessage.Text = "Interview can not be planned for the crew. The necessery documents are not yet uploaded!!";
                return;
            }
        }
        catch { }

        pnlEdit_InterviewPlanning.Visible = true;
        pnlView_InterviewPlanning.Visible = false;
    }
示例#26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // show office portage only if office portage bill has been considered for any joining type//



        string arg = Request.QueryString["arg"].ToString();

        string[] arr;
        if (arg != null && arg.Length > 0)
        {
            arr = arg.Split('~');

            ViewState["Vessel_ID"]   = UDFLib.ConvertToInteger(arr[0]);
            ViewState["PBDt"]        = DateTime.Parse(arr[1]);
            ViewState["Vessel_Name"] = arr[2];
        }

        if (UDFLib.ConvertToInteger(ViewState["Vessel_ID"]) > 0)
        {
            BLL_Crew_Admin objAdm  = new BLL_Crew_Admin();
            DataTable      dtJtype = objAdm.Get_JoiningType_List(null);

            BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib();
            DataTable           dtVsl  = objVsl.GetVesselDetails_ByID(Convert.ToInt32(ViewState["Vessel_ID"]));

            if (dtJtype.Rows.Count > 0 && dtVsl.Rows.Count > 0)
            {
                // for office vessel only
                if (dtJtype.Select("OfficePortageBillConsidered=1").Length > 0 && UDFLib.ConvertToInteger(dtVsl.Rows[0]["ISVESSEL"]) == 0)
                {
                    btnGeneratePortageBill.Visible = true;
                    btnFinalizePortageBill.Visible = true;
                    DataTable dtOPPbill = BLL_PB_PortageBill.Get_Open_PortageBill();
                    if (dtOPPbill.Rows.Count > 0 && Convert.ToString(dtOPPbill.Rows[0]["GENERATE_PB"]).Trim().Length > 1)
                    {
                        ViewState["Open_PB_Month"] = Convert.ToDateTime(dtOPPbill.Rows[0]["PB_GEN_DATE"]).Month;
                        ViewState["Open_PB_Year"]  = Convert.ToDateTime(dtOPPbill.Rows[0]["PB_GEN_DATE"]).Year;
                    }

                    // if open pbill is same as requested then generate pbill //
                    if (int.Parse(ViewState["Open_PB_Month"].ToString()) == DateTime.Parse(ViewState["PBDt"].ToString()).Month&& int.Parse(ViewState["Open_PB_Year"].ToString()) == DateTime.Parse(ViewState["PBDt"].ToString()).Year)
                    {
                        BLL_PB_PortageBill.Upd_Generate_PortageBill(ViewState["Open_PB_Month"].ToString(), ViewState["Open_PB_Year"].ToString(), Convert.ToInt32(ViewState["Vessel_ID"]), Convert.ToInt32(Session["USERID"]), null);
                    }
                    else
                    {
                        btnGeneratePortageBill.Visible = false;
                        btnFinalizePortageBill.Visible = false;
                    }
                }
                else
                {
                    btnGeneratePortageBill.Visible = false;
                    btnFinalizePortageBill.Visible = false;
                }
            }


            Load_PortageBill();
        }


        UserAccessValidation();
    }
示例#27
0
    public string ValidateUSAddress(string AddressLine1, string AddressLine2, string City, string State, string ZipCode, string Country, string Type, string CrewName, string ClientName, string Mode, string StaffCode, string DOB, string AppliedRank)
    {
        StringBuilder Return = new StringBuilder();

        BLL_Crew_Admin objBLL_Crew_Admin = new BLL_Crew_Admin();
        DataTable      dt = objBLL_Crew_Admin.CRW_LIB_AddressValidationSetting();
        string         Url = "", Username = "", Password = "", ToEmailId = "", FromEmailId = "", EmailBody = "";

        try
        {
            var           requestXml     = new XmlDocument();
            StringBuilder strURLParamter = new StringBuilder();

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    dt.DefaultView.RowFilter = "key='USPSUrl'";
                    Url = Convert.ToString(dt.DefaultView[0]["Value"]).Trim();

                    dt.DefaultView.RowFilter = "";
                    dt.DefaultView.RowFilter = "key='Username'";
                    Username = Convert.ToString(dt.DefaultView[0]["Value"]).Trim();

                    dt.DefaultView.RowFilter = "";
                    dt.DefaultView.RowFilter = "key='Password'";
                    Password = Convert.ToString(dt.DefaultView[0]["Value"]).Trim();

                    dt.DefaultView.RowFilter = "";
                    dt.DefaultView.RowFilter = "key='ToEmailId'";
                    ToEmailId = Convert.ToString(dt.DefaultView[0]["Value"]).Trim();

                    dt.DefaultView.RowFilter = "";
                    dt.DefaultView.RowFilter = "key='FromEmailId'";
                    FromEmailId = Convert.ToString(dt.DefaultView[0]["Value"]).Trim();

                    dt.DefaultView.RowFilter = "";
                    dt.DefaultView.RowFilter = "key='EmailBody'";
                    EmailBody = Convert.ToString(dt.DefaultView[0]["Value"]).Trim();

                    if (Url != "" && Username != "" && Password != "")
                    {
                        strURLParamter.Append("<AddressValidateRequest USERID=\"" + Username + "\">");

                        strURLParamter.Append("<Address ID=\"0\">");
                        strURLParamter.Append("<FirmName />");
                        strURLParamter.Append("<Address1>" + AddressLine1.Trim() + "</Address1>");
                        strURLParamter.Append("<Address2>" + AddressLine2.Trim() + "</Address2>");
                        strURLParamter.Append("<City>" + City.Trim() + "</City>");
                        strURLParamter.Append("<State>" + State.Trim() + "</State>");
                        strURLParamter.Append("<Zip5>" + ZipCode.Trim() + "</Zip5>");
                        strURLParamter.Append("<Zip4></Zip4>");
                        strURLParamter.Append("</Address>");
                        strURLParamter.Append("</AddressValidateRequest>");

                        // build XML request

                        var httpRequest = HttpWebRequest.Create(Url + "?API=Verify&XML=" + strURLParamter.ToString());
                        httpRequest.Method      = "POST";
                        httpRequest.ContentType = "text/xml";

                        // set appropriate headers

                        using (var requestStream = httpRequest.GetRequestStream())
                        {
                            requestXml.Save(requestStream);
                        }

                        using (var response = (HttpWebResponse)httpRequest.GetResponse())
                            using (var responseStream = response.GetResponseStream())
                            {
                                // may want to check response.StatusCode to
                                // see if the request was successful

                                var responseXml = new XmlDocument();
                                responseXml.Load(responseStream);
                                if (responseXml.SelectSingleNode("//Error") != null)
                                {
                                    XmlNodeList objXmlNode = responseXml.SelectNodes("AddressValidateResponse/Address/Error");
                                    if (objXmlNode != null)
                                    {
                                        foreach (XmlNode item in objXmlNode)
                                        {
                                            Return.Append("Result:Invalid,");
                                            Return.Append("ErrorMessage: " + item["Description"].InnerText);
                                        }
                                    }
                                }
                                else
                                {
                                    XmlNodeList objXmlNode = responseXml.SelectNodes("AddressValidateResponse/Address");
                                    if (objXmlNode != null)
                                    {
                                        foreach (XmlNode item in objXmlNode)
                                        {
                                            string Address1 = "", Address2 = "";
                                            if (item["Address1"] != null)
                                            {
                                                Address1 = item["Address1"].InnerText;
                                                if (item["Address1"].InnerText.Contains("#"))
                                                {
                                                    AddressLine1 = "# " + AddressLine1;
                                                }
                                            }
                                            if (item["Address2"] != null)
                                            {
                                                Address2 = item["Address2"].InnerText;
                                                if (item["Address2"].InnerText.Contains("#"))
                                                {
                                                    AddressLine2 = "# " + AddressLine2;
                                                }
                                            }

                                            if (AddressLine1.ToLower() != Address1.ToLower() || AddressLine2.ToLower() != Address2.ToLower() || City.ToLower() != item["City"].InnerText.ToLower() || State.ToLower() != item["State"].InnerText.ToLower() || ZipCode.ToLower() != item["Zip5"].InnerText.ToLower())
                                            {
                                                Return.Append("Result:ValidAddress,");
                                                Return.Append("Address Line 1: " + Address2 + ",");
                                                Return.Append("Address Line 2: " + Address1 + ",");
                                                Return.Append("City: " + item["City"].InnerText + ",");
                                                Return.Append("State: " + item["State"].InnerText + ",");
                                                Return.Append("ZipCode: " + item["Zip5"].InnerText);
                                            }
                                            else
                                            {
                                                Return.Append("Result:Valid");
                                            }
                                        }
                                    }
                                }
                            }
                    }
                    else
                    {
                        Return.Append("Result:No Settings");//No setting exists in DB
                    }
                }
                else
                {
                    Return.Append("Result:No Settings");
                }
            }
            else
            {
                Return.Append("Result:No Settings");
            }
        }
        catch (Exception ex)
        {
            if (Type == "Crew")
            {
                if (!ex.ToString().ToLower().Contains(":line"))
                {
                    BLL_Crew_CrewDetails objCrew = new BLL_Crew_CrewDetails();
                    EmailBody = EmailBody.Replace("$$Client$$", ClientName);
                    EmailBody = EmailBody.Replace("$$CrewName$$", CrewName);
                    EmailBody = EmailBody.Replace("$$Date$$", DateTime.Now.ToString());
                    EmailBody = EmailBody.Replace("$$Status$$", ex.ToString());
                    EmailBody = StaffCode == "" ? EmailBody.Replace("$$StaffCode$$", "-") : EmailBody.Replace("$$StaffCode$$", StaffCode);
                    EmailBody = DOB == "" ? EmailBody.Replace("$$DOB$$", "-") : EmailBody.Replace("$$DOB$$", DOB);
                    EmailBody = AppliedRank == "" ? EmailBody.Replace("$$AppliedRank$$", "-") : EmailBody.Replace("$$AppliedRank$$", AppliedRank);

                    if (Mode == "Add")
                    {
                        EmailBody = EmailBody.Replace("$$Remark$$", "USPS service is down/not responding while adding the crew.");
                    }
                    else if (Mode == "Edit")
                    {
                        EmailBody = EmailBody.Replace("$$Remark$$", "USPS service is down/not responding while updating the crew.");
                    }

                    objCrew.Send_CrewNotification(0, 0, 0, 0, ToEmailId, "", "", ClientName + "- USPS Service Error", EmailBody, "", "MAIL", "", 1, "READY");
                }
            }
            Return.Append("Result:Error"); //-- Error
        }
        return(Return.ToString());
    }
    public void BindApprovar(int Work_Categ_ID)
    {
        DataSet ds = new DataSet();

        ds = BLL_JRA_Hazards.Get_Approvar(Work_Categ_ID);

        lblWC.Text = hfIDName.Value;

        //if (ds.Tables[0].Rows.Count>0)
        //    lblWC.Text = ds.Tables[0].Rows[0]["Work_Categ_ID_Name"].ToString()+" :- ";


        if (ds.Tables[1].Rows.Count > 0)
        {
            ViewState["TotalApprovalLevel"] = ds.Tables[1].Rows[0]["LevelCount"].ToString();
        }
        else
        {
            ViewState["TotalApprovalLevel"] = 1;
        }



        if (hfType.Value == "0")
        {
            BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
            DataTable      dt           = objCrewAdmin.Get_RankList();
            gvRankList.DataSource = dt;
            gvRankList.DataBind();
            pnlOffice.Visible           = false;
            pnlVessel.Visible           = true;
            rdblstAppType.SelectedIndex = 1;
        }
        else
        {
            grdLevel.DataSource = null;
            grdLevel.DataBind();
            grdLevel.DataSource = ds.Tables[0];
            grdLevel.DataBind();
            pnlOffice.Visible           = true;
            pnlVessel.Visible           = false;
            rdblstAppType.SelectedIndex = 0;
        }
        //if (ds.Tables[2].Rows[0]["Type"].ToString() == "1" && (hfType.Value == "0" ))
        //{

        //    BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
        //    DataTable dt = objCrewAdmin.Get_RankList();
        //    gvRankList.DataSource = dt;
        //    gvRankList.DataBind();
        //    pnlOffice.Visible = true;
        //    pnlVessel.Visible = false;
        //}
        //else
        //{
        //    grdLevel.DataSource = null;
        //    grdLevel.DataBind();
        //    grdLevel.DataSource = ds.Tables[0];
        //    grdLevel.DataBind();
        //    pnlOffice.Visible = true;
        //    pnlVessel.Visible = false;
        //}



        //if (ds.Tables[2].Rows[0]["Type"].ToString() == "0")
        //{
        //    lblWorkCateg.Text = ds.Tables[2].Rows[0]["Work_Category_Name"].ToString();
        //    try
        //    {
        //        ddlRank.SelectedValue = ds.Tables[3].Rows[0]["Approvar_Detail_ID"].ToString();
        //    }
        //    catch (Exception)
        //    {

        //        ddlRank.SelectedIndex = 0;
        //    }
        //    pnlOffice.Visible = false;
        //    rdblstAppType.SelectedValue = "0";
        //}
        //else
        //{

        //    //GridViewHelper helper = new GridViewHelper(grdLevel);
        //    //helper.RegisterGroup("Approval_Level", true, true);
        //    //helper.GroupHeader += new GroupEvent(helper_GroupHeader);
        //    grdLevel.DataSource = null;
        //    grdLevel.DataBind();
        //    grdLevel.DataSource = ds.Tables[0];
        //    grdLevel.DataBind();
        //    pnlOffice.Visible = true;
        //    pnlVessel.Visible = false;
        //    rdblstAppType.SelectedValue = "1";
        //}
    }
    /// <summary>
    /// Description: Method to create the dynamic list of categorywise graph
    /// Baseed on Crew rank category, graph will be creted
    /// </summary>
    private void GenearteDiv()
    {
        try
        {
            hdnRanks.Value = "";
            hdnYears.Value = "";
            DataTable dtRank = ddlRank.SelectedValues;
            DataTable dtYear = ddlYear.SelectedValues;

            foreach (DataRow dr in dtRank.Rows)
            {
                hdnRanks.Value = hdnRanks.Value + "," + dr["SelectedValue"].ToString();
            }
            hdnRanks.Value = hdnRanks.Value.Trim(',');
            foreach (DataRow dr in dtYear.Rows)
            {
                hdnYears.Value = hdnYears.Value + "," + dr["SelectedValue"].ToString();;
            }
            hdnYears.Value = hdnYears.Value.Trim(',');


            string         sContainer   = "chartContainer_";
            string         sGContainer  = "gridContainer_";
            BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
            PlaceHolder1.Controls.Clear();
            int       rowcount = 0;
            DataTable dt       = objCrewAdmin.Get_RankCategories();
            rowcount = dt.Rows.Count;
            string shdnCategoryID = "";
            string shdnCategory   = "";
            hdnCategoryID.Value = shdnCategoryID;
            hdnCategory.Value   = shdnCategory;
            foreach (DataRow dr in dt.Rows)
            {
                if (hdnCategoryID.Value == "")
                {
                    hdnCategory.Value   = dr["Category_Name"].ToString();
                    hdnCategoryID.Value = dr["ID"].ToString();
                }
                else
                {
                    hdnCategory.Value   = hdnCategory.Value + "," + dr["Category_Name"].ToString();
                    hdnCategoryID.Value = hdnCategoryID.Value + "," + dr["ID"].ToString();
                }
            }
            hdnCategory.Value   = hdnCategory.Value.Trim(',');
            hdnCategoryID.Value = hdnCategoryID.Value.Trim(',');
            int totalCategories = dt.Rows.Count;
            int tblRows         = 1;
            int tblCols         = 2;//--do--
            //int tblCols = 1;//--do--
            if (totalCategories > 1)
            {
                if (totalCategories < 3)
                {
                    tblRows = 1;
                }
                else if (totalCategories < 5)
                {
                    tblRows = 2;
                }
                else
                {
                    tblRows = (int)Math.Ceiling((double)totalCategories / 2);
                }
            }


            Table tbl = new Table();
            tbl.Attributes.Add("align", "center");
            int    catindex    = 0;
            string CategoryId  = "";
            string CategoyName = "";
            PlaceHolder1.Controls.Add(tbl);
            string sURL;

            //TableRow tr = new TableRow();
            int iCount = 0;
            //for (int i = 0; i < tblRows; i++)
            for (int i = 0; i < totalCategories; i++)
            {
                TableRow tr = new TableRow();
                //for (int j = 0; j < tblCols; j++)
                //{

                if (iCount < rowcount)
                {
                    TableCell tc = new TableCell();

                    CategoryId  = dt.Rows[iCount]["ID"].ToString();
                    CategoyName = dt.Rows[iCount]["Category_Name"].ToString();
                    catindex++;
                    iCount++;

                    HtmlGenericControl newControl = new HtmlGenericControl("div");
                    HiddenField        hdnCatId   = new HiddenField();
                    HiddenField        hdnCatName = new HiddenField();
                    //hdnCatId.ID = "hdnID_" + i + j;
                    //hdnCatName.ID = "hdnName_" + i + j;
                    hdnCatId.ID   = "hdnID_" + i;
                    hdnCatName.ID = "hdnName_" + i;

                    //newControl.ID = sContainer + i + "_" + j;
                    newControl.ID = sContainer + i;
                    newControl.Attributes.Add("Style", "Height:300px;width:700px;float:left; padding-right:20px; padding-bottom:50px;");
                    //newControl.Attributes.Add("onclick", "openDetail('" + CategoryId + "','" + CategoyName + "')");
                    newControl.InnerHtml = "";
                    tc.Controls.Add(newControl);


                    HtmlGenericControl newGridControl = new HtmlGenericControl("div");
                    //hdnCatId.ID = "hdnID_" + i + j;
                    //hdnCatName.ID = "hdnName_" + i + j;

                    //newGridControl.ID = sGContainer + i + "_" + j;

                    hdnCatId.ID   = "hdnID_" + i;
                    hdnCatName.ID = "hdnName_" + i;

                    newGridControl.ID = sGContainer + i;

                    newGridControl.Attributes.Add("Style", "Height:300px;width:700px;float:left;");

                    newGridControl.InnerHtml = "";
                    tc.Controls.Add(newGridControl);

                    hdnCatId.Value   = CategoryId;
                    hdnCatName.Value = CategoyName;
                    tc.Controls.Add(hdnCatId);
                    tc.Controls.Add(hdnCatName);
                    tr.Cells.Add(tc);
                }
                TableRow           tr1           = new TableRow();
                TableCell          td            = new TableCell();
                HtmlGenericControl labelControl1 = new HtmlGenericControl("div");
                labelControl1.ID        = "header_" + i;
                labelControl1.InnerHtml = "Retention Rate - " + CategoyName;
                labelControl1.Attributes.Add("Style", "Height:50px;width:850px;float:right; font-weight:bold;font-size: 14px;");
                td.Controls.Add(labelControl1);
                tr1.Cells.Add(td);
                //}
                tbl.Rows.Add(tr1);
                tbl.Rows.Add(tr);
            }

            hiddenCount.Value  = tblRows.ToString();
            hiddenCount1.Value = tblCols.ToString();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
示例#30
0
    /// <summary>
    /// Description: Method to create the dynamic list of categorywise graph
    /// @author:Bhairab
    /// </summary>
    private void GenearteDiv()
    {
        try
        {
            hdnRanks.Value = "";
            hdnYears.Value = "";
            DataTable dtRank = ddlRank.SelectedValues;
            DataTable dtYear = ddlYear.SelectedValues;

            foreach (DataRow dr in dtRank.Rows)
            {
                hdnRanks.Value = hdnRanks.Value + "," + dr["SelectedValue"].ToString();
            }
            hdnRanks.Value = hdnRanks.Value.Trim(',');
            foreach (DataRow dr in dtYear.Rows)
            {
                hdnYears.Value = hdnYears.Value + "," + dr["SelectedValue"].ToString();;
            }
            hdnYears.Value = hdnYears.Value.Trim(',');


            string         sContainer   = "chartContainer_";
            BLL_Crew_Admin objCrewAdmin = new BLL_Crew_Admin();
            PlaceHolder1.Controls.Clear();
            int       rowcount = 0;
            DataTable dt       = objCrewAdmin.Get_RankCategories();
            rowcount = dt.Rows.Count;
            string shdnCategoryID = "0";
            string shdnCategory   = "Selected Ranks";
            hdnCategoryID.Value = shdnCategoryID;
            hdnCategory.Value   = shdnCategory;
            foreach (DataRow dr in dt.Rows)
            {
                hdnCategory.Value   = hdnCategory.Value + "," + dr["Category_Name"].ToString();
                hdnCategoryID.Value = hdnCategoryID.Value + "," + dr["ID"].ToString();
            }
            hdnCategory.Value   = hdnCategory.Value.Trim(',');
            hdnCategoryID.Value = hdnCategoryID.Value.Trim(',');
            int totalCategories = dt.Rows.Count + 1;
            int tblRows         = 1;
            int tblCols         = 2;//--do--
            if (totalCategories > 1)
            {
                if (totalCategories < 3)
                {
                    tblRows = 1;
                }
                else if (totalCategories < 5)
                {
                    tblRows = 2;
                }
                else
                {
                    tblRows = (int)Math.Ceiling((double)totalCategories / 2);
                }
            }


            Table tbl = new Table();
            tbl.Attributes.Add("align", "center");
            int    catindex    = 0;
            string CategoryId  = "";
            string CategoyName = "";
            PlaceHolder1.Controls.Add(tbl);
            string sURL;
            //TableRow tr = new TableRow();
            int iCount = 0;
            for (int i = 0; i < tblRows; i++)
            {
                TableRow tr = new TableRow();
                for (int j = 0; j < tblCols; j++)
                {
                    if (iCount < rowcount)
                    {
                        TableCell tc = new TableCell();

                        if (i == 0 && j == 0)
                        {
                            CategoryId  = "0";
                            CategoyName = "Selected Ranks";
                        }
                        else
                        {
                            CategoryId  = dt.Rows[iCount]["ID"].ToString();
                            CategoyName = dt.Rows[iCount]["Category_Name"].ToString();
                            catindex++;
                        }
                        HtmlGenericControl newControl = new HtmlGenericControl("div");
                        HiddenField        hdnCatId   = new HiddenField();
                        HiddenField        hdnCatName = new HiddenField();
                        hdnCatId.ID   = "hdnID_" + i + j;
                        hdnCatName.ID = "hdnName_" + i + j;

                        newControl.ID = sContainer + i + j;
                        newControl.Attributes.Add("Style", "Height:300px;width:700px;float:left");
                        newControl.Attributes.Add("onclick", "openDetail('" + CategoryId + "','" + CategoyName + "')");
                        newControl.InnerHtml = "";
                        tc.Controls.Add(newControl);

                        hdnCatId.Value   = CategoryId;
                        hdnCatName.Value = CategoyName;
                        tc.Controls.Add(hdnCatId);
                        tc.Controls.Add(hdnCatName);
                        tr.Cells.Add(tc);
                        iCount++;
                    }
                }
                tbl.Rows.Add(tr);
            }

            hiddenCount.Value  = tblRows.ToString();
            hiddenCount1.Value = tblCols.ToString();
        }
        catch (Exception ex)
        {
        }
    }