public List <BLLSession> SelectSession()
    {
        List <BLLSession> objlist = new List <BLLSession>();
        BLLSession        objbll  = new BLLSession();

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectAll("sp_selectsession");
        while (dr.Read())
        {
            objbll             = new BLLSession();
            objbll.Id          = Convert.ToInt32(dr["id"].ToString());
            objbll.Session_id  = dr["session_id"].ToString();
            objbll.Description = dr["description"].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 <BLLSession> SelectSessionbyid(BLLSession objbll)
    {
        List <BLLSession> objlist = new List <BLLSession>();

        SqlParameter param = new SqlParameter();

        param       = new SqlParameter("@session_id", SqlDbType.NVarChar);
        param.Value = objbll.Session_id;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectById("sp_selectsessionbyid", param);
        while (dr.Read())
        {
            objbll             = new BLLSession();
            objbll.Id          = Convert.ToInt32(dr["id"].ToString());
            objbll.Session_id  = dr["session_id"].ToString();
            objbll.Description = dr["description"].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 int InsertSession(BLLSession objbll)
    {
        SqlParameter[] param = new SqlParameter[7];

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

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

        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_insertsession", param);

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

        objlist = objbll.SelectSession();
        if (objlist.Count > 0)
        {
            dgsession.DataSource = objlist;
            dgsession.DataBind();
            for (int i = 0; i <= dgsession.Rows.Count - 1; i++)
            {
                string update = (string)Session["update"];
                string delete = (string)Session["delete"];
                if (update == "yes")
                {
                    dgsession.Rows[i].Cells[2].Enabled = true;
                }
                else
                {
                    dgsession.Rows[i].Cells[2].Enabled = false;
                }
                if (delete == "yes")
                {
                    dgsession.Rows[i].Cells[3].Enabled = true;
                }
                else
                {
                    dgsession.Rows[i].Cells[3].Enabled = false;
                }
            }
        }
    }
    protected void btndelete_Click(object sender, EventArgs e)
    {
        LinkButton obj    = (LinkButton)(sender);
        string     val    = obj.CommandArgument.ToString();
        BLLSession objbll = new BLLSession();

        objbll.Session_id = val;
        int a = objbll.DeleteSession(objbll);

        SelectSession();
    }
    public int DeleteSession(BLLSession objbll)
    {
        SqlParameter[] param = new SqlParameter[1];

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

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

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

        objlist = objbll.SelectSession();
        if (objlist.Count > 0)
        {
            cmdsession.DataSource = objlist;
            cmdsession.ValueField = "session_id";
            cmdsession.TextField  = "description";
            cmdsession.DataBind();
        }
    }
Beispiel #8
0
    public void LoadForm()
    {
        BLLSession objbll = new BLLSession();

        objbll.Session_id = (string)Session["session_update"];
        List <BLLSession> objlist = new List <BLLSession>();

        objlist = objbll.SelectSessionbyid(objbll);
        if (objlist.Count > 0)
        {
            txtsessionid.Text   = objlist[0].Session_id;
            txtdescription.Text = objlist[0].Description;
        }
    }
Beispiel #9
0
    public void UpdateSession()
    {
        BLLSession objbll = new BLLSession();

        objbll.Session_id  = (string)Session["session_update"];
        objbll.Description = txtdescription.Text;
        objbll.Modifiedby  = user;
        int a = objbll.UpdateSession(objbll);

        if (a == 1)
        {
            lblresult.Text  = "Session Update Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
Beispiel #10
0
    public void InsertSession()
    {
        BLLSession objbll = new BLLSession();

        objbll.Session_id  = txtsessionid.Text;
        objbll.Description = txtdescription.Text;
        objbll.Createdby   = user;
        objbll.Modifiedby  = user;
        int a = objbll.InsertSession(objbll);

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

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

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

        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_updatesession", param);

        objcon.CloseConnection();
        return(a);
    }
    public int DeleteSession(BLLSession objbll)
    {
        DALSession objdal = new DALSession();

        return(objdal.DeleteSession(objbll));
    }
    public int InsertSession(BLLSession objbll)
    {
        DALSession objdal = new DALSession();

        return(objdal.InsertSession(objbll));
    }
    public int UpdateSession(BLLSession objbll)
    {
        DALSession objdal = new DALSession();

        return(objdal.UpdateSession(objbll));
    }
    public List <BLLSession> SelectSessionbyid(BLLSession objbll)
    {
        DALSession objdal = new DALSession();

        return(objdal.SelectSessionbyid(objbll));
    }