public ModelInvokeResult <FlowDefinePK> Create(FlowDefine flowDefine)
        {
            ModelInvokeResult <FlowDefinePK> result = new ModelInvokeResult <FlowDefinePK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (flowDefine.FlowDefineId == GlobalManager.GuidAsAutoGenerate)
                {
                    flowDefine.FlowDefineId = Guid.NewGuid();
                }
                /***********************begin 自定义代码*******************/
                flowDefine.OperatedBy = NormalSession.UserId.ToGuid();
                flowDefine.OperatedOn = DateTime.Now;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = flowDefine.GetCreateMethodName(), ParameterObject = flowDefine.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements);
                result.instance = new FlowDefinePK {
                    FlowDefineId = flowDefine.FlowDefineId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #2
0
        public ModelInvokeResult <Ewallet_OldManPK> Update(string strOldManId, Ewallet_OldMan ewallet)
        {
            ModelInvokeResult <Ewallet_OldManPK> result = new ModelInvokeResult <Ewallet_OldManPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_OldManId = strOldManId.ToGuid();
                if (_OldManId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                ewallet.OldManId = _OldManId;
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = ewallet.GetUpdateMethodName(), ParameterObject = ewallet.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new Ewallet_OldManPK {
                    OldManId = _OldManId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #3
0
        public ModelInvokeResult <Ewallet_OldMan> Load(string strOldManId)
        {
            ModelInvokeResult <Ewallet_OldMan> result = new ModelInvokeResult <Ewallet_OldMan> {
                Success = true
            };

            try
            {
                Guid?_OldManId = strOldManId.ToGuid();
                if (_OldManId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var ewallet = BuilderFactory.DefaultBulder().Load <Ewallet_OldMan, Ewallet_OldManPK>(new Ewallet_OldManPK {
                    OldManId = _OldManId
                });
                result.instance = ewallet;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #4
0
        public ModelInvokeResult <ApplicationPK> Update(string strApplicationId, Application application)
        {
            ModelInvokeResult <ApplicationPK> result = new ModelInvokeResult <ApplicationPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string _ApplicationId = strApplicationId;
                application.ApplicationId = _ApplicationId;
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = application.GetUpdateMethodName(), ParameterObject = application.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ApplicationPK {
                    ApplicationId = _ApplicationId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #5
0
        public ModelInvokeResult <Ewallet_OldManPK> Create(Ewallet_OldMan ewallet)
        {
            ModelInvokeResult <Ewallet_OldManPK> result = new ModelInvokeResult <Ewallet_OldManPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (ewallet.OldManId == GlobalManager.GuidAsAutoGenerate)
                {
                    ewallet.OldManId = Guid.NewGuid();
                }
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = ewallet.GetCreateMethodName(), ParameterObject = ewallet.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new Ewallet_OldManPK {
                    OldManId = ewallet.OldManId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <ServiceTrackLogPK> Update(string strId, ServiceTrackLog serviceTrackLog)
        {
            ModelInvokeResult <ServiceTrackLogPK> result = new ModelInvokeResult <ServiceTrackLogPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                /***********************begin 自定义代码*******************/
                serviceTrackLog.OperatedBy = NormalSession.UserId.ToGuid();
                serviceTrackLog.OperatedOn = DateTime.Now;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = serviceTrackLog.GetUpdateMethodName(), ParameterObject = serviceTrackLog.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ServiceTrackLogPK {
                    Id = Convert.ToInt32(strId)
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #7
0
        public ModelInvokeResult <ApplicationPK> Create(Application application)
        {
            ModelInvokeResult <ApplicationPK> result = new ModelInvokeResult <ApplicationPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (application.ApplicationId == "自动生成")
                {
                    application.ApplicationId = GlobalManager.getPK(application.GetMappingTableName(), "ApplicationId");
                }
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = application.GetCreateMethodName(), ParameterObject = application.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ApplicationPK {
                    ApplicationId = application.ApplicationId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #8
0
        public ModelInvokeResult <User> Load(string strUserId)
        {
            ModelInvokeResult <User> result = new ModelInvokeResult <User> {
                Success = true
            };

            try
            {
                Guid?_UserId = strUserId.ToGuid();
                if (_UserId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var user = BuilderFactory.DefaultBulder().Load <User, UserPK>(new UserPK {
                    UserId = _UserId
                });
                result.instance = user;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #9
0
        public ModelInvokeResult <User> VerifyPassword(string strUserId, string strPassWord)
        {
            ModelInvokeResult <User> result = new ModelInvokeResult <User> {
                Success = true
            };

            try
            {
                Guid?_UserId = strUserId.ToGuid();
                if (_UserId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }

                string newPassWord = e0571.web.core.Security.MD5Provider.Generate(strPassWord);
                var    user        = BuilderFactory.DefaultBulder().Load <User, UserPK>(new UserPK {
                    UserId = _UserId
                });
                if (user.PasswordHash.Equals(newPassWord))
                {
                    result.instance = user;
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <MerchantServeManMappingOldManPK> Nullify(string strId)
        {
            ModelInvokeResult <MerchantServeManMappingOldManPK> result = new ModelInvokeResult <MerchantServeManMappingOldManPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                MerchantServeManMappingOldMan  merchantServeManMappingOldMan = new MerchantServeManMappingOldMan {
                    Id = int.Parse(strId)
                };
                /***********************begin 自定义代码*******************/
                merchantServeManMappingOldMan.OperatedBy = NormalSession.UserId.ToGuid();
                merchantServeManMappingOldMan.OperatedOn = DateTime.Now;
                merchantServeManMappingOldMan.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = merchantServeManMappingOldMan.GetUpdateMethodName(), ParameterObject = merchantServeManMappingOldMan.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new MerchantServeManMappingOldManPK {
                    Id = int.Parse(strId)
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <ServiceStation> Load(string strStationId)
        {
            ModelInvokeResult <ServiceStation> result = new ModelInvokeResult <ServiceStation> {
                Success = true
            };

            try
            {
                Guid?_StationId = strStationId.ToGuid();
                if (_StationId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var serviceStation = BuilderFactory.DefaultBulder().Load <ServiceStation, ServiceStationPK>(new ServiceStationPK {
                    StationId = _StationId
                });
                result.instance = serviceStation;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <ResidentMigrateLog> Load(string strResidentDynamicMoveId)
        {
            ModelInvokeResult <ResidentMigrateLog> result = new ModelInvokeResult <ResidentMigrateLog> {
                Success = true
            };

            try
            {
                Guid?_ResidentDynamicMoveId = strResidentDynamicMoveId.ToGuid();
                if (_ResidentDynamicMoveId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var residentMigrateLog = BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).Load <ResidentMigrateLog, ResidentMigrateLogPK>(new ResidentMigrateLogPK {
                    ResidentDynamicMoveId = _ResidentDynamicMoveId
                });
                result.instance = residentMigrateLog;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #13
0
        public ModelInvokeResult <CallRecordPK> Create(CallRecord callRecord)
        {
            ModelInvokeResult <CallRecordPK> result = new ModelInvokeResult <CallRecordPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = callRecord.GetCreateMethodName(), ParameterObject = callRecord.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new CallRecordPK {
                    Id = callRecord.Id
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <FlowDefine> Load(string strFlowDefineId)
        {
            ModelInvokeResult <FlowDefine> result = new ModelInvokeResult <FlowDefine> {
                Success = true
            };

            try
            {
                Guid?_FlowDefineId = strFlowDefineId.ToGuid();
                if (_FlowDefineId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var flowDefine = BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).Load <FlowDefine, FlowDefinePK>(new FlowDefinePK {
                    FlowDefineId = _FlowDefineId
                });
                result.instance = flowDefine;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <DictionaryItem> Load(string strDictionaryId, string strItemId)
        {
            ModelInvokeResult <DictionaryItem> result = new ModelInvokeResult <DictionaryItem> {
                Success = true
            };

            try
            {
                string _DictionaryId  = strDictionaryId;
                string _ItemId        = strItemId;
                var    dictionaryItem = BuilderFactory.DefaultBulder().Load <DictionaryItem, DictionaryItemPK>(new DictionaryItemPK {
                    DictionaryId = _DictionaryId, ItemId = _ItemId
                });
                if (dictionaryItem.ParentId == null)
                {
                    dictionaryItem.ParentId = "_";
                }
                result.instance = dictionaryItem;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <DictionaryItemPK> Delete(string strDictionaryId, string strItemId)
        {
            ModelInvokeResult <DictionaryItemPK> result = new ModelInvokeResult <DictionaryItemPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string           _DictionaryId            = strDictionaryId;
                string           _ItemId = strItemId;
                DictionaryItemPK pk      = new DictionaryItemPK {
                    DictionaryId = _DictionaryId, ItemId = _ItemId
                };
                DeleteCascade(statements, pk);
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = new DictionaryItem().GetDeleteMethodName(), ParameterObject = pk, Type = SqlExecuteType.DELETE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = pk;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <InstitutionsCareCenter> Load(string strStationId)
        {
            ModelInvokeResult <InstitutionsCareCenter> result = new ModelInvokeResult <InstitutionsCareCenter> {
                Success = true
            };

            try
            {
                Guid?_StationId = strStationId.ToGuid();
                if (_StationId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var institutionsCareCenter = BuilderFactory.DefaultBulder().Load <InstitutionsCareCenter, InstitutionsCareCenterPK>(new InstitutionsCareCenterPK {
                    StationId = _StationId
                });
                result.instance = institutionsCareCenter;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #18
0
        public ModelInvokeResult <OldManComplainInfoPK> Delete(string strId)
        {
            ModelInvokeResult <OldManComplainInfoPK> result = new ModelInvokeResult <OldManComplainInfoPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                OldManComplainInfoPK           pk         = new OldManComplainInfoPK {
                    Id = Int32.Parse(strId)
                };
                DeleteCascade(statements, pk);
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = new OldManComplainInfo().GetDeleteMethodName(), ParameterObject = pk, Type = SqlExecuteType.DELETE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new OldManComplainInfoPK {
                    Id = Int32.Parse(strId)
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #19
0
        public ModelInvokeResult <OldManComplainInfoPK> Nullify(string strId)
        {
            ModelInvokeResult <OldManComplainInfoPK> result = new ModelInvokeResult <OldManComplainInfoPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements         = new List <IBatisNetBatchStatement>();
                OldManComplainInfo             oldManComplainInfo = new OldManComplainInfo {
                    Id = Int32.Parse(strId), Status = 0
                };
                /***********************begin 自定义代码*******************/
                oldManComplainInfo.OperatedBy = NormalSession.UserId.ToGuid();
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = oldManComplainInfo.GetUpdateMethodName(), ParameterObject = oldManComplainInfo.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new OldManComplainInfoPK {
                    Id = Int32.Parse(strId)
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <DatabaseConnect> Load(string strConnectId)
        {
            ModelInvokeResult <DatabaseConnect> result = new ModelInvokeResult <DatabaseConnect> {
                Success = true
            };

            try
            {
                string _ConnectId      = strConnectId;
                var    databaseConnect = BuilderFactory.DefaultBulder().Load <DatabaseConnect, DatabaseConnectPK>(new DatabaseConnectPK {
                    ConnectId = _ConnectId
                });

                databaseConnect.ServerName            = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Decrypt(databaseConnect.ServerName);
                databaseConnect.DatabaseName          = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Decrypt(databaseConnect.DatabaseName);
                databaseConnect.UserCode              = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Decrypt(databaseConnect.UserCode);
                databaseConnect.UserPassword          = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Decrypt(databaseConnect.UserPassword);
                databaseConnect.IbatisConfigFileValue = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Decrypt(databaseConnect.IbatisConfigFileValue);

                result.instance = databaseConnect;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #21
0
        public ModelInvokeResult <EPay_AssessPackagePK> Nullify(string strId)
        {
            ModelInvokeResult <EPay_AssessPackagePK> result = new ModelInvokeResult <EPay_AssessPackagePK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                EPay_AssessPackage             ePay       = new EPay_AssessPackage {
                    Id = Convert.ToInt32(strId), Status = 0
                };
                /***********************begin 自定义代码*******************/
                ePay.OperatedBy = NormalSession.UserId.ToGuid();
                ePay.OperatedOn = DateTime.Now;
                ePay.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = ePay.GetUpdateMethodName(), ParameterObject = ePay.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new EPay_AssessPackagePK {
                    Id = ePay.Id
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #22
0
        public ModelInvokeResult <SurveyPK> CreateSurvey(Survey surveyObj)
        {
            ModelInvokeResult <SurveyPK> result = new ModelInvokeResult <SurveyPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (surveyObj.SurveyId == GlobalManager.GuidAsAutoGenerate)
                {
                    surveyObj.SurveyId = Guid.NewGuid();
                }
                surveyObj.OperatedBy = NormalSession.UserId.ToGuid();
                surveyObj.OperatedOn = DateTime.Now;

                statements.Add(new IBatisNetBatchStatement {
                    StatementName = surveyObj.GetCreateMethodName(), ParameterObject = surveyObj.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                //BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new SurveyPK {
                    SurveyId = surveyObj.SurveyId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <DatabaseConnectPK> Delete(string strConnectId)
        {
            ModelInvokeResult <DatabaseConnectPK> result = new ModelInvokeResult <DatabaseConnectPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string            _ConnectId = strConnectId;
                DatabaseConnectPK pk         = new DatabaseConnectPK {
                    ConnectId = _ConnectId
                };
                DeleteCascade(statements, pk);
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = new DatabaseConnect().GetDeleteMethodName(), ParameterObject = pk, Type = SqlExecuteType.DELETE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new DatabaseConnectPK {
                    ConnectId = _ConnectId
                };

                //注册数据连接ase
                GlobalManager.RegisterDatabaseConnections();
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <ArticleColumn> Load(string strColumnId)
        {
            ModelInvokeResult <ArticleColumn> result = new ModelInvokeResult <ArticleColumn> {
                Success = true
            };

            try
            {
                Guid?_ColumnId = strColumnId.ToGuid();
                if (_ColumnId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var articleColumn = BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).Load <ArticleColumn, ArticleColumnPK>(new ArticleColumnPK {
                    ColumnId = _ColumnId
                });
                result.instance = articleColumn;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #25
0
        public ModelInvokeResult <Menu> Load(string strMenuId)
        {
            ModelInvokeResult <Menu> result = new ModelInvokeResult <Menu> {
                Success = true
            };

            try
            {
                string _MenuId = strMenuId;
                var    menu    = BuilderFactory.DefaultBulder().Load <Menu, MenuPK>(new MenuPK {
                    MenuId = _MenuId
                });
                if (menu.ParentId == "*    ")
                {
                    menu.ParentId = "_";
                }
                result.instance = menu;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #26
0
        public ModelInvokeResult <Group> Load(string strGroupId)
        {
            ModelInvokeResult <Group> result = new ModelInvokeResult <Group> {
                Success = true
            };

            try
            {
                Guid?_GroupId = strGroupId.ToGuid();
                if (_GroupId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var group = BuilderFactory.DefaultBulder().Load <Group, GroupPK>(new GroupPK {
                    GroupId = _GroupId
                });
                result.instance = group;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #27
0
        public ModelInvokeResult <Room> Load(string strRoomId)
        {
            ModelInvokeResult <Room> result = new ModelInvokeResult <Room> {
                Success = true
            };

            try
            {
                Guid?_RoomId = strRoomId.ToGuid();
                if (_RoomId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                var room = BuilderFactory.DefaultBulder().Load <Room, RoomPK>(new RoomPK {
                    RoomId = _RoomId
                });
                result.instance = room;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #28
0
        public ModelInvokeResult <RoomPK> Update(string strRoomId, Room room)
        {
            ModelInvokeResult <RoomPK> result = new ModelInvokeResult <RoomPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_RoomId = strRoomId.ToGuid();
                if (_RoomId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                int isExist = BuilderFactory.DefaultBulder().ExecuteNativeSqlForCount("select * from Pam_Room where RoomNo='" + room.RoomNo + "' and StationId='" + room.StationId + "' and RoomId<>'" + strRoomId + "'");
                if (isExist <= 0)
                {
                    int isExistExtNo = BuilderFactory.DefaultBulder().ExecuteNativeSqlForCount("select * from Pam_Room where ExtNo='" + room.ExtNo + "' and StationId='" + room.StationId + "' and RoomId<>'" + strRoomId + "' and ExtNo<>'' and ExtNo is not null");
                    if (isExistExtNo <= 0)
                    {
                        room.RoomId = _RoomId;
                        /***********************begin 自定义代码*******************/
                        room.OperatedBy = NormalSession.UserId.ToGuid();
                        room.OperatedOn = DateTime.Now;
                        room.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                        /***********************end 自定义代码*********************/
                        statements.Add(new IBatisNetBatchStatement {
                            StatementName = room.GetUpdateMethodName(), ParameterObject = room.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                        });
                        /***********************begin 自定义代码*******************/
                        /***********************此处添加自定义代码*****************/
                        /***********************end 自定义代码*********************/
                        BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                        result.instance = new RoomPK {
                            RoomId = _RoomId
                        };
                    }
                    else
                    {
                        result.Success      = false;
                        result.ErrorMessage = room.ExtNo + "分机号  已被使用";
                    }
                }
                else
                {
                    result.Success      = false;
                    result.ErrorMessage = room.RoomNo + "房间  已经存在";
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #29
0
        public ModelInvokeResult <ServerPK> Create(Server server)
        {
            ModelInvokeResult <ServerPK> result = new ModelInvokeResult <ServerPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (server.ServerId == "自动生成")
                {
                    server.ServerId = GlobalManager.getPK(server.GetMappingTableName(), "ServerId");
                }
                /***********************begin 自定义代码*******************/
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = server.GetCreateMethodName(), ParameterObject = server.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                bool needDatabaseConnect = server.ServerId.StartsWith("Job");
                if (needDatabaseConnect)
                {
                    /***********************begin 自定义代码*******************/
                    DatabaseConnect databaseConnect = new DatabaseConnect
                    {
                        ConnectId             = "Job-" + server.ServerId,
                        ConnectName           = "作业-" + server.ServerName,
                        Provider              = GlobalManager.DIKey_00015_SqlServer2005,
                        ServerName            = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Encrypt(server.IpAddress),
                        DatabaseName          = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Encrypt(GlobalManager.Job_Host_Database),
                        UserCode              = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Encrypt(GlobalManager.Job_Database_User),
                        UserPassword          = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Encrypt(GlobalManager.Job_Database_Password),
                        IBatisMapId           = "SqlMap-Job-" + server.ServerId,
                        IbatisConfigFileRefer = GlobalManager.IbatisConfigFileRefer,
                        IbatisConfigFileValue = e0571.web.core.Service.ServiceManager.Instance.CryptoService.StringCrypto.Encrypt(GlobalManager.IbatisConfigFileValue_Job)
                    };
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = databaseConnect.GetCreateMethodName(), ParameterObject = databaseConnect.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                    });
                    /***********************end 自定义代码*********************/
                }
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ServerPK {
                    ServerId = server.ServerId
                };
                if (needDatabaseConnect)
                {
                    //注册数据连接ase
                    GlobalManager.RegisterDatabaseConnections();
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #30
0
        public ModelInvokeResult <UserPK> Create(User user)
        {
            ModelInvokeResult <UserPK> result = new ModelInvokeResult <UserPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (user.UserId == GlobalManager.GuidAsAutoGenerate)
                {
                    user.UserId = Guid.NewGuid();
                }
                user.PasswordHash = e0571.web.core.Security.MD5Provider.Generate("123");//
                user.CreatedBy    = NormalSession.UserId.ToGuid();
                user.CreatedOn    = DateTime.Now;
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/

                /***********************begin 自定义代码*******************/
                List <string> groupIds = new List <string>();
                /**新增**/
                groupIds.Add("00000000-0000-0000-0000-000000000999");
                user.isNormalUser(groupIds);
                groupIds.Remove("undefined");
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = user.GetCreateMethodName(), ParameterObject = user.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                user.setRoles(statements, groupIds);
                /**新增**/

                //if (user.isNormalUser(groupIds))
                //{
                //    statements.Add(new IBatisNetBatchStatement { StatementName = user.GetCreateMethodName(), ParameterObject = user.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT });
                //    user.setRoles(statements, groupIds);
                //}
                //else
                //{
                //    statements.Add(new IBatisNetBatchStatement { StatementName = user.GetCreateMethodName(), ParameterObject = user.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT });
                //}

                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                SPParam spParam = new { }.ToSPParam();
                BuilderFactory.DefaultBulder().ExecuteSPNoneQuery("SP_DBA_SyncAuth_LisenceUser", spParam);
                result.instance = new UserPK {
                    UserId = user.UserId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }