예제 #1
0
        public ModelInvokeResult <EvaluatedReportPK> Update(string strReportId, EvaluatedReport evaluatedReport)
        {
            ModelInvokeResult <EvaluatedReportPK> result = new ModelInvokeResult <EvaluatedReportPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_ReportId = strReportId.ToGuid();
                if (_ReportId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }

                evaluatedReport.ReportId = _ReportId;
                /***********************begin 自定义代码*******************/
                //社区审核
                if (evaluatedReport.CommunityChecker == GlobalManager.GuidAsAutoGenerate)
                {
                    evaluatedReport.CommunityChecker = NormalSession.UserId.ToGuid();
                }
                else if (evaluatedReport.StreetExaminer == GlobalManager.GuidAsAutoGenerate)
                {//街道审核
                    evaluatedReport.StreetExaminer = NormalSession.UserId.ToGuid();
                }
                else if (evaluatedReport.CityApproval == GlobalManager.GuidAsAutoGenerate)
                {//市民政审核
                    evaluatedReport.CityApproval = NormalSession.UserId.ToGuid();
                }
                else
                {
                    evaluatedReport.OperatedBy = NormalSession.UserId.ToGuid();
                    evaluatedReport.OperatedOn = DateTime.Now;
                }
                evaluatedReport.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = evaluatedReport.GetUpdateMethodName(), ParameterObject = evaluatedReport.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);
                result.instance = new EvaluatedReportPK {
                    ReportId = _ReportId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
예제 #2
0
        public InvokeResult UpdateEvaluatedPrintNo(string strReportIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();


                List <string> sqlParamsList = new List <string>();
                Guid?         _ReportId;
                string[]      reportIdArr = strReportIds.Split('|');
                for (int i = 0; i < reportIdArr.Length; i++)
                {
                    _ReportId = reportIdArr[i].ToGuid();
                    if (_ReportId != null)
                    {
                        sqlParamsList.Add(string.Format("'{0}'", reportIdArr[i]));
                    }
                }

                var evaluatedReportList = BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlForQuery("select ReportId,PrintNo from Eva_EvaluatedReport where ReportId in(" + string.Join(" , ", sqlParamsList.ToArray()) + ")");

                EvaluatedReport evaluatedReport;
                foreach (var item in evaluatedReportList)
                {
                    evaluatedReport          = new EvaluatedReport();
                    evaluatedReport.ReportId = item["ReportId"].ToString().ToGuid();
                    evaluatedReport.PrintNo  = (item["PrintNo"] != null ? int.Parse(item["PrintNo"].ToString()) : 0) + 1;
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = evaluatedReport.GetUpdateMethodName(), ParameterObject = evaluatedReport.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }

                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }