Exemplo n.º 1
0
    protected void GridView_Ratings_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            JRA_Lib   JRALib_Data = new JRA_Lib();
            DataTable dt          = new DataTable();
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int ID = UDFLib.ConvertToInteger(GridView_Ratings.DataKeys[e.Row.RowIndex].Value.ToString());

                if ((e.Row.RowState & DataControlRowState.Edit) > 0)
                {
                    DropDownList ddList = (DropDownList)e.Row.FindControl("ddlDisplayText");
                    dt = BLL_JRA_Work_Category.JRA_GET_RISK_TYPES(JRALib_Data);
                    ddList.DataSource     = dt;
                    ddList.DataTextField  = Convert.ToString(dt.Columns["Type_Display_Text"]);
                    ddList.DataValueField = Convert.ToString(dt.Columns["Type_ID"]);
                    ddList.DataBind();
                    ddList.Items.Insert(0, new ListItem("-Select-", "0"));
                    DataRowView dr = e.Row.DataItem as DataRowView;
                    //ddList.SelectedValue = dr["Risk_TYPE"].ToString();
                    ddList.Items.FindByValue(Convert.ToString(dr["Risk_Type"])).Selected = true;
                }
            }
        }
        catch
        {
        }
    }
Exemplo n.º 2
0
    protected void ClearFilter()
    {
        JRA_Lib lObjWC = new JRA_Lib();

        lObjWC.Work_Categ_Parent_ID = null;
        lObjWC.Mode = 3;
        DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);



        DataTable dtAllChildsCloned = dtAllChilds.Clone();

        dtAllChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float);
        foreach (DataRow row in dtAllChilds.Rows)
        {
            dtAllChildsCloned.ImportRow(row);
        }



        DataView dv = dtAllChildsCloned.DefaultView;

        dv.Sort     = "Work_Categ_Value";
        dtAllChilds = dv.ToTable();
        ddlChildWorkCateg.DataSource     = dtAllChilds;
        ddlChildWorkCateg.DataTextField  = "Work_Category_Display";
        ddlChildWorkCateg.DataValueField = "Work_Categ_ID";
        ddlChildWorkCateg.DataBind();
        ddlChildWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0"));
        ddlParentWorkCateg.SelectedIndex = 0;
        ddlChildWorkCateg.SelectedIndex  = 0;
    }
Exemplo n.º 3
0
    private void Load_WorkCategory()
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        JRALib_Data.Type_ID = 0;
        DataTable dt = BLL_JRA_Work_Category.JRA_GET_TYPE_LIST(JRALib_Data);
    }
Exemplo n.º 4
0
    protected void Search_WorkCategory()
    {
        int rowcount   = ucCustomPagerItems.isCountRecord;
        int SearchRows = 0;
        int TotalRows  = 0;

        JRA_Lib JRALib_Data = new JRA_Lib();

        JRALib_Data.SearchText = txtfilter.Text.Trim();
        JRALib_Data.SearchCate = ddlFiter.SelectedValue == "0" ? null : ddlFiter.SelectedValue;
        JRALib_Data.PageNumber = ucCustomPagerItems.CurrentPageIndex;
        JRALib_Data.PageSize   = ucCustomPagerItems.PageSize;

        DataTable dt = BLL_JRA_Work_Category.JRA_SEARCH_WORK_CATEGORY(JRALib_Data);

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

        if (dt.Rows.Count > 0)
        {
            SearchRows = Convert.ToInt32(dt.Rows[0]["SearchRows"]);
            TotalRows  = Convert.ToInt32(dt.Rows[0]["TotalRows"]);
        }

        if (ucCustomPagerItems.isCountRecord == 1)
        {
            rowcount = SearchRows;
            ucCustomPagerItems.CountTotalRec = Convert.ToString(TotalRows);
            ucCustomPagerItems.BuildPager();
        }
    }
Exemplo n.º 5
0
    protected void GridView_Type_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        try
        {
            int         ID  = UDFLib.ConvertToInteger(GridView_Type.DataKeys[e.RowIndex].Values[0].ToString());
            GridViewRow row = (GridViewRow)GridView_Type.Rows[e.RowIndex];
            JRALib_Data.Type_ID           = ID;
            JRALib_Data.Type              = ((DropDownList)row.FindControl("ddlType")).SelectedValue;
            JRALib_Data.Type_Value        = ((TextBox)row.FindControl("txtType_Value")).Text;
            JRALib_Data.Type_Display_Text = ((TextBox)row.FindControl("txtType_Display_Text")).Text;
            JRALib_Data.Type_Description  = ((TextBox)row.FindControl("txtType_Desc")).Text;
            JRALib_Data.Type_Color        = ((DropDownList)row.FindControl("ddlGrdType_Color")).SelectedItem.Text;
            JRALib_Data.UserID            = Convert.ToInt32(Session["USERID"]);
            JRALib_Data.DB_Mode           = "U";
            if (ValidateType(JRALib_Data.Type, JRALib_Data.Type_Value, JRALib_Data.Type_Description, JRALib_Data.Type_Display_Text, JRALib_Data.Type_Color) == true)
            {
                int result = BLL_JRA_Work_Category.JRA_INS_TYPE(JRALib_Data);
                GridView_Type.EditIndex = -1;
                Search_Type();
            }
        }
        catch
        {
        }
    }
Exemplo n.º 6
0
    protected void GridView_Category_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        try
        {
            GridViewRow row = (GridViewRow)GridView_Category.Rows[e.RowIndex];
            int         ID  = UDFLib.ConvertToInteger(GridView_Category.DataKeys[e.RowIndex].Values[0].ToString());
            GridView_Category.EditIndex      = -1;
            JRALib_Data.UserID               = Convert.ToInt32(Session["USERID"]);
            JRALib_Data.Work_Categ_ID        = Convert.ToInt32(ID);
            JRALib_Data.Work_Categ_Parent_ID = Convert.ToInt32(((HiddenField)row.FindControl("hdnParent_Work_Categ_ID")).Value);
            JRALib_Data.Work_Category_Name   = (((TextBox)row.FindControl("txtCategory_Name")).Text.Trim());
            JRALib_Data.Work_Categ_Value     = (((TextBox)row.FindControl("txtWork_Categ_Value")).Text.Trim());
            JRALib_Data.DB_Mode              = "U";



            int result = BLL_JRA_Work_Category.JRA_INS_WorkCategory(JRALib_Data);

            Search_WorkCategory();
            Load_CategoryList(null, 0);
        }
        catch
        {
        }
    }
Exemplo n.º 7
0
    protected void ddlParentWorkCateg_SelectedIndexChanged(object sender, EventArgs e)
    {
        JRA_Lib lObjWC = new JRA_Lib();

        lObjWC.Work_Categ_Parent_ID = UDFLib.ConvertToInteger(ddlParentWorkCateg.SelectedValue);
        lObjWC.Mode = 1;
        DataTable dtChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);



        DataView dv = dtChilds.DefaultView;

        DataTable dtChildsCloned = dtChilds.Clone();

        dtChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float);
        foreach (DataRow row in dtChilds.Rows)
        {
            dtChildsCloned.ImportRow(row);
        }
        dv = dtChildsCloned.DefaultView;



        dv.Sort  = "Work_Categ_Value";
        dtChilds = dv.ToTable();
        ddlChildWorkCateg.DataSource     = dtChilds;
        ddlChildWorkCateg.DataTextField  = "Work_Category_Display";
        ddlChildWorkCateg.DataValueField = "Work_Categ_ID";
        ddlChildWorkCateg.DataBind();
        ddlChildWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
    }
Exemplo n.º 8
0
    private void SearchRiskType()
    {
        JRA_Lib   JRALib_Data = new JRA_Lib();
        DataTable dt          = BLL_JRA_Work_Category.JRA_GET_RATINGS_SEARCH(JRALib_Data);

        GridView_Ratings.DataSource = dt;
        GridView_Ratings.DataBind();
    }
Exemplo n.º 9
0
 public static DataTable JRA_GET_WORK_CATEGORY(JRA_Lib objJRALibData)
 {
     SqlParameter[] sqlprm = new SqlParameter[]
     {
         new SqlParameter("@Type", objJRALibData.Type_ID)
     };
     return(SqlHelper.ExecuteDataset(connection, CommandType.StoredProcedure, "JRA_GET_TYPE", sqlprm).Tables[0]);
 }
Exemplo n.º 10
0
    protected void BindCombos()
    {
        JRA_Lib lObjWC = new JRA_Lib();

        lObjWC.Work_Categ_Parent_ID = null;
        lObjWC.Mode = 0;
        DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);
        DataView  dv = dt.DefaultView;

        DataTable dtCloned = dt.Clone();

        dtCloned.Columns["Work_Categ_Value"].DataType = typeof(float);
        foreach (DataRow row in dt.Rows)
        {
            dtCloned.ImportRow(row);
        }
        dv = dtCloned.DefaultView;


        dv.Sort = "Work_Categ_Value";
        dt      = dv.ToTable();
        ddlParentWorkCateg.DataSource     = dt;
        ddlParentWorkCateg.DataTextField  = "Work_Category_Display";
        ddlParentWorkCateg.DataValueField = "Work_Categ_ID";
        ddlParentWorkCateg.DataBind();
        ddlParentWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));

        lObjWC = new JRA_Lib();
        lObjWC.Work_Categ_Parent_ID = null;
        lObjWC.Mode = 3;
        DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);

        DataTable dtAllChildsCloned = dtAllChilds.Clone();

        dtAllChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float);
        foreach (DataRow row in dtAllChilds.Rows)
        {
            dtAllChildsCloned.ImportRow(row);
        }

        dv          = dtAllChildsCloned.DefaultView;
        dv.Sort     = "Work_Categ_Value";
        dtAllChilds = dv.ToTable();
        ddlChildWorkCateg.DataSource     = dtAllChilds;
        ddlChildWorkCateg.DataTextField  = "Work_Category_Display";
        ddlChildWorkCateg.DataValueField = "Work_Categ_ID";
        ddlChildWorkCateg.DataBind();
        ddlChildWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));

        BLL_Infra_VesselLib objVsl   = new BLL_Infra_VesselLib();
        DataTable           dtVessel = objVsl.Get_VesselList(0, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), "", Convert.ToInt32(Session["USERCOMPANYID"].ToString()));

        DDLVessel.DataSource     = dtVessel;
        DDLVessel.DataTextField  = "Vessel_name";
        DDLVessel.DataValueField = "Vessel_id";
        DDLVessel.DataBind();
        DDLVessel.Items.Insert(0, new ListItem("--SELECT ALL--", null));
    }
Exemplo n.º 11
0
 public static DataTable JRA_GET_WORK_CATEGORY_LIST(JRA_Lib objJRALibData)
 {
     SqlParameter[] sqlprm = new SqlParameter[]
     {
         new SqlParameter("@Work_Categ_Parent_ID", objJRALibData.Work_Categ_Parent_ID),
         new SqlParameter("@Mode", objJRALibData.Mode)
     };
     return(SqlHelper.ExecuteDataset(connection, CommandType.StoredProcedure, "JRA_GET_WORK_CATEGORY_LIST", sqlprm).Tables[0]);
 }
Exemplo n.º 12
0
    protected void Load_TypeList()
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        JRALib_Data.Type_ID = 0;
        DataTable dt = BLL_JRA_Work_Category.JRA_GET_TYPE_LIST(JRALib_Data);

        GridView_Type.DataSource = dt;
        GridView_Type.DataBind();
    }
Exemplo n.º 13
0
 public static DataTable JRA_GET_TYPE_SEARCH(JRA_Lib JRALib_Data)
 {
     SqlParameter[] sqlPrm = new SqlParameter[]
     {
         new SqlParameter("@SearchText", JRALib_Data.SearchText),
         new SqlParameter("@SearchType", JRALib_Data.SearchType),
         new SqlParameter("@PAGENUMBER", JRALib_Data.PageNumber),
         new SqlParameter("@PAGESIZE", JRALib_Data.PageSize),
     };
     return(SqlHelper.ExecuteDataset(connection, CommandType.StoredProcedure, "JRA_GET_TYPE_SEARCH", sqlPrm).Tables[0]);
 }
Exemplo n.º 14
0
    private void SaveRisk_Type(string DB_Mode)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        JRALib_Data.RiskType    = ddlRiskType.SelectedValue;
        JRALib_Data.RatingValue = Convert.ToInt32(txtRatingVal.Text);
        JRALib_Data.UserID      = Convert.ToInt32(Session["USERID"]);
        JRALib_Data.DB_Mode     = DB_Mode;

        int result = BLL_JRA_Work_Category.JRA_INS_RatingType(JRALib_Data);
    }
Exemplo n.º 15
0
    protected void GridView_Ratings_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();
        int     ID          = UDFLib.ConvertToInteger(GridView_Ratings.DataKeys[e.RowIndex].Value.ToString());

        JRALib_Data.Rating_ID = ID;
        JRALib_Data.UserID    = Convert.ToInt32(Session["USERID"]);
        JRALib_Data.DB_Mode   = "D";
        int result = BLL_JRA_Work_Category.JRA_INS_RatingType(JRALib_Data);

        SearchRiskType();
    }
Exemplo n.º 16
0
    private void LoadRisk_Type()
    {
        JRA_Lib   JRALib_Data = new JRA_Lib();
        DataTable dt          = BLL_JRA_Work_Category.JRA_GET_RISK_TYPES(JRALib_Data);

        ddlRiskType.DataSource     = dt;
        ddlRiskType.DataTextField  = Convert.ToString(dt.Columns["Type_Display_Text"]);
        ddlRiskType.DataValueField = Convert.ToString(dt.Columns["Type_ID"]);
        ddlRiskType.DataBind();
        ddlRiskType.Items.Insert(0, new ListItem("-Select-", "0"));
        ViewState["vsRiskType"] = dt;
    }
Exemplo n.º 17
0
        public static DataTable JRA_SEARCH_WORK_CATEGORY(JRA_Lib objJRALibData)
        {
            SqlParameter[] sqlPrm = new SqlParameter[]
            {
                new SqlParameter("@SearchText", objJRALibData.SearchText),
                new SqlParameter("@SearchCate", objJRALibData.SearchCate),
                new SqlParameter("@PAGENUMBER", objJRALibData.PageNumber),
                new SqlParameter("@PAGESIZE", objJRALibData.PageSize)
            };
            DataTable dt = SqlHelper.ExecuteDataset(connection, CommandType.StoredProcedure, "JRA_GET_WORK_CATEGORY_SEARCH", sqlPrm).Tables[0];

            return(dt);
        }
Exemplo n.º 18
0
        public static int JRA_INS_RatingType(JRA_Lib objJRALibData)
        {
            SqlParameter[] sqlprm = new SqlParameter[]
            {
                new SqlParameter("@Rating_ID", objJRALibData.Rating_ID),
                new SqlParameter("@Risk_TYPE", objJRALibData.RiskType),
                new SqlParameter("@Rating_VALUE", objJRALibData.RatingValue),

                new SqlParameter("@UserID", objJRALibData.UserID),
                new SqlParameter("@DB_Mode", objJRALibData.DB_Mode)
            };
            return(SqlHelper.ExecuteNonQuery(connection, CommandType.StoredProcedure, "JRA_INSUPD_RISK_RATING", sqlprm));
        }
Exemplo n.º 19
0
    protected void GridView_Category_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();
        int     ID          = UDFLib.ConvertToInteger(GridView_Category.DataKeys[e.RowIndex].Value.ToString());

        JRALib_Data.Work_Categ_ID = ID;
        JRALib_Data.UserID        = Convert.ToInt32(Session["USERID"]);
        JRALib_Data.DB_Mode       = "D";
        int result = BLL_JRA_Work_Category.JRA_INS_WorkCategory(JRALib_Data);

        //GroupGridviewHeader();
        Search_WorkCategory();
        Load_CategoryList(null, 0);
    }
Exemplo n.º 20
0
    private void SaveType(string DB_Mode)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        JRALib_Data.Type_ID           = 0;
        JRALib_Data.Type              = ddlType.SelectedItem.Text;
        JRALib_Data.Type_Value        = txtTypeValue.Text.Trim();
        JRALib_Data.Type_Display_Text = txtDisplayText.Text.Trim();
        JRALib_Data.Type_Description  = txtDesc.Text.Trim();
        JRALib_Data.Type_Color        = ddlColors.SelectedItem.Text;
        JRALib_Data.UserID            = Convert.ToInt32(Session["USERID"]);
        JRALib_Data.DB_Mode           = DB_Mode;
        int result = BLL_JRA_Work_Category.JRA_INS_TYPE(JRALib_Data);
    }
Exemplo n.º 21
0
        public static int JRA_INS_TYPE(JRA_Lib objJRALibData)
        {
            SqlParameter[] sqlprm = new SqlParameter[]
            {
                new SqlParameter("@Type_ID", objJRALibData.Type_ID),
                new SqlParameter("@Type", objJRALibData.Type),

                new SqlParameter("@Type_Value", objJRALibData.Type_Value),
                new SqlParameter("@Type_Display_Text", objJRALibData.Type_Display_Text),
                new SqlParameter("@Type_Description", objJRALibData.Type_Description),
                new SqlParameter("@Type_Color", objJRALibData.Type_Color),

                new SqlParameter("@UserID", objJRALibData.UserID),
                new SqlParameter("@DB_Mode", objJRALibData.DB_Mode)
            };
            return(SqlHelper.ExecuteNonQuery(connection, CommandType.StoredProcedure, "JRA_INSUPD_TYPE_LIST", sqlprm));
        }
    public void LoadCombos()
    {
        JRA_Lib lObjWC = new JRA_Lib();

        lObjWC.Work_Categ_Parent_ID = null;
        lObjWC.Mode = 3;
        DataTable dtW = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);

        ddlParentWorkCateg.DataSource     = dtW;
        ddlParentWorkCateg.DataTextField  = "Work_Category_Display";
        ddlParentWorkCateg.DataValueField = "Work_Categ_ID_TYPE";
        ddlParentWorkCateg.DataBind();
        ddlParentWorkCateg.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
        ddlCTWorkCategory.DataSource     = dtW;
        ddlCTWorkCategory.DataTextField  = "Work_Category_Display";
        ddlCTWorkCategory.DataValueField = "Work_Categ_ID";
        ddlCTWorkCategory.DataBind();
        ddlParentWorkCateg.SelectedIndex = 0;
    }
Exemplo n.º 23
0
    protected void Load_CategoryList(int?ParentCateID, int Mode)
    {
        JRA_Lib ObjJRALib = new JRA_Lib();

        ObjJRALib.Mode = Mode;
        ObjJRALib.Work_Categ_Parent_ID = ParentCateID;

        DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(ObjJRALib);

        ddlParentCat.DataSource     = dt;
        ddlParentCat.DataTextField  = Convert.ToString(dt.Columns["Work_Category_Name"]);
        ddlParentCat.DataValueField = Convert.ToString(dt.Columns["Work_Categ_ID"]);
        ddlParentCat.DataBind();
        ddlParentCat.Items.Insert(0, new ListItem("-Select-", "0"));
        ddlFiter.DataSource     = dt;
        ddlFiter.DataTextField  = Convert.ToString(dt.Columns["Work_Category_Name"]);
        ddlFiter.DataValueField = Convert.ToString(dt.Columns["Work_Categ_ID"]);
        ddlFiter.DataBind();
        ddlFiter.Items.Insert(0, new ListItem("-Select-", "0"));
    }
Exemplo n.º 24
0
    private void SaveWorkCategory(string DB_Mode)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        JRALib_Data.UserID               = Convert.ToInt32(Session["USERID"]);
        JRALib_Data.Work_Categ_ID        = Convert.ToInt32(0);
        JRALib_Data.Work_Categ_Parent_ID = Convert.ToInt32(ddlParentCat.SelectedValue);
        JRALib_Data.Work_Categ_Value     = txtCatVal.Text.Trim();
        JRALib_Data.Work_Category_Name   = txtCatName.Text.Trim();
        JRALib_Data.DB_Mode              = DB_Mode;


        int result = BLL_JRA_Work_Category.JRA_INS_WorkCategory(JRALib_Data);

        if (result == 999)//CHECK FOR DUPLICATE WORK CATEGORY NAME
        {
            string js = "";
            js = "alert('Work Category Name already exists.');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true);
        }
    }
Exemplo n.º 25
0
    protected void ClearFilter()
    {
        JRA_Lib lObjWC = new JRA_Lib();

        lObjWC.Work_Categ_Parent_ID = null;
        lObjWC.Mode = 3;
        DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);

        ddlChildWorkCateg.DataSource     = dtAllChilds;
        ddlChildWorkCateg.DataTextField  = "Work_Category_Display";
        ddlChildWorkCateg.DataValueField = "Work_Categ_ID";
        ddlChildWorkCateg.DataBind();
        ddlChildWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0"));
        ddlParentWorkCateg.SelectedIndex  = 0;
        ddlChildWorkCateg.SelectedIndex   = 0;
        ddlParentWorkCateg.SelectedIndex  = 0;
        ddlAssessmentStatus.SelectedIndex = 0;
        txtFromDate.Text        = "";
        txtToDate.Text          = "";
        DDLVessel.SelectedIndex = 0;
    }
Exemplo n.º 26
0
    protected void GridView_Ratings_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        JRA_Lib JRALib_Data = new JRA_Lib();

        try
        {
            int         ID  = UDFLib.ConvertToInteger(GridView_Ratings.DataKeys[e.RowIndex].Values[0].ToString());
            GridViewRow row = (GridViewRow)GridView_Ratings.Rows[e.RowIndex];
            JRALib_Data.Rating_ID   = ID;
            JRALib_Data.RiskType    = ((DropDownList)row.FindControl("ddlDisplayText")).SelectedValue;
            JRALib_Data.RatingValue = Convert.ToInt32(((TextBox)row.FindControl("txtRisk")).Text);
            JRALib_Data.UserID      = Convert.ToInt32(Session["USERID"]);
            JRALib_Data.DB_Mode     = "U";
            int result = BLL_JRA_Work_Category.JRA_INS_RatingType(JRALib_Data);
            GridView_Ratings.EditIndex = -1;
            SearchRiskType();
        }
        catch
        {
        }
    }
Exemplo n.º 27
0
        public static int JRA_INS_WorkCategory(JRA_Lib objJRALibData)
        {
            int ReturnVal = 0;

            SqlParameter[] sqlprm = new SqlParameter[]
            {
                new SqlParameter("@Work_Categ_ID", objJRALibData.Work_Categ_ID),
                new SqlParameter("@Work_Categ_Value", objJRALibData.Work_Categ_Value),

                new SqlParameter("@Work_Category_Name", objJRALibData.Work_Category_Name),
                new SqlParameter("@Work_Categ_Parent_ID", objJRALibData.Work_Categ_Parent_ID),

                new SqlParameter("@UserID", objJRALibData.UserID),
                new SqlParameter("@DB_Mode", objJRALibData.DB_Mode),
                new SqlParameter("@ReturnVal", objJRALibData.ReturnVal)
            };
            sqlprm[sqlprm.Length - 1].Direction = ParameterDirection.InputOutput;
            SqlHelper.ExecuteNonQuery(connection, CommandType.StoredProcedure, "JRA_INSUPD_WORK_CATEGORY_LIST", sqlprm);
            ReturnVal = Convert.ToInt32(sqlprm[sqlprm.Length - 1].Value);
            return(ReturnVal);
        }
Exemplo n.º 28
0
 public static DataTable JRA_GET_RATINGS_SEARCH(JRA_Lib JRALib_Data)
 {
     return(SqlHelper.ExecuteDataset(connection, CommandType.StoredProcedure, "JRA_GET_RATINGS_SEARCH").Tables[0]);
 }
Exemplo n.º 29
0
 public static DataTable JRA_GET_RATINGS_SEARCH(JRA_Lib JRALib_Data)
 {
     return(DAL_JRA_Work_Category.JRA_GET_RATINGS_SEARCH(JRALib_Data));
 }
Exemplo n.º 30
0
    protected void BindCombos()
    {
        JRA_Lib lObjWC = new JRA_Lib();

        lObjWC.Work_Categ_Parent_ID = null;
        lObjWC.Mode = 0;
        DataTable dt = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);

        DataView  dv       = dt.DefaultView;
        DataTable dtCloned = dt.Clone();

        dtCloned.Columns["Work_Categ_Value"].DataType = typeof(float);
        foreach (DataRow row in dt.Rows)
        {
            dtCloned.ImportRow(row);
        }
        dv = dtCloned.DefaultView;

        dv.Sort = "Work_Categ_Value";
        dt      = dv.ToTable();

        ddlParentWorkCateg.DataSource     = dt;
        ddlParentWorkCateg.DataTextField  = "Work_Category_Display";
        ddlParentWorkCateg.DataValueField = "Work_Categ_ID";
        ddlParentWorkCateg.DataBind();
        ddlParentWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0"));

        lObjWC = new JRA_Lib();
        lObjWC.Work_Categ_Parent_ID = null;
        lObjWC.Mode = 3;
        DataTable dtAllChilds = BLL_JRA_Work_Category.JRA_GET_WORK_CATEGORY_LIST(lObjWC);

        DataTable dtAllChildsCloned = dtAllChilds.Clone();

        dtAllChildsCloned.Columns["Work_Categ_Value"].DataType = typeof(float);
        foreach (DataRow row in dtAllChilds.Rows)
        {
            dtAllChildsCloned.ImportRow(row);
        }



        dv          = dtAllChildsCloned.DefaultView;
        dv.Sort     = "Work_Categ_Value";
        dtAllChilds = dv.ToTable();
        ddlChildWorkCateg.DataSource     = dtAllChilds;
        ddlChildWorkCateg.DataTextField  = "Work_Category_Display";
        ddlChildWorkCateg.DataValueField = "Work_Categ_ID";
        ddlChildWorkCateg.DataBind();
        ddlChildWorkCateg.Items.Insert(0, new ListItem("-Select All-", "0"));
        ddlParentWorkCateg.SelectedIndex = 0;
        ddlChildWorkCateg.SelectedIndex  = 0;

        ddlWorkCategory.DataSource     = dtAllChilds;
        ddlWorkCategory.DataTextField  = "Work_Category_Display";
        ddlWorkCategory.DataValueField = "Work_Categ_ID";
        ddlWorkCategory.DataBind();
        ddlWorkCategory.Items.Insert(0, new ListItem("-Select All-", "0"));
        ddlWorkCategory.SelectedIndex = 0;
        DataSet dsSev = BLL_JRA_Hazards.GET_TYPE("Severity");

        ddlSeverity.DataSource     = dsSev.Tables[0];
        ddlSeverity.DataTextField  = "Type_Display_Text";
        ddlSeverity.DataValueField = "Type_ID";
        ddlSeverity.DataBind();
        ddlSeverity.Items.Insert(0, new ListItem("-Select All-", "0"));

        DataSet dsLkhd = BLL_JRA_Hazards.GET_TYPE("Likelihood");

        ddlLikelihood.DataSource     = dsLkhd.Tables[0];
        ddlLikelihood.DataTextField  = "Type_Display_Text";
        ddlLikelihood.DataValueField = "Type_ID";
        ddlLikelihood.DataBind();
        ddlLikelihood.Items.Insert(0, new ListItem("-Select All-", "0"));

        DataSet dsModRis = BLL_JRA_Hazards.JRA_GET_MODIFIED_RISKS();

        ddlModifiedRisk.DataSource     = dsModRis.Tables[0];
        ddlModifiedRisk.DataTextField  = "Type_Display_Text";
        ddlModifiedRisk.DataValueField = "Type_ID";
        ddlModifiedRisk.DataBind();
        ddlModifiedRisk.Items.Insert(0, new ListItem("-Select All-", "0"));
    }