Ejemplo n.º 1
0
    private void BindDrop()
    {
        try
        {
            TeacherMsts       msts     = new TeacherMsts();
            List <TeacherMst> Teachers = msts.FullDetails();

            ddlTeacher.DataTextField  = "FirstName";
            ddlTeacher.DataValueField = "TeacherID";
            ddlTeacher.DataSource     = Teachers;
            ddlTeacher.DataBind();
            ddlTeacher.Items.Insert(0, new ListItem("-Select-", "0"));

            StateMsts       mst = new StateMsts();
            List <StateMst> obj = mst.FullDetails();

            ddlstate.DataTextField  = "State_Name";
            ddlstate.DataValueField = "StateID";
            ddlstate.DataSource     = obj;
            ddlstate.DataBind();
            ddlstate.Items.Insert(0, new ListItem("-Select-", "0"));

            DepMsts       msts2 = new DepMsts();
            List <DepMst> obj1  = msts2.FullDetails();

            ddldepartment.DataTextField  = "Dept_Name";
            ddldepartment.DataValueField = "Dept_ID";
            ddldepartment.DataSource     = obj1;
            ddldepartment.DataBind();
            ddldepartment.Items.Insert(0, new ListItem("-Select-", "0"));
        }
        catch (Exception ex)
        {
        }
    }
Ejemplo n.º 2
0
    private void BindControl()
    {
        DepMsts msts = new DepMsts();
        DepMst  obj  = msts.Details(Convert.ToInt32(Request.QueryString["DID"].ToString()));

        txtdepartmentname.Text = obj.Dept_Name;
    }
    private void BindGridView()
    {
        DepMsts       msts = new DepMsts();
        List <DepMst> obj  = msts.FullDetails();

        grddepInfo.DataSource = obj;
        grddepInfo.DataBind();
    }
    protected void makelink_delete(object sender, EventArgs e)
    {
        string strparm = (sender as ImageButton).CommandArgument;

        DepMsts msts   = new DepMsts();
        String  strerr = msts.DeleteDep(Convert.ToInt32(strparm));

        BindGridView();
    }
Ejemplo n.º 5
0
    protected void btnDepartment_Click(object sender, EventArgs e)
    {
        try
        {
            DepMst mst = new DepMst();
            mst.Dept_Name = txtdepartmentname.Text.Trim();

            DepMsts obj    = new DepMsts();
            String  strerr = obj.CreateDep(mst);
            if (strerr == "0")
            {
                Response.Redirect("~/Department/DepDetails", false);
            }
        }
        catch (Exception ex)
        {
        }
    }
Ejemplo n.º 6
0
    protected void btnDepartmentup_Click(object sender, EventArgs e)
    {
        try
        {
            DepMst mst = new DepMst();
            mst.Dept_ID   = Convert.ToInt32(Request.QueryString["DID"].ToString());
            mst.Dept_Name = txtdepartmentname.Text.Trim();


            DepMsts obj    = new DepMsts();
            String  strerr = obj.EditDep(mst);
            if (strerr == "0")
            {
                Response.Redirect("~/Department/DepDetails", false);
            }
        }
        catch (Exception ex)
        {
        }
    }