public int DeleteFeatureCategory(string featureCategoryId)
        {
            string sql = sqlRepositoryHelper.DeleteFeatureCategory;
            List <SqlParameter> parameterCollection = new List <SqlParameter>();

            parameterCollection.Add(new SqlParameter("Input", featureCategoryId));

            int result = 0;

            using (DBDataHelper helper = new DBDataHelper())
            {
                result = helper.GetRowsAffected(sql, SQLTextType.Stored_Proc, parameterCollection);
            }

            return(result);
        }
示例#2
0
        public int DeleteLanguageCode(string iso6393Code)
        {
            string sql = sqlRepositoryHelper.DeleteLanuage;
            List <SqlParameter> parameterCollection = new List <SqlParameter>();

            parameterCollection.Add(new SqlParameter("Input", iso6393Code));

            int result = 0;

            using (DBDataHelper helper = new DBDataHelper())
            {
                result = helper.GetRowsAffected(sql, SQLTextType.Stored_Proc, parameterCollection);
            }

            return(result);
        }
 /// <summary>
 /// This method assigns the task to different persons.
 /// </summary>
 /// <param name="task">An object of type Task containing the details of the task.</param>
 /// <returns>It returns true if the task is successfully assigned to all the persons.</returns>
 public bool AssignTaskToFaculties(Task task)
 {
     DataTable table = new DataTable("data");
     table.Columns.Add("TaskID");
     table.Columns.Add("PersonID");
     table.Columns.Add("TaskStatusID");
     foreach (Faculty faculty in task.AssignedTo)
     {
         table.Rows.Add(new object[] { task.ID, faculty.ID, 1 });
     }
     int result = 0;
     SqlParameter TaskFacultiesTVP = new SqlParameter("TaskFacultiesTVP", table);
     TaskFacultiesTVP.SqlDbType = SqlDbType.Structured;
     List<SqlParameter> parameterCollection = new List<SqlParameter>() { TaskFacultiesTVP };
     using (DBDataHelper helper = new DBDataHelper())
     {
         result = helper.GetRowsAffected("dbo.AssignTaskToFaculties", SQLTextType.Stored_Proc, parameterCollection);
     }
     if (result > 0)
         return true;
     else
         return false;
 }
 /// <summary>
 /// This method updates the status of a task.
 /// </summary>
 /// <param name="taskID">An integer parameter containing the ID of the task.</param>
 /// <param name="status">An object of Enum TaskStatusType containing the updated status.</param>
 /// <returns>It returns true if the status is successfully updated.</returns>
 public bool UpdateTaskStatus(int taskID,TaskStatusType status,int facultyID)
 {
     SqlParameter TaskID = new SqlParameter("taskID", taskID);
     SqlParameter TaskStatusID = new SqlParameter("taskStatusID", (int)status);
     SqlParameter FacultyID = new SqlParameter("facultyID", facultyID);
     List<SqlParameter> parameterCollection = new List<SqlParameter>() { TaskID, TaskStatusID, FacultyID };
     int rowsAffected = 0;
     using(DBDataHelper helper = new DBDataHelper())
     {
         rowsAffected = helper.GetRowsAffected("dbo.UpdateTaskStatus", SQLTextType.Stored_Proc, parameterCollection);
     }
     if (rowsAffected != 0)
         return true;
     else
         return false;
 }
 /// <summary>
 /// This method updates the details of the faculty in the database.
 /// </summary>
 /// <param name="faculty">An object of Faculty class containing the details of the faculty.</param>
 /// <returns>It returns true if the details are updated successfully otherwise false.</returns>
 public bool UpdateFacultyDetails(Faculty faculty)
 {
     SqlParameter FacultyID = new SqlParameter("facultyID", faculty.ID);
     SqlParameter Name = new SqlParameter("name", faculty.Name);
     SqlParameter ImageURL = new SqlParameter("imageURL", faculty.ImageURL);
     SqlParameter EmailID = new SqlParameter("emailID", faculty.EmailID);
     SqlParameter ContactNo = new SqlParameter("contactNo", faculty.ContactNo);
     SqlParameter DepartmentID = new SqlParameter("departmentID", (int)faculty.Department);
     SqlParameter DesignationID = new SqlParameter("designationID", (int)faculty.Designation);
     List<SqlParameter> parameterCollection = new List<SqlParameter>(){
         FacultyID,Name,ImageURL,EmailID,ContactNo,DepartmentID,DesignationID
     };
     int result = 0;
     using(DBDataHelper helper = new DBDataHelper())
     {
         result = helper.GetRowsAffected("dbo.UpdateFacultyDetails", SQLTextType.Stored_Proc, parameterCollection);
     }
     if (result > 0)
         return true;
     else
         return false;
 }
 public bool DeleteTask(int taskID)
 {
     SqlParameter TaskID = new SqlParameter("taskID", taskID);
     List<SqlParameter> parameterCollection = new List<SqlParameter>();
     parameterCollection.Add(TaskID);
     int taskDeleted;
     using (DBDataHelper helper = new DBDataHelper())
     {
         taskDeleted = helper.GetRowsAffected("dbo.DeleteTask", SQLTextType.Stored_Proc, parameterCollection);
     }
     if (taskDeleted != 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
 /// <summary>
 /// This method updates the details of the task in the database.
 /// </summary>
 /// <param name="taskID">An integer parameter containing the ID of the task to be updated.</param>
 /// <returns>It returns true if the task is updated otherwise false.</returns>
 public bool UpdateTaskDetails(int taskID)
 {
     SqlParameter TaskID = new SqlParameter("taskID", taskID);
     List<SqlParameter> parameterCollection = new List<SqlParameter> { TaskID };
     int result;
     using (DBDataHelper helper = new DBDataHelper())
     {
         result = helper.GetRowsAffected("dbo.UpdateTaskDetails", SQLTextType.Stored_Proc, parameterCollection);
     }
     if (result > 0)
         return true;
     else
         return false;
 }