private void loaddata(int id)
        {
            try
            {
                DataRow dr = StudentResult.GetDataByKey(id);
                if (dr != null)
                {
                    txttotalMarks.Text  = dr["TotalMarks"].ToString();
                    txtObtainMarks.Text = dr["ObtainMarks"].ToString();

                    if (!string.IsNullOrEmpty(dr["ExamId"].ToString()))
                    {
                        drpExam.SelectedValue = dr["ExamId"].ToString();
                        //  drpstd.SelectedValue = dr["StdId"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["StudentId"].ToString()))
                    {
                        DataRow drStd = StudentMst.GetDataByKey(int.Parse(dr["StudentId"].ToString()));
                        if (drStd != null)
                        {
                            drpdiv.SelectedValue = drStd["DivId"].ToString();
                            bindStudent();
                            drpstudent.SelectedValue = drStd["SID"].ToString();
                        }
                        ResultID = id;
                        //  drpstd.SelectedValue = dr["StdId"].ToString();
                    }
                    btnadd.Text = "Update";
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        protected void Button8_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 1;
            DataRow Studr = StudentMst.GetDataByKey(int.Parse(Session["SID"].ToString()));
            //StuAdapter.Select_UNAME(Session["sname"].ToString());
            DataTable LeaveDT = LeaveMst.GetAllActiveData().Select("studentId = '" + Studr["SID"].ToString() + "'").CopyToDataTable();

            GridView1.DataSource = LeaveDT;
            GridView1.DataBind();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.IsPostBack == false)
     {
         int     studentId = int.Parse(Session["SID"].ToString());
         DataRow studentdr = StudentMst.GetDataByKey(studentId);
         if (studentdr != null)
         {
             Image4.ImageUrl = studentdr["image"].ToString();
             Label1.Text     = studentdr["name"].ToString();
         }
     }
 }
        private void loaddata(int id)
        {
            try
            {
                DataRow dr = StudentMst.GetDataByKey(id);
                if (dr != null)
                {
                    txtadd.Text   = dr["Add"].ToString();
                    txtcity.Text  = dr["Name"].ToString();
                    txtemail.Text = dr["Email"].ToString();
                    txtmobi.Text  = dr["Mobile"].ToString();
                    txtroll.Text  = dr["RollNo"].ToString();
                    // txtmobile.Text = dr["Mobile"].ToString();
                    txtname.Text = dr["Name"].ToString();
                    txtpin.Text  = dr["Pincode"].ToString();
                    // txtqual.Text = dr["Qualification"].ToString();
                    txtuname.Text      = dr["Uname"].ToString();
                    txt_MachineId.Text = dr["MachineCode"].ToString();
                    if (!string.IsNullOrEmpty(dr["DOB"].ToString()))
                    {
                        DateTime date = Convert.ToDateTime(dr["DOB"].ToString());
                        drpdd.SelectedItem.Text   = date.ToString("dd");
                        drpmm.SelectedItem.Text   = date.ToString("MM");
                        drpyyyy.SelectedItem.Text = date.ToString("yyyy");
                    }

                    if (!string.IsNullOrEmpty(dr["StdId"].ToString()))
                    {
                        drpstd.SelectedValue = dr["StdId"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["DivId"].ToString()))
                    {
                        binddiv(int.Parse(dr["StdId"].ToString()));
                        drpdiv.SelectedValue = dr["DivId"].ToString();
                    }
                    //  DropDownList1.SelectedItem.Text = dr["Gender"].ToString();
                    StudentId = id;

                    btnstuadd.Text = "Update";
                }
            }
            catch
            {
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {
                int     id    = 1;
                DataRow Studr = StudentMst.GetDataByKey(id);
                if (Studr != null)
                {
                    lblname.Text = Studr["Name"].ToString();
                    lblroll.Text = Studr["rollno"].ToString();

                    txtemail.Text       = Studr["email"].ToString();
                    txtmobile.Text      = Studr["mobile"].ToString();
                    txtadd.Text         = Studr["add"].ToString();
                    txtcity.Text        = Studr["city"].ToString();
                    txtpin.Text         = Studr["pincode"].ToString();
                    Imgprofile.ImageUrl = Studr["image"].ToString();
                    ViewState["sid"]    = Studr["SID"].ToString();
                }
            }
        }
Ejemplo n.º 6
0
 protected void btnappluleave_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow StuDT = StudentMst.GetDataByKey(int.Parse(Session["SID"].ToString()));
         //St StuAdapter.Select_UNAME(Session["sname"].ToString());
         LeaveMst leaveobj = new LeaveMst();
         leaveobj.LID       = LeaveMst.GetNewLID();
         leaveobj.Name      = StuDT["Name"].ToString();
         leaveobj.StudentId = int.Parse(Session["SID"].ToString());
         leaveobj.Nodays    = DropDownList1.SelectedIndex > 0 ? int.Parse(DropDownList1.SelectedValue) : 1;
         leaveobj.Rollno    = "";
         leaveobj.Message   = txtmsg.Text;
         leaveobj.Insert();
         lbl.Text    = "Apply for leave successfully";
         txtmsg.Text = "";
         DropDownList1.SelectedIndex = 0;
     }
     catch (Exception ex)
     {
         lbl.Text = "Apply for leave failed";
     }
 }
        protected void btnsarch_Click(object sender, EventArgs e)
        {
            DataRow StuDr = StudentMst.GetDataByKey(Convert.ToInt32(drpstudent.SelectedValue));

            if (StuDr != null)
            {
                lblroll.Text   = StuDr["rollno"].ToString();
                lblname.Text   = StuDr["name"].ToString();
                lblemail.Text  = StuDr["email"].ToString();
                lblmobile.Text = StuDr["mobile"].ToString();
                lbldob.Text    = StuDr["dob"].ToString();
                lbladd.Text    = StuDr["add"].ToString();
                lblcity.Text   = StuDr["city"].ToString();
                lblpin.Text    = StuDr["pincode"].ToString();
                lbluname.Text  = StuDr["uname"].ToString();
                //lblpass.Text = StuDr["pass"].ToString();
                imgg.ImageUrl = StuDr["image"].ToString();
                MultiView1.ActiveViewIndex = 0;
            }
            else
            {
                MultiView1.ActiveViewIndex = -1;
            }
        }
Ejemplo n.º 8
0
 protected void btnchangepass_Click(object sender, EventArgs e)
 {
     try
     {
         int     studentId = 1;
         DataRow dr        = StudentMst.GetDataByKey(studentId);
         if (dr != null && dr["Pass"].ToString() == txtcurrent.Text)
         {
             StudentMst studentObj = new StudentMst();
             studentObj.Name    = dr["Name"].ToString();
             studentObj.StdName = dr["StdName"].ToString();
             studentObj.DivName = dr["DivName"].ToString();
             studentObj.DOB     = dr["DOB"].ToString();
             studentObj.EDate   = dr["DOB"].ToString() != "" ? (DateTime?)Convert.ToDateTime(dr["DOB"].ToString()) : null;
             studentObj.Email   = dr["Email"].ToString();
             studentObj.Mobile  = dr["Mobile"].ToString();
             studentObj.RollNo  = dr["RollNo"].ToString();
             studentObj.Pincode = dr["Pincode"].ToString();
             studentObj.Uname   = dr["Uname"].ToString();
             studentObj.Pass    = txtnewpass.Text;
             studentObj.City    = dr["City"].ToString();
             studentObj.Add     = dr["Add"].ToString();
             studentObj.Image   = dr["Image"].ToString();
             studentObj.UpdateDataByKey();
             lbl.Text = "Password Changed";
         }
         else
         {
             lbl.Text = "Invalid Current Password";
         }
     }
     catch (Exception ex)
     {
         lbl.Text = "update password fail";
     }
 }