Ejemplo n.º 1
0
        public ModelInvokeResult <ResidentIDNoRequisitionPK> Create(ResidentIDNoRequisition residentIDNoRequisition)
        {
            ModelInvokeResult <ResidentIDNoRequisitionPK> result = new ModelInvokeResult <ResidentIDNoRequisitionPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (residentIDNoRequisition.RequisitionId == GlobalManager.GuidAsAutoGenerate)
                {
                    residentIDNoRequisition.RequisitionId = Guid.NewGuid();
                }
                /***********************begin 自定义代码*******************/
                residentIDNoRequisition.OperatedBy = NormalSession.UserId.ToGuid();
                residentIDNoRequisition.OperatedOn = DateTime.Now;
                /***********************end 自定义代码*********************/
                residentIDNoRequisition.SubmitBy = NormalSession.UserId.ToGuid();
                residentIDNoRequisition.SubmitOn = DateTime.Now;
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = residentIDNoRequisition.GetCreateMethodName(), ParameterObject = residentIDNoRequisition.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });

                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ResidentIDNoRequisitionPK {
                    RequisitionId = residentIDNoRequisition.RequisitionId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public ModelInvokeResult <ResidentIDNoRequisitionPK> Nullify(string strRequisitionId)
        {
            ModelInvokeResult <ResidentIDNoRequisitionPK> result = new ModelInvokeResult <ResidentIDNoRequisitionPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_RequisitionId = strRequisitionId.ToGuid();
                if (_RequisitionId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                ResidentIDNoRequisition residentIDNoRequisition = new ResidentIDNoRequisition {
                    RequisitionId = _RequisitionId
                };
                /***********************begin 自定义代码*******************/
                residentIDNoRequisition.OperatedBy = NormalSession.UserId.ToGuid();
                residentIDNoRequisition.OperatedOn = DateTime.Now;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = residentIDNoRequisition.GetUpdateMethodName(), ParameterObject = residentIDNoRequisition.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ResidentIDNoRequisitionPK {
                    RequisitionId = _RequisitionId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Ejemplo n.º 3
0
        public InvokeResult NullifySelected(string strRequisitionIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrRequisitionIds = strRequisitionIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrRequisitionIds.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new ResidentIDNoRequisition().GetUpdateMethodName();
                foreach (string strRequisitionId in arrRequisitionIds)
                {
                    ResidentIDNoRequisition residentIDNoRequisition = new ResidentIDNoRequisition {
                        RequisitionId = strRequisitionId.ToGuid()
                    };
                    /***********************begin 自定义代码*******************/
                    residentIDNoRequisition.OperatedBy = NormalSession.UserId.ToGuid();
                    residentIDNoRequisition.OperatedOn = DateTime.Now;
                    /***********************end 自定义代码*********************/
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = residentIDNoRequisition.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }
                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Ejemplo n.º 4
0
        public InvokeResult DeleteSelected(string strRequisitionIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrRequisitionIds = strRequisitionIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrRequisitionIds.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new ResidentIDNoRequisition().GetDeleteMethodName();
                foreach (string strRequisitionId in arrRequisitionIds)
                {
                    ResidentIDNoRequisitionPK pk = new ResidentIDNoRequisitionPK {
                        RequisitionId = strRequisitionId.ToGuid()
                    };
                    DeleteCascade(statements, pk);
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = pk, Type = SqlExecuteType.DELETE
                    });
                }
                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Ejemplo n.º 5
0
        public ModelInvokeResult <ResidentIDNoRequisitionPK> IsRequisitionPass(string strRequisitionId, ResidentIDNoRequisition residentIDNoRequisition)
        {
            ModelInvokeResult <ResidentIDNoRequisitionPK> result = new ModelInvokeResult <ResidentIDNoRequisitionPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_RequisitionId = strRequisitionId.ToGuid();
                if (_RequisitionId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                residentIDNoRequisition.RequisitionId = _RequisitionId;
                /***********************begin 自定义代码*******************/
                residentIDNoRequisition.OperatedBy = NormalSession.UserId.ToGuid();
                residentIDNoRequisition.OperatedOn = DateTime.Now;
                residentIDNoRequisition.ConfirmBy  = NormalSession.UserId.ToGuid();
                residentIDNoRequisition.ConfirmOn  = DateTime.Now;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = residentIDNoRequisition.GetUpdateMethodName(), ParameterObject = residentIDNoRequisition.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                if (residentIDNoRequisition.DoStatus == 1)
                {
                    /***********************begin 更改区级库的身份证号码*******************/
                    List <IBatisNetBatchStatement> statements_oldManBaseInfo = new List <IBatisNetBatchStatement>();
                    OldManBaseInfo oldManBaseInfo = new OldManBaseInfo();
                    oldManBaseInfo.OldManId   = residentIDNoRequisition.ResidentId;
                    oldManBaseInfo.OperatedBy = NormalSession.UserId.ToGuid();
                    oldManBaseInfo.OperatedOn = DateTime.Now;
                    oldManBaseInfo.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                    oldManBaseInfo.IDNo       = residentIDNoRequisition.IDNoNew;
                    statements_oldManBaseInfo.Add(new IBatisNetBatchStatement {
                        StatementName = oldManBaseInfo.GetUpdateMethodName(), ParameterObject = oldManBaseInfo.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                    BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements_oldManBaseInfo);
                    /***********************end 更改区级库的身份证号码*********************/

                    /***********************begin 更改城市库的身份证号码*******************/
                    List <IBatisNetBatchStatement> statements_residentBaseInfo = new List <IBatisNetBatchStatement>();
                    ResidentBaseInfo residentBaseInfo = new ResidentBaseInfo();
                    residentBaseInfo.ResidentId = residentIDNoRequisition.ResidentId;
                    residentBaseInfo.OperatedBy = NormalSession.UserId.ToGuid();
                    residentBaseInfo.OperatedOn = DateTime.Now;
                    residentBaseInfo.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                    residentBaseInfo.IDNo       = residentIDNoRequisition.IDNoNew;
                    statements_residentBaseInfo.Add(new IBatisNetBatchStatement {
                        StatementName = residentBaseInfo.GetUpdateMethodName(), ParameterObject = residentBaseInfo.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                    BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements_residentBaseInfo);
                    /***********************end 更改城市库的身份证号码*********************/
                }
                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);

                /***********************begin 添加居民活动信息*******************/
                string sql_str = " insert into Bas_ResidentActivityLog (CheckInTime,ResidentId,ActivityTime,ActivityType,ActivityData,ActivityDescription,ActivityChangeType)"
                                 + " select  GETDATE() CheckInTime,a.ResidentId,GETDATE() ActivityTime,'00001' ActivityType"
                                 + ",'{\"Source\":\"07\",\"from\":\"07\",\"to\":\"07\",\"Operate\":\"变更身份证\",\"NewIDNo\":\"'+CAST( IDNoNew as varchar(20))+'\",\"OldIDNo\":\"'+CAST( IDNoOld as varchar(20))+'\",\"OperatedBy\":\"'+ISNULL(CAST( ConfirmBy as varchar(36)),'')+'\",\"AreaId\":\"'+CAST( b.AreaId as varchar(36))+'\",\"DoStatus\":\"" + residentIDNoRequisition.DoStatus + "\"}' ActivityData"
                                 + ",'变更身份证:结果\"" + (residentIDNoRequisition.DoStatus == 1 ? "通过" : "不通过") + "\",原身份证\"'+IDNoOld+'\"变更为\"'+IDNoNew+'\",\"所在辖区\":\"'+ItemName+'\"' ActivityDescription,'00001' ActivityChangeType"
                                 + " from Bas_ResidentIDNoRequisition a inner join Bas_ResidentBaseInfo b on a.ResidentId=b.ResidentId   inner join Sys_DictionaryItem c on b.AreaId=c.ItemId"
                                 + " where c.DictionaryId='00005' and RequisitionId='" + strRequisitionId + "'";
                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(sql_str);
                /***********************end 添加居民活动信息*******************/

                result.instance = new ResidentIDNoRequisitionPK {
                    RequisitionId = _RequisitionId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }