Esempio n. 1
0
    protected void FillMDB()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("USP_SelectMDB", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter {
                ParameterName = "@UserId", DbType = DbType.String, Value = Session["UserId"].ToString()
            });
            cmd.Parameters.Add(new SqlParameter {
                ParameterName = "@Rolls", DbType = DbType.String, Value = Session["Rolls"].ToString()
            });
            fc.fillDropDown(cmd, ddlMDB, "MDBName", "MDB_Id", "----Select External Funding Agency----", "");
        }
        catch (Exception e)
        {
            LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 2
0
    protected void BindDropDownSelectPPRID()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("Sp_SelectPPRID", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter {
                ParameterName = "@Action", DbType = DbType.String, Value = "MemoirePprId"
            });
            cmd.Parameters.Add(new SqlParameter {
                ParameterName = "@UserID", DbType = DbType.String, Value = Session["UserId"].ToString()
            });
            fc.fillDropDown(cmd, ddlPprId, "ProjectName", "PPRId", "----Select PPR----", "");
        }
        catch (Exception ex)
        {
            LogError(ex);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 3
0
    protected void FillCurrency()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("USP_SelectCurrencyPPR", con);
            DataTable  dt  = new DataTable();
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddlCurrency, "CurrencyName", "CurrId", "----Select Currency of Amout----", "");
            //SqlDataAdapter da = new SqlDataAdapter(cmd);
            //da.Fill(dt);
            //if (dt.Rows.Count > 0)
            //{
            //	ddlCurrency.DataSource = dt;
            //	ddlCurrency.DataTextField = "CurrencyName";
            //	ddlCurrency.DataValueField = "CurrId";
            //	ddlCurrency.DataBind();

            //}
        }
        catch (Exception e)
        {
            LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 4
0
    protected void FillMeetingDropDown1()
    {
        FillControls  fc  = new FillControls();
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spFillMeeting", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter {
                ParameterName = "@MinistryId", DbType = DbType.String, Size = 50, Value = Session["ministry"] != null? Session["ministry"].ToString():"0"
            });
            fc.fillDropDown(cmd, ddlMeetingFilter, "MeetingDate", "MeetingDateI", "----Select Meeting----", "");
        }
        catch (Exception e)
        {
            LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 5
0
    protected void FillReferencePpr()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("SpSelectReferencePpr", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter {
                ParameterName = "@UserId", DbType = DbType.String, Value = Session["UserId"].ToString()
            });
            fc.fillDropDown(cmd, ddlReferencePpr, "ProjectName", "PPRId", "----Select PPR----", "");
            if (ddlReferencePpr.Items.Count > 1)
            {
                lblReferencePpr.Visible = true;
                ddlReferencePpr.Visible = true;
            }
        }
        catch (Exception e)
        {
            LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 6
0
    protected void fillDropDowns()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spSelectDesignation", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddl_NDesignation, "DesignationName", "DesignationId", "----Select----", "");
            cmd = new SqlCommand(" select '0' MinId,'-----Select-----' Minname,'' MinType union select MinId,Minname,case when MinType = 'C' and (left(minname, 10) = 'Department' or left(minname, 4) = 'NITI' )  then 'Departments' when MinType = 'C' and left(minname, 8) = 'Ministry' then 'Ministries' when MinType='M' then 'Funding Agency' When MinType='P' then 'PSU'  else 'States' end MinType   from P_LineMinistry order by MinType, MinName asc  ", con);
            ddlMinistry.DataSource     = fc.fillDropDownDT(cmd, ddl_NDesignation, "MinName", "MinId", "----Select----", "");
            ddlMinistry.DataTextField  = "Minname";
            ddlMinistry.DataValueField = "MinId";
            ddlMinistry.DataGroupField = "MinType";
            ddlMinistry.DataBind();
            //ddlMinistry.Items.Insert(0,new System.Web.UI.WebControls.ListItem("---Select---",""));
        }
        catch (Exception e)
        {
            LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 7
0
    protected void BindMDBName()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spFillMDBNAme", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddlMdbName, "MDBName", "MDB_Id", "----Select MDB Name----", "");
        }
        catch (Exception e)
        {
            //LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 8
0
    protected void FillMeetingDropDown()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spSelectMeeting", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddlmeeting, "StatementName", "StatementId", "----Select Meeting----", "");
        }
        catch (Exception ex)
        {
            LogError(ex);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 9
0
    protected void BinddropDownSelectUser()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spFillUserMaster", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddluserdetails, "UserName", "UserId", "----Select User----", "");
        }
        catch (Exception e)
        {
            //LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 10
0
    protected void FillRoleDropDown()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spSelectRoleMenu", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddlRole, "RoleName", "RoleId", "----Select Role----", "");
        }
        catch (Exception e)
        {
            LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 11
0
    protected void fillDropDowns()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spSelectDesignation", con);
            cmd.CommandType = CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddl_NDesignation, "DesignationName", "DesignationId", "Select", "");
            cmd = new SqlCommand("select MinId,Minname from P_LineMinistry  ", con);
            fc.fillDropDown(cmd, ddlMinistry, "MinName", "MinId", "Select", "0");
        }
        catch (Exception e)
        {
            LogError(e);
        }
        finally
        {
            if (con.State == ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 12
0
    protected void MinistryName()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spSelectMinistryForMark", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddlMinistry, "MinName", "MinId", "----Select Ministry Name----", "");
        }
        catch (Exception ex)
        {
            LogError(ex);
        }
    }
 private void BindToUser()
 {
     try
     {
         SqlConnection con = DataAccess.GetConnction();
         SqlCommand    cmd = new SqlCommand("Usp_SelectToUser", con);
         cmd.CommandType = System.Data.CommandType.StoredProcedure;
         //cmd.Parameters.Add(new SqlParameter { ParameterName = "UserId", DbType = DbType.String, Value = Session["UserId"].ToString() });
         fc.fillDropDown(cmd, ddlTo, "UserName", "iUserID", "----Select User----", "");
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }
    protected void BinddropDownSelectUser()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("spSelectMinistryName", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddlSelectMinistry, "MinName", "MinId", "----Select Ministry----", "");

            // fc.fillDropDown(cmd, DropDownList1, "MinName", "MinId", "----Select Ministry----", "");
        }
        catch (Exception e)
        {
            //LogError(e);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }
Esempio n. 15
0
    protected void BindSelectPpr()
    {
        SqlConnection con = DataAccess.GetConnction();

        try
        {
            SqlCommand cmd = new SqlCommand("Sp_SelectPPRIDForAcknowlegment", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            fc.fillDropDown(cmd, ddlPprid, "ProjectName", "PPRId", "----Select PPRID----", "");
        }
        catch (Exception ex)
        {
            LogError(ex);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
            {
                con = null;
            }
        }
    }