protected void BtnAdd_Click(object sender, EventArgs e)
    {
        if (Photo.HasFile)
        {
            //create the path to save the file
            string fileName = Path.Combine(Server.MapPath("~/teacherPhoto"), Photo.FileName);
            //save the file to our local path
            Photo.SaveAs(fileName);
            //AlumniImage.ImageUrl = "~/AlumniPhoto/" + PhotoUpload.FileName;
            strphoto = Photo.FileName;
        }
        i = obj.Addteacher(ddnsal.SelectedItem.Text, txtfname.Text, txtmname.Text, txtlname.Text, ddngender.SelectedItem.Text, txtdob.Text, Convert.ToInt32(ddnsubject.SelectedValue), txtaddress.Text, ddnstate.SelectedValue, ddncity.SelectedValue, txtpin.Text,
                           "India", txtcontact.Text, txtmobile.Text, txtaadhar.Text, txtpan.Text, "~/teacherPhoto/" + strphoto, "Teacher", ddnshifthrs.SelectedValue, txtcode.Text,
                           txtusername.Text, txtpwd.Text, "Admin", 1, DateTime.Now.ToString("dd-MM-yyyy"));
        if (i > 0)
        {
            //BindData();
            dtstaffid = obj.GetCurrentteacherId();
            if (dtstaffid.Rows.Count > 0)
            {
                id = Convert.ToInt32(dtstaffid.Rows[0]["teacherId"]);
                io = obj.teacherJoinig(id, txtteacherrole.Text, Convert.ToInt32(ddnsubject.SelectedValue), txtdate.Text, "Available", "Admin", 1, DateTime.Now.ToString());
                if (io > 0)
                {
                    //BindData1();
                    basic  = Convert.ToInt32(txtbasic.Text);
                    ta     = Convert.ToInt32(txtta.Text);
                    da     = Convert.ToInt32(txtda.Text);
                    hra    = Convert.ToInt32(txthra.Text);
                    others = Convert.ToInt32(txtother.Text);

                    iu = obj.TeacherSalary(id, basic, ta, da, hra, others, Convert.ToInt32(txtactual.Text), "Admin", 1, DateTime.Now.ToString());
                    if (iu > 0)
                    {
                        lblmsg.Text = "Data Has Been Added";
                        BindData();
                    }
                }
            }
        }
        ClearFields();
    }