public static int InsertTaskAttachment(string taskId, string fileName, string contentType, int contentLength, byte[] fileContent)
        {
            int        retStatus = 0;
            BuildQuery qb        = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@TaskId", Guid.Parse(taskId), SqlDbType.UniqueIdentifier);
            qb.SetInParam("@FileName", fileName, SqlDbType.NVarChar);
            qb.SetInParam("@ContentType", contentType, SqlDbType.NVarChar);
            qb.SetInParam("@ContentLength", contentLength, SqlDbType.Int);
            qb.SetInParam("@FileContent", fileContent, SqlDbType.VarBinary);

            retStatus = Convert.ToInt32(qb.ExecuteNonQuery("InsertTaskAttachment"));
            return(retStatus);
        }
예제 #2
0
        public static long InsertVersionChangeCommit(VersionCommitDetails versionCommitDetails)
        {
            long       result;
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@VersionChangeId", versionCommitDetails.VersionChangeId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@GitCommitId", versionCommitDetails.GitCommitId, SqlDbType.NVarChar);
            qb.SetInParam("@CommittedBy", versionCommitDetails.CommittedBy, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@CommittedOn", versionCommitDetails.CommittedOn, SqlDbType.DateTime);
            qb.SetInParam("@CommittedFiles", versionCommitDetails.CommittedFiles, SqlDbType.NVarChar);
            qb.SetInParam("@CommitDescription", versionCommitDetails.CommittedDescription, SqlDbType.NVarChar);
            result = qb.ExecuteNonQuery("spInsertVersionChangeCommit");
            return(result);
        }
예제 #3
0
        public static void AddWorkLog(Guid workLogId, Guid userId, Nullable <int> jiraIssueId, DateTime workDate, decimal hours, string remarks, Guid taskId, Nullable <int> remainingEstimate)
        {
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@WorkLogId", workLogId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@UserId", userId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@JiraIssueId", jiraIssueId, SqlDbType.Int);
            qb.SetInParam("@WorkDate", workDate, SqlDbType.DateTime);
            qb.SetInParam("@Hours", hours, SqlDbType.Decimal);
            qb.SetInParam("@Remarks", remarks, SqlDbType.NVarChar);
            qb.SetInParam("@TaskId", taskId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@RemainingEstimate", remainingEstimate, SqlDbType.Int);
            qb.ExecuteNonQuery("spInsertWorkLog");
        }
예제 #4
0
        public static long InsertReleaseNote(Guid?versionId, string reference, int?type, string title, string remarks, bool?isPublic, Guid?releaseNoteSummaryId)
        {
            long       result;
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@VersionId", versionId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@Reference", reference, SqlDbType.NVarChar);
            qb.SetInParam("@Type", type, SqlDbType.Int);
            qb.SetInParam("@Title", title, SqlDbType.NVarChar);
            qb.SetInParam("@Remarks", remarks, SqlDbType.NVarChar);
            qb.SetInParam("@IsPublic", isPublic, SqlDbType.Bit);
            qb.SetInParam("@ReleaseNoteSummaryId", releaseNoteSummaryId, SqlDbType.UniqueIdentifier);
            result = qb.ExecuteNonQuery("spInsertReleaseNote");
            return(result);
        }
예제 #5
0
        public static int InsertProject(Project project, string userId)
        {
            int retStatus = 0;

            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@ClientId", project.ClientId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@Name", project.Name, SqlDbType.NVarChar);
            qb.SetInParam("@Code", project.Code, SqlDbType.NVarChar);
            qb.SetInParam("@Status", project.Status == true ? "1" : "0", SqlDbType.NVarChar);
            qb.SetInParam("@Description", project.Description, SqlDbType.NVarChar);
            qb.SetInParam("@CreatedBy", Guid.Parse(userId), SqlDbType.UniqueIdentifier);
            retStatus = Convert.ToInt32(qb.ExecuteNonQuery("spInsertProject"));
            return(retStatus);
        }
        public static int InsertAttachment(Attachment attachment)
        {
            int        retStatus = 0;
            BuildQuery qb        = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@EntityType", attachment.EntityType, SqlDbType.Int);
            qb.SetInParam("@EntityId", attachment.EntityId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@FileName", attachment.FileName, SqlDbType.NVarChar);
            qb.SetInParam("@ContentType", attachment.ContentType, SqlDbType.NVarChar);
            qb.SetInParam("@ContentLength", attachment.ContentLength, SqlDbType.Int);
            qb.SetInParam("@FileContent", attachment.FileContent, SqlDbType.VarBinary);
            qb.SetInParam("@UploadedBy", attachment.UploadedBy, SqlDbType.UniqueIdentifier);
            retStatus = Convert.ToInt32(qb.ExecuteNonQuery("InsertAttachment"));
            return(retStatus);
        }
예제 #7
0
        public static int InsertComponent(ProjectComponent component, string projectId, string userId)
        {
            int retStatus = 0;

            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@ProjectId", Guid.Parse(projectId), SqlDbType.UniqueIdentifier);
            qb.SetInParam("@ComponentName", component.Name, SqlDbType.NVarChar);
            qb.SetInParam("@CreatedBy", Guid.Parse(userId), SqlDbType.UniqueIdentifier);
            qb.SetInParam("@IsDBComponent", component.IsDBComponent, SqlDbType.Bit);
            qb.SetInParam("@IsVersionComponent", component.IsVersionComponent, SqlDbType.Bit);
            qb.SetInParam("@GitUrl", component.GitUrl, SqlDbType.NVarChar);
            qb.SetInParam("@BuildPrefixForConfig", component.BuildPrefixForConfig, SqlDbType.NVarChar);
            retStatus = Convert.ToInt32(qb.ExecuteNonQuery("spInsertComponents"));
            return(retStatus);
        }
예제 #8
0
 public static long DeleteHoliday(DateTime holidaydate)
 {
     try
     {
         long       result;
         BuildQuery bq = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
         bq.ClearParameters();
         bq.SetInParam("@HolidayDate", holidaydate, SqlDbType.DateTime);
         result = bq.ExecuteNonQuery("spDeleteHoliday");
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #9
0
        public static long AddVersion(Guid?componentId, string version, string buildBy, DateTime?buildOn, string dBBuilds, bool?isLocked, Guid?createdBy, Guid?modifiedBy)
        {
            long       result;
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@ComponentId", componentId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@Version", version, SqlDbType.NVarChar);
            qb.SetInParam("@BuildBy", buildBy, SqlDbType.NVarChar);
            qb.SetInParam("@BuildOn", buildOn, SqlDbType.DateTime);
            qb.SetInParam("@DBBuilds", dBBuilds, SqlDbType.NVarChar);
            qb.SetInParam("@IsLocked", isLocked, SqlDbType.Bit);
            qb.SetInParam("@CreatedBy", createdBy, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@ModifiedBy", modifiedBy, SqlDbType.UniqueIdentifier);
            result = qb.ExecuteNonQuery("spInsertVersionData");
            return(result);
        }
예제 #10
0
        public static long UpdateVersionDetail(Guid?versionChangeId, string reference, string fileChanges, string dBChanges, string description, string changedBy, DateTime?changedOn, int qAStatus)
        {
            long       result;
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@VersionChangeId", versionChangeId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@Reference", reference, SqlDbType.NVarChar);
            qb.SetInParam("@FileChanges", fileChanges, SqlDbType.NVarChar);
            qb.SetInParam("@DBChanges", dBChanges, SqlDbType.NVarChar);
            qb.SetInParam("@Description", description, SqlDbType.NVarChar);
            qb.SetInParam("@ChangedBy", changedBy, SqlDbType.NVarChar);
            qb.SetInParam("@ChangedOn", changedOn, SqlDbType.DateTime);
            qb.SetInParam("@QAStatus", qAStatus, SqlDbType.Int);
            result = qb.ExecuteNonQuery("spUpdateDetailVersionData");
            return(result);
        }
예제 #11
0
        public static long InsertAttendance(Guid?employeeId, DateTime?attendanceDate, DateTime?inTime, DateTime?outTime, decimal?attendance, bool?isWorkFromHome, int?totalMinute, string remarks)
        {
            long       result;
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@EmployeeId", employeeId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@AttendanceDate", attendanceDate, SqlDbType.DateTime);
            qb.SetInParam("@InTime", inTime, SqlDbType.DateTime);
            qb.SetInParam("@OutTime", outTime, SqlDbType.DateTime);
            qb.SetInParam("@Attendance", attendance, SqlDbType.Decimal);
            qb.SetInParam("@IsWorkFromHome", isWorkFromHome, SqlDbType.Bit);
            qb.SetInParam("@TotalMinute", totalMinute, SqlDbType.Int);
            qb.SetInParam("@Remarks", remarks, SqlDbType.NVarChar);
            result = qb.ExecuteNonQuery("spInsertAttendance");
            return(result);
        }
예제 #12
0
        public static long InsertTaxSavingReceipt(Guid?employeeId, int?financialYear, int?taxSavingType, int?recurringFrequency, DateTime?savingDate, string accountNumber, float?amount, string remarks, int eligibleCount)
        {
            long       result;
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@EmployeeId", employeeId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@FinancialYear", financialYear, SqlDbType.Int);
            qb.SetInParam("@TaxSavingType", taxSavingType, SqlDbType.Int);
            qb.SetInParam("@RecurringFrequency", recurringFrequency, SqlDbType.Int);
            qb.SetInParam("@SavingDate", savingDate, SqlDbType.DateTime);
            qb.SetInParam("@AccountNumber", accountNumber, SqlDbType.NVarChar);
            qb.SetInParam("@Amount", amount, SqlDbType.Decimal);
            qb.SetInParam("@Remarks", remarks, SqlDbType.NVarChar);
            qb.SetInParam("@EligibleCount", eligibleCount, SqlDbType.Int);
            result = qb.ExecuteNonQuery("spInsertTaxSavingReceipt");
            return(result);
        }
        public static long InsertDBScript(Guid?dBBuildId, string name, string description, int?dBScriptType, int?dBChangeType, string reference, string script, DateTime?changedOn, Guid?changedBy, Guid?createdBy)
        {
            long       result;
            BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@DBBuildId", dBBuildId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@Name", name, SqlDbType.NVarChar);
            qb.SetInParam("@Description", description, SqlDbType.NVarChar);
            qb.SetInParam("@DBScriptType", dBScriptType, SqlDbType.Int);
            qb.SetInParam("@DBChangeType", dBChangeType, SqlDbType.Int);
            qb.SetInParam("@Reference", reference, SqlDbType.NVarChar);
            qb.SetInParam("@Script", script, SqlDbType.NVarChar);
            qb.SetInParam("@ChangedOn", changedOn, SqlDbType.DateTime);
            qb.SetInParam("@ChangedBy", changedBy, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@CreatedBy", createdBy, SqlDbType.UniqueIdentifier);
            result = qb.ExecuteNonQuery("spInsertDBScript");
            return(result);
        }
예제 #14
0
 public static long UpdateHoliday(HolidayModel holiday)
 {
     try
     {
         long       result;
         BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
         qb.ClearParameters();
         qb.SetInParam("@HolidayDate", holiday.HolidayDate, SqlDbType.DateTime);
         qb.SetInParam("@Name", holiday.Name, SqlDbType.NVarChar);
         qb.SetInParam("@Remarks", holiday.Remark, SqlDbType.NVarChar);
         result = qb.ExecuteNonQuery("spUpdateHoliday", CommandType.StoredProcedure);
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #15
0
        public static int Insert(TaskListModel task)
        {
            int        retStatus = 0;
            BuildQuery qb        = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());

            qb.SetInParam("@ProjectId", task.ProjectId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@Summary", task.Summary, SqlDbType.NVarChar);
            qb.SetInParam("@TaskType", task.TaskType, SqlDbType.Int);
            qb.SetInParam("@Status", task.StatusId, SqlDbType.Int);
            qb.SetInParam("@PriorityType", task.PriorityType, SqlDbType.Int);
            qb.SetInParam("@ResolutionType", task.ResolutionType, SqlDbType.Int);
            qb.SetInParam("@Assignee", task.Assignee, SqlDbType.NVarChar);
            qb.SetInParam("@Reporter", task.Reporter, SqlDbType.NVarChar);
            qb.SetInParam("@ComponentId", task.ComponentId, SqlDbType.UniqueIdentifier);
            qb.SetInParam("@DueDate", task.DueDate, SqlDbType.DateTime);
            qb.SetInParam("@OriginalEstimate", task.OriginalEstimate, SqlDbType.Int);
            qb.SetInParam("@TimeSpent", task.TimeSpent, SqlDbType.Int);
            qb.SetInParam("@RemainingEstimate", task.RemainingEstimate, SqlDbType.Int);
            qb.SetInParam("@Description", task.Description, SqlDbType.NVarChar);
            qb.SetInParam("@Area", task.Area, SqlDbType.NVarChar);
            qb.SetInParam("@CreatedBy", task.CreatedBy, SqlDbType.UniqueIdentifier);
            retStatus = Convert.ToInt32(qb.ExecuteNonQuery("spInsertTask"));
            return(retStatus);
        }