public void AddStudent(AdminInformation admin, int schoolid, string query, bool isStoreProcedure) { try{ con.Open(); com = new SqlCommand(query, con); com.Parameters.Add("@schoolid", SqlDbType.NVarChar).Value = schoolid; com.Parameters.Add("@password", SqlDbType.NVarChar).Value = admin.StudentPassword; com.Parameters.Add("@studentname", SqlDbType.NVarChar).Value = admin.StudenName; if (isStoreProcedure) { com.CommandType = CommandType.StoredProcedure; } else { com.CommandType = CommandType.Text; } com.ExecuteNonQuery(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Error inside SqlHelper class in NonQuery as {0}", ex.Message); } finally { con.Close(); //com.Parameters.Clear(); // parameters.Clear(); } }
public ActionResult Index(AdminInformation reg) { if (ModelState.IsValid) { using (TaxSystemEntities1 db = new TaxSystemEntities1()) { var obj = db.AdminInformations.Where(a => a.UserName.Equals(reg.UserName) && a.Password.Equals(reg.Password)).FirstOrDefault(); if (obj != null) { Session["Admin"] = obj.UserName.ToString(); return(RedirectToAction("Index", "Home")); } } } ViewBag.Message = "Invalid User Name or Password"; // Response.Write("<script>alert(' Invalid PanNumber or Password')</script>"); return(View(reg)); }
public void AddStudent(AdminInformation admin, int schoolid) { sqhelp.AddStudent(admin, schoolid, "spAddStudent", true); }
public void UpdateAdminPassword(AdminInformation admin, string name, int schoolid) { sqhelp.UpdateAdminPasssword(admin, name, schoolid, "spUpdateAdminPasssword", true); }
public void AddStudent(AdminInformation admin, int schoolid) { adminformdl.AddStudent(admin, schoolid); }
public void UpdateAdminPassword(AdminInformation admin, string name, int schoolid) { adminformdl.UpdateAdminPassword(admin, name, schoolid); }