public void SelectStudentlnfo() { List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); BLLStudentInfo objbll = new BLLStudentInfo(); objlist = objbll.SelectStudentInfo(); if (objlist.Count > 0) { dgstudentinfo.DataSource = objlist; dgstudentinfo.DataBind(); for (int i = 0; i <= dgstudentinfo.Rows.Count - 1; i++) { string update = (string)Session["update"]; string delete = (string)Session["delete"]; if (update == "yes") { dgstudentinfo.Rows[i].Cells[1].Enabled = true; } else { dgstudentinfo.Rows[i].Cells[1].Enabled = false; } if (delete == "yes") { dgstudentinfo.Rows[i].Cells[2].Enabled = true; } else { dgstudentinfo.Rows[i].Cells[2].Enabled = false; } } } }
public void LoadForm() { BLLStudentInfo objbll = new BLLStudentInfo(); objbll.Rollno = (string)Session["stu_update"]; List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); objlist = objbll.Selectstudentinfobyid(objbll); if (objlist.Count > 0) { txtrollno.Text = objlist[0].Rollno; cmdprogram.Text = objlist[0].Program_id; cmdsession.Text = objlist[0].Session_id; dtreg_date.Text = Convert.ToString(objlist[0].Reg_date); txtname.Text = objlist[0].Name; txtfname.Text = objlist[0].Father_name; cbgender.Text = objlist[0].Gender; dtdob.Text = Convert.ToString(objlist[0].Dob); txtcnic.Text = objlist[0].Nic.ToString(); txtnationality.Text = objlist[0].Nationality; txtmobileno.Text = objlist[0].Mobile; txtphoneno.Text = objlist[0].Phone; txtcaddress.Text = objlist[0].C_address; txtpaddress.Text = objlist[0].P_address; txtemail.Text = objlist[0].Email; imgUser.ImageUrl = objlist[0].Pic_name; } }
public void UpdateStudentinfo() { BLLStudentInfo objbll = new BLLStudentInfo(); objbll.Rollno = (string)Session["stu_update"]; objbll.Program_id = cmdprogram.SelectedItem.Value.ToString(); objbll.Session_id = cmdsession.SelectedItem.Value.ToString(); objbll.Reg_date = Convert.ToDateTime(dtreg_date.Value); objbll.Name = txtname.Text; objbll.Father_name = txtfname.Text; objbll.Gender = cbgender.SelectedItem.ToString(); objbll.Dob = Convert.ToDateTime(dtdob.Value); objbll.Nic = txtcnic.Text; objbll.Nationality = txtnationality.Text; objbll.Mobile = txtmobileno.Text; objbll.Phone = txtphoneno.Text; objbll.C_address = txtcaddress.Text; objbll.P_address = txtpaddress.Text; objbll.Email = txtemail.Text; objbll.Modifiedby = user; int a = objbll.UpdateStudentInfo(objbll); if (a == 1) { lblresult.Text = "Student Information Update Successfully...."; BtnSave.Enabled = false; BtnNew.Enabled = true; } }
public List <BLLStudentInfo> SelectStuLogin(BLLStudentInfo objbll) { List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@username", SqlDbType.NVarChar); param[0].Value = objbll.Username; param[1] = new SqlParameter("@password", SqlDbType.NVarChar); param[1].Value = objbll.Password; SqlDataReader dr; objcon.OpenConnection(); dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectstulogin", param); while (dr.Read()) { objbll = new BLLStudentInfo(); objbll.Rollno = dr["rollno"].ToString(); objbll.Name = dr["name"].ToString(); objbll.Username = dr["username"].ToString(); objbll.Password = dr["password"].ToString(); objbll.Pic_name = dr["pic_name"].ToString(); objbll.Pic_path = dr["pic_path"].ToString(); objlist.Add(objbll); } objcon.CloseConnection(); return(objlist); }
public int UpdateStudentInfo(BLLStudentInfo objbll) { SqlParameter[] param = new SqlParameter[16]; param[0] = new SqlParameter("@rollno", SqlDbType.NVarChar); param[0].Value = objbll.Rollno; param[1] = new SqlParameter("@name", SqlDbType.NVarChar); param[1].Value = objbll.Name; param[2] = new SqlParameter("@father_name", SqlDbType.NVarChar); param[2].Value = objbll.Father_name; param[3] = new SqlParameter("@c_address", SqlDbType.NVarChar); param[3].Value = objbll.C_address; param[4] = new SqlParameter("@p_address", SqlDbType.NVarChar); param[4].Value = objbll.P_address; param[5] = new SqlParameter("@phone", SqlDbType.NVarChar); param[5].Value = objbll.Phone; param[6] = new SqlParameter("@mobile", SqlDbType.NVarChar); param[6].Value = objbll.Mobile; param[7] = new SqlParameter("@email", SqlDbType.NVarChar); param[7].Value = objbll.Email; param[8] = new SqlParameter("@nic", SqlDbType.NVarChar); param[8].Value = objbll.Nic; param[9] = new SqlParameter("@dob", SqlDbType.DateTime); param[9].Value = objbll.Dob; param[10] = new SqlParameter("@nationality", SqlDbType.NVarChar); param[10].Value = objbll.Nationality; param[11] = new SqlParameter("@program_id ", SqlDbType.NVarChar); param[11].Value = objbll.Program_id; param[12] = new SqlParameter("@session_id", SqlDbType.NVarChar); param[12].Value = objbll.Session_id; param[13] = new SqlParameter("@modifiedby ", SqlDbType.NVarChar); param[13].Value = objbll.Modifiedby; param[14] = new SqlParameter("@Update_Date", SqlDbType.DateTime); param[14].Value = objbll.Update_date; param[15] = new SqlParameter("@gender", SqlDbType.NVarChar); param[15].Value = objbll.Gender; objcon.OpenConnection(); int a = objcon.sqlcmdUpdateById("sp_updatestudentinfo", param); objcon.CloseConnection(); return(a); }
protected void btndelete_Click(object sender, EventArgs e) { LinkButton obj = (LinkButton)(sender); string val = obj.CommandArgument.ToString(); BLLStudentInfo objbll = new BLLStudentInfo(); objbll.Rollno = val; int a = objbll.DeleteStudentInfo(objbll); SelectStudentlnfo(); }
public void Selectstunamebyrollno() { BLLStudentInfo objbll = new BLLStudentInfo(); objbll.Rollno = cbrollno.SelectedItem.Value.ToString(); List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); objlist = objbll.Selectstunamebyrollno(objbll); if (objlist.Count > 0) { txtname.Text = objlist[0].Name; } }
public int DeleteStudentInfo(BLLStudentInfo objbll) { SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@rollno", SqlDbType.NVarChar); param[0].Value = objbll.Rollno; objcon.OpenConnection(); int a = objcon.sqlcmdUpdateById("sp_deletestudent", param); objcon.CloseConnection(); return(a); }
public void SelectRollno() { List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); BLLStudentInfo objbll = new BLLStudentInfo(); objlist = objbll.SelectStudentInfo(); if (objlist.Count > 0) { cbrollno.DataSource = objlist; cbrollno.ValueField = "rollno"; cbrollno.TextField = "rollno"; cbrollno.DataBind(); } }
public void SelectRollno() { List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); BLLStudentInfo objbll = new BLLStudentInfo(); objlist = objbll.SelectMaxRollno(); if (objlist.Count > 0) { string reg1 = objlist[0].Rollno; long reg_no = Convert.ToInt64(reg1.Substring(2, 5)); long reg = reg_no + 1; txtrollno.Text = Convert.ToString("S-" + reg); } }
public void LoadGrid() { BLLStudentInfo objbll = new BLLStudentInfo(); objbll.Rollno = user; List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); objlist = objbll.Selectstuinfobyrollno(objbll); if (objlist.Count > 0) { dgprofile.DataSource = objlist; dgprofile.DataBind(); } }
public List <BLLStudentInfo> SelectMaxRollno() { List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); BLLStudentInfo objbll = new BLLStudentInfo(); SqlDataReader dr; objcon.OpenConnection(); dr = objcon.sqlcmdSelectAll("sp_selectmaxrollno"); while (dr.Read()) { objbll = new BLLStudentInfo(); objbll.Rollno = dr["rollno"].ToString(); objlist.Add(objbll); } objcon.CloseConnection(); return(objlist); }
public List <BLLStudentInfo> Selectstudentinfobyid(BLLStudentInfo objbll) { List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); SqlParameter param = new SqlParameter(); param = new SqlParameter("@rollno", SqlDbType.NVarChar); param.Value = objbll.Rollno; SqlDataReader dr; objcon.OpenConnection(); dr = objcon.sqlcmdSelectById("sp_selectstudentinfobyid", param); while (dr.Read()) { objbll = new BLLStudentInfo(); objbll.Id = Convert.ToInt32(dr["id"].ToString()); objbll.Rollno = dr["rollno"].ToString(); objbll.Name = dr["name"].ToString(); objbll.Father_name = dr["father_name"].ToString(); objbll.C_address = dr["c_address"].ToString(); objbll.P_address = dr["p_address"].ToString(); objbll.Phone = dr["phone"].ToString(); objbll.Mobile = dr["mobile"].ToString(); objbll.Email = dr["email"].ToString(); objbll.Nic = dr["nic"].ToString(); objbll.Dob = Convert.ToDateTime(dr["dob"].ToString()); objbll.Nationality = dr["nationality"].ToString(); objbll.Program_id = dr["program_id"].ToString(); objbll.Session_id = dr["session_id"].ToString(); objbll.Reg_date = Convert.ToDateTime(dr["reg_date"].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()); objbll.Gender = dr["gender"].ToString(); objbll.Pic_name = dr["pic_name"].ToString(); objbll.Pic_path = dr["pic_path"].ToString(); objlist.Add(objbll); } objcon.CloseConnection(); return(objlist); }
public List <BLLStudentInfo> Selectstunamebyrollno(BLLStudentInfo objbll) { List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); SqlParameter param = new SqlParameter(); param = new SqlParameter("@rollno", SqlDbType.NVarChar); param.Value = objbll.Rollno; SqlDataReader dr; objcon.OpenConnection(); dr = objcon.sqlcmdSelectById("sp_selectstunamebyrollno", param); while (dr.Read()) { objbll = new BLLStudentInfo(); objbll.Name = dr["name"].ToString(); objlist.Add(objbll); } objcon.CloseConnection(); return(objlist); }
public void InsertStudentinfo() { BLLStudentInfo objbll = new BLLStudentInfo(); objbll.Rollno = txtrollno.Text;; objbll.Program_id = cmdprogram.SelectedItem.Value.ToString(); objbll.Session_id = cmdsession.SelectedItem.Value.ToString(); objbll.Reg_date = Convert.ToDateTime(dtreg_date.Value); objbll.Name = txtname.Text; objbll.Father_name = txtfname.Text; objbll.Gender = cbgender.SelectedItem.ToString(); objbll.Dob = Convert.ToDateTime(dtdob.Value); objbll.Nic = txtcnic.Text; objbll.Nationality = txtnationality.Text; objbll.Mobile = txtmobileno.Text; objbll.Phone = txtphoneno.Text; objbll.C_address = txtcaddress.Text; objbll.P_address = txtpaddress.Text; objbll.Email = txtemail.Text; objbll.Username = txtrollno.Text; objbll.Password = Encrypt("usa".Trim()); objbll.Pic_name = ("~/Student_Images/" + ThumbnailFileName.ToString()); objbll.Pic_path = "d"; objbll.Createdby = user; objbll.Modifiedby = user; int a = objbll.InsertStudentInfo(objbll); if (a == 3) { lblresult.Text = "Student Information Save Successfully...."; BtnSave.Enabled = false; BtnNew.Enabled = true; } }
public int InsertStudentInfo(BLLStudentInfo objbll) { DALStudentInfo objdal = new DALStudentInfo(); return(objdal.InsertStudentInfo(objbll)); }
public int InsertStudentInfo(BLLStudentInfo objbll) { SqlParameter[] param = new SqlParameter[25]; param[0] = new SqlParameter("@rollno", SqlDbType.NVarChar); param[0].Value = objbll.Rollno; param[1] = new SqlParameter("@name", SqlDbType.NVarChar); param[1].Value = objbll.Name; param[2] = new SqlParameter("@father_name", SqlDbType.NVarChar); param[2].Value = objbll.Father_name; param[3] = new SqlParameter("@c_address", SqlDbType.NVarChar); param[3].Value = objbll.C_address; param[4] = new SqlParameter("@p_address", SqlDbType.NVarChar); param[4].Value = objbll.P_address; param[5] = new SqlParameter("@phone", SqlDbType.NVarChar); param[5].Value = objbll.Phone; param[6] = new SqlParameter("@mobile", SqlDbType.NVarChar); param[6].Value = objbll.Mobile; param[7] = new SqlParameter("@email", SqlDbType.NVarChar); param[7].Value = objbll.Email; param[8] = new SqlParameter("@nic", SqlDbType.NVarChar); param[8].Value = objbll.Nic; param[9] = new SqlParameter("@dob", SqlDbType.DateTime); param[9].Value = objbll.Dob; param[10] = new SqlParameter("@nationality", SqlDbType.NVarChar); param[10].Value = objbll.Nationality; param[11] = new SqlParameter("@program_id ", SqlDbType.NVarChar); param[11].Value = objbll.Program_id; param[12] = new SqlParameter("@session_id", SqlDbType.NVarChar); param[12].Value = objbll.Session_id; param[13] = new SqlParameter("@reg_date ", SqlDbType.DateTime); param[13].Value = objbll.Reg_date; param[14] = new SqlParameter("@status", SqlDbType.Bit); param[14].Value = objbll.Status; param[15] = new SqlParameter("@createdby", SqlDbType.NVarChar); param[15].Value = objbll.Createdby; param[16] = new SqlParameter("@modifiedby ", SqlDbType.NVarChar); param[16].Value = objbll.Modifiedby; param[17] = new SqlParameter("@Insert_Date", SqlDbType.DateTime); param[17].Value = objbll.Insert_date; param[18] = new SqlParameter("@Update_Date", SqlDbType.DateTime); param[18].Value = objbll.Update_date; param[19] = new SqlParameter("@gender", SqlDbType.NVarChar); param[19].Value = objbll.Gender; param[20] = new SqlParameter("@username", SqlDbType.NVarChar); param[20].Value = objbll.Username; param[21] = new SqlParameter("@password ", SqlDbType.NVarChar); param[21].Value = objbll.Password; param[22] = new SqlParameter("@pic_name", SqlDbType.NVarChar); param[22].Value = objbll.Pic_name; param[23] = new SqlParameter("@pic_path ", SqlDbType.NVarChar); param[23].Value = objbll.Pic_path; param[24] = new SqlParameter("@online ", SqlDbType.Bit); param[24].Value = objbll.Online; objcon.OpenConnection(); int a = objcon.sqlcmdInsert("sp_insertstudentinfo", param); objcon.CloseConnection(); return(a); }
public List <BLLStudentInfo> SelectStuLogin(BLLStudentInfo objbll) { DALStudentInfo objdal = new DALStudentInfo(); return(objdal.SelectStuLogin(objbll)); }
public int DeleteStudentInfo(BLLStudentInfo objbll) { DALStudentInfo objdal = new DALStudentInfo(); return(objdal.DeleteStudentInfo(objbll)); }
public List <BLLStudentInfo> Selectstudentinfobyid(BLLStudentInfo objbll) { DALStudentInfo objdal = new DALStudentInfo(); return(objdal.Selectstudentinfobyid(objbll)); }
public List <BLLStudentInfo> Selectstunamebyrollno(BLLStudentInfo objbll) { DALStudentInfo objdal = new DALStudentInfo(); return(objdal.Selectstunamebyrollno(objbll)); }
public int UpdateStudentInfo(BLLStudentInfo objbll) { DALStudentInfo objdal = new DALStudentInfo(); return(objdal.UpdateStudentInfo(objbll)); }
public void SelectEmpLogin() { string us = txtusername.Text.Substring(0, 1); if (us == "e") { BLLEmployeeInfo objbll = new BLLEmployeeInfo(); objbll.Username = txtusername.Text; objbll.Password = Encrypt(txtpasssword.Text); List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>(); objlist = objbll.SelectEmpLogin(objbll); if (objlist.Count > 0) { DateTime dt = DateTime.Now; string signin = String.Format("{0:F}", dt); string user = objlist[0].Username; string name = objlist[0].Name; string password = Decrypt(objlist[0].Password); string dep_id = objlist[0].Dep_id; string des_id = objlist[0].Des_id; string pic_name = objlist[0].Pic_name; if (password == "usa") { Session["pass"] = "******"; Session["username"] = user; Session["dep_id"] = dep_id; Response.Redirect("ChangePasword.aspx"); } if (dep_id == "Faculty") { Session["teacher"] = user; Session["username"] = user; Session["name"] = name; Session["des_id"] = des_id; Session["pic_name"] = pic_name; Session["signin"] = signin; Session["dep_id"] = dep_id; Response.Redirect("../TeacherWebPages/teacher.aspx"); } else { Session["user"] = user; Session["username"] = user; Session["name"] = name; Session["des_id"] = des_id; Session["pic_name"] = pic_name; Session["signin"] = signin; Session["dep_id"] = dep_id; Response.Redirect("../WebPages/admin.aspx"); } } else { lblresult.Text = "Enter Valid Username and Password"; txtusername.Text = string.Empty; txtusername.Focus(); } } else { BLLStudentInfo objbll = new BLLStudentInfo(); objbll.Username = txtusername.Text; objbll.Password = Encrypt(txtpasssword.Text); List <BLLStudentInfo> objlist = new List <BLLStudentInfo>(); objlist = objbll.SelectStuLogin(objbll); if (objlist.Count > 0) { DateTime dt = DateTime.Now; string signin = String.Format("{0:F}", dt); string user = objlist[0].Username; string name = objlist[0].Name; string password = Decrypt(objlist[0].Password); string pic_name = objlist[0].Pic_name; if (password == "usa") { Session["pass"] = "******"; Session["username"] = user; Session["dep_id"] = "Student"; Response.Redirect("ChangePasword.aspx"); } else { Session["student"] = user; Session["username"] = user; Session["name"] = name; Session["des_id"] = "Student"; Session["pic_name"] = pic_name; Session["signin"] = signin; Session["dep_id"] = "Student"; Response.Redirect("../StudentWebPages/student.aspx"); } } else { lblresult.Text = "Enter Valid Username and Password"; txtusername.Text = string.Empty; txtusername.Focus(); } } }