Exemple #1
0
        public bool IsSupport(int UserId, long ResourceId)
        {
            var bulider = new SelectBuilder("select id from supportrecord")
                          .RegisterEqualClause("UserId", UserId)
                          .RegisterEqualClause("ResourceId", ResourceId);

            return(AdoProvide.ExecuteScalar <int>(ReadConnectionString, bulider) > 0);
        }
Exemple #2
0
        /// <summary>
        /// 是否完成本次所有的单元作业
        /// </summary>
        /// <param name="recordId"></param>
        /// <param name="doWorkId"></param>
        /// <returns></returns>
        public bool IsCompletedAllUnits(long recordId, long doWorkId)
        {
            var builder = "SELECT COUNT(*) = (SELECT COUNT(*) FROM workResource WHERE RecordId = @recordId) FROM unitworks WHERE DoWorkId = @doWorkId AND RecordId = @recordId AND `Status` = 3";

            var _params = new IDataParameter[] {
                AdoProvide.BuildParameter("@recordId", recordId),
                AdoProvide.BuildParameter("@doWorkId", doWorkId)
            };

            return(AdoProvide.ExecuteScalar <int>(WriteConnectionString, builder, _params) == 1);
        }
        /// <summary>
        /// 添加资源打包布置总表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long InsertWorkFilePackage(WorkFilePackageContract model)
        {
            var bulider = new InsertBuilder("workfilepackage")
                          .RegisterField("RecordId", model.RecordId)
                          .RegisterField("FilePackageName", model.FilePackageName)
                          .RegisterField("FilePackageType", model.FilePackageType)
                          .RegisterField("UserId", model.UserId)
                          .RegisterField("UserName", model.UserName ?? string.Empty)
                          .RegisterField("CreateDate", model.CreateDate)
                          .RegisterField("Status", model.Status);

            return(AdoProvide.ExecuteScalar <long>(WriteConnectionString, bulider));
        }
Exemple #4
0
        /// <summary>
        /// 更新做作业信息以及统计数据
        /// </summary>
        /// <param name="doworkId"></param>
        /// <param name="submitDate"></param>
        /// <returns></returns>
        public bool UpdateDoWorkStatus(long doworkId, DateTime submitDate, int workStatus, int workLong, decimal actualScore)
        {
            var builder = "CALL Proc_SetWorkOnlineInfo(@DoWorkID,@SubmitDate,@WorkStatus,@WorkLong,@ActualScore,0,0)";

            var _params = new IDataParameter[] {
                AdoProvide.BuildParameter("@DoWorkID", doworkId),
                AdoProvide.BuildParameter("@SubmitDate", submitDate),
                AdoProvide.BuildParameter("@WorkStatus", workStatus),
                AdoProvide.BuildParameter("@WorkLong", workLong),
                AdoProvide.BuildParameter("@ActualScore", actualScore)
            };

            return(AdoProvide.ExecuteScalar <int>(WriteConnectionString, builder, _params) == 1);
        }
Exemple #5
0
        /// <summary>
        /// 添加资源打包布置总表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long InsertPublishRecord(PublishRecordContract model)
        {
            var bulider = new InsertBuilder("publishRecord")
                          .RegisterField("ProductId", model.ProductId)
                          .RegisterField("AppId", model.AppId)
                          .RegisterField("PackageId", model.PackageId)
                          .RegisterField("PackageName", model.PackageName ?? string.Empty)
                          .RegisterField("PackageType", model.PackageType)
                          .RegisterField("UserId", model.UserId)
                          .RegisterField("UserName", model.UserName ?? string.Empty)
                          .RegisterField("CreateDate", model.CreateDate)
                          .RegisterField("Status", model.Status);

            return(AdoProvide.ExecuteScalar <long>(WriteConnectionString, bulider));
        }
Exemple #6
0
        /// <summary>
        /// 添加打包资源
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long InsertWorkResource(WorkResourceContract model)
        {
            var bulider = new InsertBuilder("workResource")
                          .RegisterField("RecordId", model.RecordId)
                          .RegisterField("PackageId", model.PackageId)
                          .RegisterField("TaskId", model.TaskId)
                          .RegisterField("ModuleId", model.ModuleId)
                          .RegisterField("VersionId", model.VersionId)
                          .RegisterField("RelationPath", model.RelationPath ?? model.VersionId.ToString())
                          .RegisterField("SonModuleId", model.SonModuleId ?? string.Empty)
                          .RegisterField("ResourceName", model.ResourceName ?? string.Empty)
                          .RegisterField("ResourceType", model.ResourceType ?? string.Empty)
                          .RegisterField("RequirementContent", model.RequirementContent ?? string.Empty)
                          .RegisterField("IsFull", model.IsFull);

            model.ContentId = AdoProvide.ExecuteScalar <long>(WriteConnectionString, bulider);
            return(model.ContentId);
        }
Exemple #7
0
        /// <summary>
        /// 添加单元作业完成记录,返回自增id
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long Insert(FileWorksContracts model)
        {
            var bulider = new InsertBuilder("fileWorks")
                          .RegisterField("RecordId", model.RecordId)
                          .RegisterField("WorkId", model.WorkId)
                          .RegisterField("DoWorkId", model.DoWorkId)
                          .RegisterField("SubmitUserId", model.SubmitUserId)
                          .RegisterField("SubmitUserName", model.SubmitUserName ?? string.Empty)
                          .RegisterField("WorkLevel", model.WorkLevel)
                          .RegisterField("WorkLong", model.WorkLong)
                          .RegisterField("SubmitDate", model.SubmitDate)
                          .RegisterField("IsTimeOut", model.IsTimeOut)
                          .RegisterField("SubmitCount", model.SubmitCount)
                          .RegisterField("Message", model.Message ?? string.Empty)
                          .RegisterField("Comment", model.Comment ?? string.Empty)
                          .RegisterField("CommentType", model.CommentType)
                          .RegisterField("FileCount", model.FileCount)
                          .RegisterField("Status", model.Status);

            model.DoId = AdoProvide.ExecuteScalar <long>(WriteConnectionString, bulider);

            return(model.DoId);
        }
Exemple #8
0
        /// <summary>
        /// 添加单元作业完成记录,返回自增id
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long Insert(UnitWorksContract model)
        {
            var bulider = new InsertBuilder("unitworks")
                          .RegisterField("ContentId", model.ContentId)
                          .RegisterField("RecordId", model.RecordId)
                          .RegisterField("WorkId", model.WorkId)
                          .RegisterField("DoWorkId", model.DoWorkId)
                          .RegisterField("SubmitUserId", model.SubmitUserId)
                          .RegisterField("SubmitUserName", model.SubmitUserName ?? string.Empty)
                          .RegisterField("WorkScore", model.WorkScore)
                          .RegisterField("ActualScore", model.ActualScore)
                          .RegisterField("CorrectRate", model.CorrectRate)
                          .RegisterField("WorkLong", model.WorkLong)
                          .RegisterField("SubmitDate", model.SubmitDate)
                          .RegisterField("IsTimeOut", model.IsTimeOut)
                          .RegisterField("SubmitCount", model.SubmitCount)
                          .RegisterField("Comment", model.Comment ?? string.Empty)
                          .RegisterField("CommentType", model.CommentType)
                          .RegisterField("Status", model.Status);

            model.DoId = AdoProvide.ExecuteScalar <long>(WriteConnectionString, bulider);

            return(model.DoId);
        }
        /// <summary>
        /// 添加自主练习记录,返回自增id
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long Insert(IndepPracticeContract model)
        {
            var bulider = new InsertBuilder("indeppractice")
                          .RegisterField("ProductId", model.ProductId)
                          .RegisterField("AppId", model.AppId)
                          .RegisterField("PackageId", model.PackageId)
                          .RegisterField("PackageName", model.PackageName)
                          .RegisterField("PackageType", model.PackageType)
                          .RegisterField("TaskId", model.TaskId)
                          .RegisterField("ResourceType", model.ResourceType)
                          .RegisterField("VersionId", model.VersionId)
                          .RegisterField("ResourceName", model.ResourceName)
                          .RegisterField("ModuleId", model.ModuleId)
                          .RegisterField("SubmitUserId", model.SubmitUserId)
                          .RegisterField("SubmitUserName", model.SubmitUserName)
                          .RegisterField("WorkScore", model.WorkScore)
                          .RegisterField("ActualScore", model.ActualScore)
                          .RegisterField("CorrectRate", model.CorrectRate)
                          .RegisterField("WorkLong", model.WorkLong)
                          .RegisterField("CreateDate", model.CreateDate)
                          .RegisterField("Status", model.Status);

            return(AdoProvide.ExecuteScalar <long>(WriteConnectionString, bulider));
        }