/// <summary> /// Creates a new UserTasks record /// </summary> public static void Create(UserTasksDO DO) { SqlParameter _Login = new SqlParameter("Login", SqlDbType.VarChar); SqlParameter _PermitId = new SqlParameter("PermitId", SqlDbType.VarChar); SqlParameter _BusinessProcess = new SqlParameter("BusinessProcess", SqlDbType.VarChar); SqlParameter _WorkflowCategory = new SqlParameter("WorkflowCategory", SqlDbType.VarChar); SqlParameter _PermitIdSiteName = new SqlParameter("PermitIdSiteName", SqlDbType.VarChar); SqlParameter _Subject = new SqlParameter("Subject", SqlDbType.VarChar); SqlParameter _SubjectDescription = new SqlParameter("SubjectDescription", SqlDbType.VarChar); SqlParameter _DateAssigned = new SqlParameter("DateAssigned", SqlDbType.DateTime); SqlParameter _DueDate = new SqlParameter("DueDate", SqlDbType.DateTime); SqlParameter _CompletionDate = new SqlParameter("CompletionDate", SqlDbType.DateTime); SqlParameter _SpecialInstructions = new SqlParameter("SpecialInstructions", SqlDbType.VarChar); _Login.Value = DO.Login; _PermitId.Value = DO.PermitId; _BusinessProcess.Value = DO.BusinessProcess; _WorkflowCategory.Value = DO.WorkflowCategory; _PermitIdSiteName.Value = DO.PermitIdSiteName; _Subject.Value = DO.Subject; _SubjectDescription.Value = DO.SubjectDescription; _DateAssigned.Value = DO.DateAssigned; _DueDate.Value = DO.DueDate; _CompletionDate.Value = DO.CompletionDate; _SpecialInstructions.Value = DO.SpecialInstructions; SqlParameter[] _params = new SqlParameter[] { _Login, _PermitId, _BusinessProcess, _WorkflowCategory, _PermitIdSiteName, _Subject, _SubjectDescription, _DateAssigned, _DueDate, _CompletionDate, _SpecialInstructions }; DataCommon.ExecuteNonQuery("[dbo].[UserTasks_Insert]", _params, "dbo"); }
/// <summary> /// Deletes a UserTasks record /// </summary> public static int Delete(UserTasksDO DO) { SqlParameter _Login = new SqlParameter("Login", SqlDbType.VarChar); SqlParameter _PermitId = new SqlParameter("PermitId", SqlDbType.VarChar); SqlParameter _BusinessProcess = new SqlParameter("BusinessProcess", SqlDbType.VarChar); SqlParameter _Subject = new SqlParameter("Subject", SqlDbType.VarChar); SqlParameter _DateAssigned = new SqlParameter("DateAssigned", SqlDbType.DateTime); _Login.Value = DO.Login; _PermitId.Value = DO.PermitId; _BusinessProcess.Value = DO.BusinessProcess; _Subject.Value = DO.Subject; _DateAssigned.Value = DO.DateAssigned; SqlParameter[] _params = new SqlParameter[] { _Login, _PermitId, _BusinessProcess, _Subject, _DateAssigned }; return DataCommon.ExecuteScalar("[dbo].[UserTasks_Delete]", _params, "dbo"); }
/// <summary> /// Selects UserTasks records by PK /// </summary> public static UserTasksDO[] GetByPK(String Login, String PermitId, String BusinessProcess, String Subject, DateTime DateAssigned) { SqlParameter _Login = new SqlParameter("Login", SqlDbType.VarChar); SqlParameter _PermitId = new SqlParameter("PermitId", SqlDbType.VarChar); SqlParameter _BusinessProcess = new SqlParameter("BusinessProcess", SqlDbType.VarChar); SqlParameter _Subject = new SqlParameter("Subject", SqlDbType.VarChar); SqlParameter _DateAssigned = new SqlParameter("DateAssigned", SqlDbType.DateTime); _Login.Value = Login; _PermitId.Value = PermitId; _BusinessProcess.Value = BusinessProcess; _Subject.Value = Subject; _DateAssigned.Value = DateAssigned; SqlParameter[] _params = new SqlParameter[] { _Login, _PermitId, _BusinessProcess, _Subject, _DateAssigned }; SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[UserTasks_GetByPK]", _params, "dbo"); List<UserTasksDO> objs = new List<UserTasksDO>(); while(sr.Read()) { UserTasksDO obj = new UserTasksDO(); obj.Login = sr.GetString(sr.GetOrdinal("Login")); obj.PermitId = sr.GetString(sr.GetOrdinal("PermitId")); obj.BusinessProcess = sr.GetString(sr.GetOrdinal("BusinessProcess")); obj.WorkflowCategory = sr.GetString(sr.GetOrdinal("WorkflowCategory")); obj.PermitIdSiteName = sr.GetString(sr.GetOrdinal("PermitIdSiteName")); obj.Subject = sr.GetString(sr.GetOrdinal("Subject")); obj.SubjectDescription = sr.GetString(sr.GetOrdinal("SubjectDescription")); obj.DateAssigned = sr.GetDateTime(sr.GetOrdinal("DateAssigned")); if (sr.IsDBNull(sr.GetOrdinal("DueDate"))) { obj.DueDate = null; } else { obj.DueDate = sr.GetDateTime(sr.GetOrdinal("DueDate")); } if (sr.IsDBNull(sr.GetOrdinal("CompletionDate"))) { obj.CompletionDate = null; } else { obj.CompletionDate = sr.GetDateTime(sr.GetOrdinal("CompletionDate")); } if (sr.IsDBNull(sr.GetOrdinal("SpecialInstructions"))) { obj.SpecialInstructions = null; } else { obj.SpecialInstructions = sr.GetString(sr.GetOrdinal("SpecialInstructions")); } objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Gets all UserTasks records /// </summary> public static UserTasksDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[UserTasks_GetAll]", new SqlParameter[] { }, "dbo"); List<UserTasksDO> objs = new List<UserTasksDO>(); while(sr.Read()){ UserTasksDO obj = new UserTasksDO(); obj.Login = sr.GetString(sr.GetOrdinal("Login")); obj.PermitId = sr.GetString(sr.GetOrdinal("PermitId")); obj.BusinessProcess = sr.GetString(sr.GetOrdinal("BusinessProcess")); obj.WorkflowCategory = sr.GetString(sr.GetOrdinal("WorkflowCategory")); obj.PermitIdSiteName = sr.GetString(sr.GetOrdinal("PermitIdSiteName")); obj.Subject = sr.GetString(sr.GetOrdinal("Subject")); obj.SubjectDescription = sr.GetString(sr.GetOrdinal("SubjectDescription")); obj.DateAssigned = sr.GetDateTime(sr.GetOrdinal("DateAssigned")); if (sr.IsDBNull(sr.GetOrdinal("DueDate"))) { obj.DueDate = null; } else { obj.DueDate = sr.GetDateTime(sr.GetOrdinal("DueDate")); } if (sr.IsDBNull(sr.GetOrdinal("CompletionDate"))) { obj.CompletionDate = null; } else { obj.CompletionDate = sr.GetDateTime(sr.GetOrdinal("CompletionDate")); } if (sr.IsDBNull(sr.GetOrdinal("SpecialInstructions"))) { obj.SpecialInstructions = null; } else { obj.SpecialInstructions = sr.GetString(sr.GetOrdinal("SpecialInstructions")); } objs.Add(obj); } return objs.ToArray(); }