public int InsertDesignation(BLLDepartmentDesignation objbll)
    {
        SqlParameter[] param = new SqlParameter[7];

        param[0]       = new SqlParameter("@des_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Des_id;

        param[1]       = new SqlParameter("@des_name", SqlDbType.NVarChar);
        param[1].Value = objbll.Des_name;

        param[2]       = new SqlParameter("@status", SqlDbType.Bit);
        param[2].Value = objbll.Status;

        param[3]       = new SqlParameter("@createdby", SqlDbType.NVarChar);
        param[3].Value = objbll.Createdby;

        param[4]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[4].Value = objbll.Modifiedby;

        param[5]       = new SqlParameter("@Insert_Date", SqlDbType.DateTime);
        param[5].Value = objbll.Insert_date;

        param[6]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[6].Value = objbll.Update_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdInsert("sp_insertdesignation", param);

        objcon.CloseConnection();
        return(a);
    }
    public void SelectDesignation()
    {
        List <BLLDepartmentDesignation> objlist = new List <BLLDepartmentDesignation>();
        BLLDepartmentDesignation        objbll  = new BLLDepartmentDesignation();

        objlist = objbll.SelectDesignation();
        if (objlist.Count > 0)
        {
            dgdesignation.DataSource = objlist;
            dgdesignation.DataBind();
            for (int i = 0; i <= dgdesignation.Rows.Count - 1; i++)
            {
                string update = (string)Session["update"];
                string delete = (string)Session["delete"];
                if (update == "yes")
                {
                    dgdesignation.Rows[i].Cells[2].Enabled = true;
                }
                else
                {
                    dgdesignation.Rows[i].Cells[2].Enabled = false;
                }
                if (delete == "yes")
                {
                    dgdesignation.Rows[i].Cells[3].Enabled = true;
                }
                else
                {
                    dgdesignation.Rows[i].Cells[3].Enabled = false;
                }
            }
        }
    }
    public List <BLLDepartmentDesignation> SelectDesignationbyid(BLLDepartmentDesignation objbll)
    {
        List <BLLDepartmentDesignation> objlist = new List <BLLDepartmentDesignation>();

        SqlParameter param = new SqlParameter();

        param       = new SqlParameter("@des_id", SqlDbType.NVarChar);
        param.Value = objbll.Des_id;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectById("sp_selectdesignationbyid", param);
        while (dr.Read())
        {
            objbll             = new BLLDepartmentDesignation();
            objbll.Id          = Convert.ToInt32(dr["id"].ToString());
            objbll.Des_id      = dr["des_id"].ToString();
            objbll.Des_name    = dr["des_name"].ToString();
            objbll.Status      = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby   = dr["createdby"].ToString();
            objbll.Modifiedby  = dr["modifiedby"].ToString();
            objbll.Insert_date = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date = Convert.ToDateTime(dr["update_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
    public List <BLLDepartmentDesignation> SelectDepartment()
    {
        List <BLLDepartmentDesignation> objlist = new List <BLLDepartmentDesignation>();
        BLLDepartmentDesignation        objbll  = new BLLDepartmentDesignation();

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectAll("sp_selectdepartment");
        while (dr.Read())
        {
            objbll             = new BLLDepartmentDesignation();
            objbll.Id          = Convert.ToInt32(dr["id"].ToString());
            objbll.Dep_id      = dr["dep_id"].ToString();
            objbll.Dep_name    = dr["dep_name"].ToString();
            objbll.Status      = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby   = dr["createdby"].ToString();
            objbll.Modifiedby  = dr["modifiedby"].ToString();
            objbll.Insert_date = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date = Convert.ToDateTime(dr["update_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
    protected void btndelete_Click(object sender, EventArgs e)
    {
        LinkButton obj = (LinkButton)(sender);
        string     val = obj.CommandArgument.ToString();
        BLLDepartmentDesignation objbll = new BLLDepartmentDesignation();

        objbll.Des_id = val;
        int a = objbll.DeleteDesignation(objbll);

        SelectDesignation();
    }
    public int DeleteDesignation(BLLDepartmentDesignation objbll)
    {
        SqlParameter[] param = new SqlParameter[1];

        param[0]       = new SqlParameter("@des_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Des_id;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_deletedesignation", param);

        objcon.CloseConnection();
        return(a);
    }
예제 #7
0
    public void SelectDesignation()
    {
        List <BLLDepartmentDesignation> objlist = new List <BLLDepartmentDesignation>();
        BLLDepartmentDesignation        objbll  = new BLLDepartmentDesignation();

        objlist = objbll.SelectDesignation();
        if (objlist.Count > 0)
        {
            cmbDesignation.DataSource = objlist;
            cmbDesignation.ValueField = "des_id";
            cmbDesignation.TextField  = "des_name";
            cmbDesignation.DataBind();
        }
    }
예제 #8
0
    public void LoadForm()
    {
        BLLDepartmentDesignation objbll = new BLLDepartmentDesignation();

        objbll.Des_id = (string)Session["des_update"];
        List <BLLDepartmentDesignation> objlist = new List <BLLDepartmentDesignation>();

        objlist = objbll.SelectDesignationbyid(objbll);
        if (objlist.Count > 0)
        {
            txtdesignationid.Text   = objlist[0].Des_id;
            txtdesignationname.Text = objlist[0].Des_name;
        }
    }
예제 #9
0
    public void UpdateDesignation()
    {
        BLLDepartmentDesignation objbll = new BLLDepartmentDesignation();

        objbll.Des_id     = (string)Session["des_update"];
        objbll.Des_name   = txtdesignationname.Text;
        objbll.Modifiedby = user;
        int a = objbll.UpdateDesignation(objbll);

        if (a == 1)
        {
            lblresult.Text  = "Designation Update Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
예제 #10
0
    public void InsertDesignation()
    {
        BLLDepartmentDesignation objbll = new BLLDepartmentDesignation();

        objbll.Des_id     = txtdesignationid.Text;
        objbll.Des_name   = txtdesignationname.Text;
        objbll.Createdby  = user;
        objbll.Modifiedby = user;
        int a = objbll.InsertDesignation(objbll);

        if (a == 1)
        {
            lblresult.Text  = "Designation Save Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
    public int UpdateDesignation(BLLDepartmentDesignation objbll)
    {
        SqlParameter[] param = new SqlParameter[4];

        param[0]       = new SqlParameter("@des_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Des_id;

        param[1]       = new SqlParameter("@des_name", SqlDbType.NVarChar);
        param[1].Value = objbll.Des_name;

        param[2]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[2].Value = objbll.Modifiedby;

        param[3]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[3].Value = objbll.Update_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_updatedesignation", param);

        objcon.CloseConnection();
        return(a);
    }
    public int UpdateDesignation(BLLDepartmentDesignation objbll)
    {
        DALDepartmentDesignation objdal = new DALDepartmentDesignation();

        return(objdal.UpdateDesignation(objbll));
    }
    public List <BLLDepartmentDesignation> SelectDesignationbyid(BLLDepartmentDesignation objbll)
    {
        DALDepartmentDesignation objdal = new DALDepartmentDesignation();

        return(objdal.SelectDesignationbyid(objbll));
    }
    public int DeleteDepartment(BLLDepartmentDesignation objbll)
    {
        DALDepartmentDesignation objdal = new DALDepartmentDesignation();

        return(objdal.DeleteDepartment(objbll));
    }
    public int InsertDesignation(BLLDepartmentDesignation objbll)
    {
        DALDepartmentDesignation objdal = new DALDepartmentDesignation();

        return(objdal.InsertDesignation(objbll));
    }