private void BindDrop()
    {
        try
        {
            TeacherMsts       mst = new TeacherMsts();
            List <TeacherMst> obj = mst.FullDetails();

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

            CollegeMsts       mst1 = new CollegeMsts();
            List <CollegeMst> obj1 = mst1.FullDetails();

            ddlCollege.DataTextField  = "CollegeName";
            ddlCollege.DataValueField = "CollegeID";
            ddlCollege.DataSource     = obj1;
            ddlCollege.DataBind();
            ddlCollege.Items.Insert(0, new ListItem("-Select-", "0"));
        }
        catch (Exception ex)
        {
        }
    }
Ejemplo n.º 2
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.º 3
0
    private void BindGridView()
    {
        TeacherMsts       msts     = new TeacherMsts();
        List <TeacherMst> Teachers = msts.FullDetails();

        grdTeacherInfo.DataSource = Teachers;
        grdTeacherInfo.DataBind();
    }
Ejemplo n.º 4
0
    protected void makelink_delete(object sender, EventArgs e)
    {
        string strparm = (sender as ImageButton).CommandArgument;

        TeacherMsts msts   = new TeacherMsts();
        String      strerr = msts.DeleteTeacher(Convert.ToInt32(strparm));

        BindGridView();
    }
    private void BindGridView()
    {
        TeacherMsts msts        = new TeacherMsts();
        TeacherMst  Teacherdata = msts.Details(Convert.ToInt32(Request.QueryString["EID"].ToString()));

        lblName.Text     = Teacherdata.FirstName + " " + Teacherdata.MiddleName + " " + Teacherdata.LastName;
        lblemail.Text    = Teacherdata.EmailID;
        lblGender.Text   = Teacherdata.Gender;
        lblJoinDate.Text = Teacherdata.JoiningDate;
        lblMobile.Text   = Teacherdata.MobileNo;
        empImg.ImageUrl  = "~/TeacherImages/" + Teacherdata.Image;
    }
Ejemplo n.º 6
0
    private void BindControl()
    {
        TeacherMsts msts     = new TeacherMsts();
        TeacherMst  Teachers = msts.Details(Convert.ToInt32(Request.QueryString["EID"].ToString()));

        txtTeachercode.Text     = Teachers.Emp_Code;
        txtfirstname.Text       = Teachers.FirstName;
        txtmiddlename.Text      = Teachers.MiddleName;
        txtlastname.Text        = Teachers.LastName;
        txtDATEBIRTH.Text       = Teachers.DateOfBirth;
        txtjoiningdate.Text     = Teachers.JoiningDate;
        rdlgender.SelectedValue = Teachers.Gender;
        txtemailid.Text         = Teachers.EmailID;
        txtmobilenumber.Text    = Teachers.MobileNo;
        ViewState["Image"]      = Teachers.Image;
    }
    protected void btnCreate_Click(object sender, EventArgs e)
    {
        try
        {
            TeacherMst mst = new TeacherMst();

            mst.FirstName   = txtfirstname.Text.Trim();
            mst.MiddleName  = txtmiddlename.Text.Trim();
            mst.LastName    = txtlastname.Text.Trim();
            mst.DateOfBirth = txtDATEBIRTH.Text.Trim();
            mst.JoiningDate = txtjoiningdate.Text.Trim();
            mst.Emp_Code    = txtTcode.Text.Trim();

            String[] strUpload;
            if (FUpload.HasFile)
            {
                strUpload = Upload(FUpload);
                if (strUpload[0] == "0")
                {
                    mst.Image = strUpload[1];
                }
                else
                {
                    string message = Convert.ToString(strUpload[1]);
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append("<script type = 'text/javascript'>");
                    sb.Append("window.onload=function(){");
                    sb.Append("jAlert('");
                    sb.Append(message);
                    sb.Append("')};");
                    sb.Append("</script>");
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "jAlert", sb.ToString());
                    return;
                }
            }

            mst.Gender   = rdlgender.SelectedValue.Trim();
            mst.EmailID  = txtemailid.Text.Trim();
            mst.MobileNo = txtmobilenumber.Text.Trim();

            TeacherMsts tmst   = new TeacherMsts();
            String      strerr = tmst.CreateTeacher(mst);
            if (strerr == "0")
            {
                Response.Redirect("~/Teacher/TeacherDetails", false);
                //string message = "Request Processed Successfully.";
                //System.Text.StringBuilder sb = new System.Text.StringBuilder();
                //sb.Append("<script type = 'text/javascript'>");
                //sb.Append("window.onload=function(){");
                //sb.Append("jAlert('");
                //sb.Append(message);
                //sb.Append("')};");
                //sb.Append("</script>");
                //ClientScript.RegisterClientScriptBlock(this.GetType(), "jAlert", sb.ToString());
                //return;
            }
        }
        catch (Exception ex)
        {
        }
    }