Exemple #1
0
        public ActionResult Index()
        {
            bool i = DB.Close();

            if (i == true)
            {
                return(Content(i.ToString()));
            }
            else
            {
                return(Content(i.ToString()));
            }
            return(View());
        }
Exemple #2
0
 public ActionResult SaveDataStudent(StudentModel f)
 {
     if (ModelState.IsValid)
     {
         D.Open();
         int i = D.DataInsert("INSERT INTO tblproduct(productname,quantity,price)VALUES('" + f.productname + "','" + f.quantity + "','" + f.price + "',)");
         if (i > 0)
         {
             ModelState.AddModelError("Success", "Save Success");
         }
         else
         {
             ModelState.AddModelError("Error", "Save Error");
         }
         D.Close();
     }
     return(RedirectToAction("Index", "Student"));
 }