Exemplo n.º 1
0
        public ModelInvokeResult <AssessmentResultPK> Create(AssessmentResult assessmentResult)
        {
            ModelInvokeResult <AssessmentResultPK> result = new ModelInvokeResult <AssessmentResultPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                /***********************begin 自定义代码*******************/
                assessmentResult.OperatedBy = NormalSession.UserId.ToGuid();
                assessmentResult.OperatedOn = DateTime.Now;
                assessmentResult.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = assessmentResult.GetCreateMethodName(), ParameterObject = assessmentResult.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new AssessmentResultPK {
                    Id = assessmentResult.Id
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Exemplo n.º 2
0
        public InvokeResult CreateAssessment(string strOldManId, IList <AssessmentItem> assessmentItems)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                AssessmentResult assessmentResult         = new AssessmentResult();
                foreach (AssessmentItem assessmentItem in assessmentItems)
                {
                    /***********************begin 自定义代码*******************/
                    assessmentResult.Id               = null;
                    assessmentResult.OperatedBy       = NormalSession.UserId.ToGuid();
                    assessmentResult.OperatedOn       = DateTime.Now;
                    assessmentResult.DataSource       = GlobalManager.DIKey_00012_ManualEdit;
                    assessmentResult.OldManId         = strOldManId.ToGuid();
                    assessmentResult.WorkItem         = assessmentItem.WorkItem;
                    assessmentResult.WorkSchedule     = assessmentItem.WorkSchedule;
                    assessmentResult.Workload         = assessmentItem.Workload;
                    assessmentResult.RemindFlag       = assessmentItem.RemindFlag;
                    assessmentResult.RemindRepeats    = assessmentItem.RemindRepeats;
                    assessmentResult.PlayRepeats      = assessmentItem.PlayRepeats;
                    assessmentResult.CheckDescription = assessmentItem.Remark;
                    /***********************end 自定义代码*********************/
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = assessmentResult.GetCreateMethodName(), ParameterObject = assessmentResult.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                    });
                    /***********************begin 自定义代码*******************/
                    /***********************此处添加自定义代码*****************/
                    /***********************end 自定义代码*********************/
                }
                if (statements.Count > 0)
                {
                    BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }