Esempio n. 1
0
 public bool Save(StudentModel category)
 {
     try
     {
         var query       = "INSERT INTO tblStudent (DepartmentId, CourseId, StudentName,Roll,Email) VALUES('" + category.DepartmentId + "','" + category.CourseId + "','" + category.StudentName + "','" + category.Roll + "','" + category.Email + "')";
         var rowAffected = _sDB.ExecuteNonQuery(query, _connectionString);
         return(rowAffected > 0);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 2
0
 public bool Save(DepartmentModel category)
 {
     try
     {
         var query       = "INSERT INTO tblDepartment (Code, Department) VALUES('" + category.Code + "','" + category.Department + "')";
         var rowAffected = _sDB.ExecuteNonQuery(query, _connectionString);
         return(rowAffected > 0);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }