static void Main(string[] args) { var factory = new BuilderFactory(); dynamic helloWorldBuilder = factory.ABuilderFor<HelloWorld>(); HelloWorld helloWorld1 = helloWorldBuilder.WithMessage("Today is {0}") .WithDate(DateTime.Today) .Value; HelloWorld helloWorld2 = helloWorldBuilder.WithMessage("Yesterday was {0}") .WithDate(DateTime.Today.AddDays(-1)) .Value; Console.WriteLine(helloWorld1); Console.WriteLine(helloWorld2); Console.ReadKey(); }
public InvokeResult GenReserveWorkOrder(GenReserveWorkOrderV2Param param) { InvokeResult result = new InvokeResult { Success = true }; try { var spParam = param.ToSPParam(); BuilderFactory.DefaultBulder().ExecuteSPNoneQuery("SP_Oca_GenReserveWorkOrder", spParam); if (spParam.ErrorCode != 0) { result.ErrorCode = spParam.ErrorCode; result.ErrorMessage = spParam.ErrorMessage; } } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
void Application_Start(object sender, EventArgs e) { RegisterRoutes(); IBatisNetManager.Init();//数据初始化 GlobalManager.Init(GlobalManager.SmartLife_Auth_ManageServices); GlobalManager.ReadParams(); Assembly assem = Assembly.GetExecutingAssembly(); StreamReader srForErrorMessage = new StreamReader(assem.GetManifestResourceStream("SmartLife.City.ManageServices.ErrorCode.txt")); string[] lines = srForErrorMessage.ReadToEnd().Split('\n'); srForErrorMessage.Close(); foreach (var line in lines) { if (line.Trim() != "") { var keyValues = line.Split("=".ToCharArray()); if (!GlobalManager.errorCodeMessages.ContainsKey(keyValues[0])) { GlobalManager.errorCodeMessages.Add(keyValues[0], keyValues[1].Replace("\r", "")); } } } //初始化引用访问性 GlobalManager.ApplicationAccessible.AddRange(BuilderFactory.DefaultBulder().List <ApplicationAccessibility>(new ApplicationAccessibility { InterfaceApplicationId = GlobalManager.SmartLife_City_ManageServices }).Select(item => item.AccessApplicationId).ToList()); GlobalManager.DeployNodes.AddRange(BuilderFactory.DefaultBulder().List <DeployNode>(new DeployNode { ApplicationIdTo = GlobalManager.SmartLife_City_ManageServices })); CacheManager.Init(); //注册数据连接ase GlobalManager.RegisterDatabaseConnections(); }
public CollectionInvokeResult <StringObjectDictionary> AdmissionServiceItems(AdmissionServiceItemParam admissionServiceItemParam) { CollectionInvokeResult <StringObjectDictionary> result = new CollectionInvokeResult <StringObjectDictionary>() { Success = true }; try { string sql = ""; if (admissionServiceItemParam.OldManId == null) { sql = string.Format("select a.StationId,'' OldManId ,a.WorkItem,a.WorkSchedule,a.Workload,a.RemindFlag,a.RemindRepeats,a.PlayRepeats,0 CheckFlag,a.Remark CheckDescription,b.ItemName " + " ,0 Preferred from Pam_AssessmentItem a inner join Sys_DictionaryItem b on a.WorkItem=b.ItemId " + " and b.DictionaryId='13001' where a.StationId='{0}' and a.Status=1 order by a.WorkSchedule", admissionServiceItemParam.StationId); } else { sql = string.Format("select a.*,b.ItemName from ( select StationId,'{1}' OldManId," + " WorkItem,WorkSchedule,Workload,RemindFlag,RemindRepeats,PlayRepeats,0 CheckFlag,Remark CheckDescription " + " ,0 Preferred from Pam_AssessmentItem where Status=1 and StationId='{0}' " + " and WorkItem not in(select WorkItem From Pam_AssessmentResult where Status=1 and OldManId='{1}') " + " union all " + " select '{0}' StationId,OldManId, WorkItem,WorkSchedule,Workload,RemindFlag,RemindRepeats,PlayRepeats, " + " CheckFlag,CheckDescription,1 Preferred from Pam_AssessmentResult where Status=1 and OldManId='{1}' " + " ) a inner join Sys_DictionaryItem b on a.WorkItem=b.ItemId and b.DictionaryId='13001' " + " order by a.WorkSchedule", admissionServiceItemParam.StationId, admissionServiceItemParam.OldManId); } result.rows = BuilderFactory.DefaultBulder().ExecuteNativeSqlForQuery(sql); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <DevicePK> Update(string strDeviceId, Device device) { ModelInvokeResult <DevicePK> result = new ModelInvokeResult <DevicePK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_DeviceId = strDeviceId.ToGuid(); if (_DeviceId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } device.DeviceId = _DeviceId; /***********************begin 自定义代码*******************/ /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = device.GetUpdateMethodName(), ParameterObject = device.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new DevicePK { DeviceId = _DeviceId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public CollectionInvokeResult <ServiceListDaily_All_V> QueryTodayService(ServiceListDaily_All_V serviceListDaily_All_V) { CollectionInvokeResult <ServiceListDaily_All_V> result = new CollectionInvokeResult <ServiceListDaily_All_V> { Success = true }; try { StringObjectDictionary filters = new StringObjectDictionary(); filters = serviceListDaily_All_V.ToStringObjectDictionary(false); List <string> whereClause = new List <string>(); if (!string.IsNullOrEmpty(serviceListDaily_All_V.DoStatus)) { string[] doStatus = serviceListDaily_All_V.DoStatus.Split(','); foreach (var item in doStatus) { whereClause.Add(string.Format(" '{0} '", item.ToString())); } } filters.Add("WhereClause", " DATEDIFF(D,CheckInTime,GETDATE())=0 "); if (whereClause.Count > 0) { filters.Remove("DoStatus"); filters["WhereClause"] += " and DoStatus in(" + string.Join(" , ", whereClause.ToArray()) + ")"; } filters.Add("OrderByClause", " CheckInTime desc "); result.rows = BuilderFactory.DefaultBulder().List <ServiceListDaily_All_V>(filters); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <SubSetColumnPK> Nullify(string strSubSetId, string strColumnNameNew) { ModelInvokeResult <SubSetColumnPK> result = new ModelInvokeResult <SubSetColumnPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string _SubSetId = strSubSetId; string _ColumnNameNew = strColumnNameNew; SubSetColumn subSetColumn = new SubSetColumn { SubSetId = _SubSetId, ColumnNameNew = _ColumnNameNew, Status = 0 }; /***********************begin 自定义代码*******************/ subSetColumn.OperatedBy = NormalSession.UserId.ToGuid(); subSetColumn.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = subSetColumn.GetUpdateMethodName(), ParameterObject = subSetColumn.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new SubSetColumnPK { SubSetId = _SubSetId, ColumnNameNew = _ColumnNameNew }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <TableJoinPK> Delete(string strtableJoinId) { ModelInvokeResult <TableJoinPK> result = new ModelInvokeResult <TableJoinPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); int?_strtableJoinId = int.Parse(strtableJoinId); if (_strtableJoinId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } TableJoinPK pk = new TableJoinPK { Id = _strtableJoinId }; //DeleteCascade(statements, pk); statements.Add(new IBatisNetBatchStatement { StatementName = new TableJoin().GetDeleteMethodName(), ParameterObject = pk, Type = SqlExecuteType.DELETE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new TableJoinPK { }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <SurveyPK> UpdateSurvey(string strSurveyId, Survey surveyObj) { ModelInvokeResult <SurveyPK> result = new ModelInvokeResult <SurveyPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_SurveyId = strSurveyId.ToGuid(); if (_SurveyId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } surveyObj.SurveyId = _SurveyId; surveyObj.OperatedBy = NormalSession.UserId.ToGuid(); surveyObj.OperatedOn = DateTime.Now; statements.Add(new IBatisNetBatchStatement { StatementName = surveyObj.GetUpdateMethodName(), ParameterObject = surveyObj.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************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 InvokeResult SaveUserPermissionRoom(string userId, IList <string> roomIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); UserMappingRoom ur = new UserMappingRoom(); ur.UserId = userId.ToGuid(); statements.Add(new IBatisNetBatchStatement { StatementName = ur.GetDeleteMethodName(), ParameterObject = ur.ToStringObjectDictionary(false), Type = SqlExecuteType.DELETE }); ur.OperatedOn = DateTime.Now; ur.OperatedBy = NormalSession.UserId.ToGuid(); foreach (var roomId in roomIds) { if (roomId.ToGuid() != null) { ur.RoomId = roomId.ToGuid(); statements.Add(new IBatisNetBatchStatement { StatementName = ur.GetCreateMethodName(), ParameterObject = ur.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); } } BuilderFactory.DefaultBulder(GlobalManager.getConnectString(GetHttpHeader(GlobalManager.ConnectIdKey))).ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <Ewallet_OldManPK> Nullify(string strOldManId) { 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_OldMan ewallet = new Ewallet_OldMan { OldManId = _OldManId, Status = 0 }; 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); }
public string DeleteSelectedTable(string strParms, int count) { CollectionInvokeResult <Column> strColumnResult = new CollectionInvokeResult <Column> { Success = true }; ModelInvokeResult <TablePK> result = new ModelInvokeResult <TablePK> { Success = true }; string str = null; try { //查询表内数据是否等于1,是则删除操作 strColumnResult = Query(strParms); if (strColumnResult.rows.Count == count) { string strTableId = strColumnResult.rows[0].TableName; List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string _TableName = strTableId; TablePK pk = new TablePK { TableName = _TableName }; statements.Add(new IBatisNetBatchStatement { StatementName = new Table().GetDeleteMethodName(), ParameterObject = pk, Type = SqlExecuteType.DELETE }); BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); str = _TableName; } return(str); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; throw new Exception("删除公共表出错"); } }
public ModelInvokeResult <MerchantServiceReservePK> Create(MerchantServiceReserve merchantServiceReserve) { ModelInvokeResult <MerchantServiceReservePK> result = new ModelInvokeResult <MerchantServiceReservePK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if (merchantServiceReserve.Id == -1) { merchantServiceReserve.Id = null; } /***********************begin 自定义代码*******************/ merchantServiceReserve.OperatedBy = NormalSession.UserId.ToGuid(); merchantServiceReserve.OperatedOn = DateTime.Now; merchantServiceReserve.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = merchantServiceReserve.GetCreateMethodName(), ParameterObject = merchantServiceReserve.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new MerchantServiceReservePK { Id = merchantServiceReserve.Id }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Charset = "utf-8"; HttpPostedFile file = context.Request.Files["Filedata"]; if (file != null) { string AreaId = context.Request.Form["AreaId"]; IList <StringObjectDictionary> datas = NPOIManager.GetSheetData(file.InputStream, 0, true); List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); ServiceStation station = new ServiceStation() { DataSource = GlobalManager.DIKey_00012_UploadFile, OperatedBy = NormalSession.UserId.ToGuid(), OperatedOn = DateTime.Now, AreaId = AreaId }; foreach (var data in datas) { station.StationId = Guid.NewGuid(); station.StationType = context.Request.Form["StationType"]; StringObjectDictionary sod = station.ToStringObjectDictionary(false); IDictionary <string, object> dataItem = sod.MixInObject(data, false, e0571.web.core.Other.CaseSensitive.NORMAL); statements.Add(new IBatisNetBatchStatement { StatementName = station.GetCreateMethodName(), ParameterObject = dataItem, Type = SqlExecuteType.INSERT }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失 context.Response.Write("1"); } else { context.Response.Write("0"); } }
public InvokeResult NullifySelected(string strServerIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrServerIds = strServerIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrServerIds.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new Server().GetUpdateMethodName(); foreach (string strServerId in arrServerIds) { Server server = new Server { ServerId = strServerId, Status = 0 }; /***********************begin 自定义代码*******************/ /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = server.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <GroupPK> Update(string strGroupId, Group group) { ModelInvokeResult <GroupPK> result = new ModelInvokeResult <GroupPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_GroupId = strGroupId.ToGuid(); if (_GroupId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } group.GroupId = _GroupId; group.OperatedBy = NormalSession.UserId.ToGuid(); group.OperatedOn = DateTime.Now; statements.Add(new IBatisNetBatchStatement { StatementName = group.GetUpdateMethodName(), ParameterObject = group.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder(GetHttpHeader(GlobalManager.ConnectIdKey)).ExecuteNativeSqlNoneQuery(statements); result.instance = new GroupPK { GroupId = _GroupId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <AttachmentPK> Update(string strAttachmentId, Attachment attachment) { ModelInvokeResult <AttachmentPK> result = new ModelInvokeResult <AttachmentPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_AttachmentId = strAttachmentId.ToGuid(); if (_AttachmentId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } attachment.AttachmentId = _AttachmentId; /***********************begin 自定义代码*******************/ /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = attachment.GetUpdateMethodName(), ParameterObject = attachment.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements); result.instance = new AttachmentPK { AttachmentId = _AttachmentId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public string PermissionsCategoryView() { User currentUser = new User { UserId = NormalSession.UserId.ToGuid(), UserType = NormalSession.UserType }; string sql = "user"; if (!currentUser.isSuperAdmin()) { IList <UserArea> userAreas = BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).List <UserArea>(new UserArea { UserId = NormalSession.UserId.ToGuid() }); if (userAreas.Count > 0) { var areaIdsOfStreet = string.Join("','", userAreas.Where(item => item.AreaId.ToString().Substring(14, 4) == "0000").Select(item => item.AreaId.ToString())); var areaIdsOfCommunity = string.Join("','", userAreas.Where(item => item.AreaId.ToString().Substring(14, 4) != "0000").Select(item => item.AreaId.ToString())); if (areaIdsOfStreet == "") { sql = string.Format("( AreaId3 in ('{0}') or (ISNULL(AreaId2,'')='' AND ISNULL(AreaId3,'')=''))", areaIdsOfCommunity); } else if (areaIdsOfCommunity == "") { sql = string.Format("(AreaId2 in ('{0}') or (ISNULL(AreaId2,'')='' AND ISNULL(AreaId3,'')=''))", areaIdsOfStreet); } else { sql = string.Format("(AreaId2 in ('{0}') or AreaId3 in ('{1}') or (ISNULL(AreaId2,'')='' AND ISNULL(AreaId3,'')=''))", areaIdsOfStreet, areaIdsOfCommunity); } } } else { sql = "admin"; } return(sql); }
public ModelInvokeResult <ColumnPK> Update(string strTableName, string strColumnName, Column columnObj) { ModelInvokeResult <ColumnPK> result = new ModelInvokeResult <ColumnPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if ((string.IsNullOrEmpty(strTableName) || strTableName == "undefined") || (string.IsNullOrEmpty(strColumnName) || strColumnName == "undefined")) { result.Success = false; result.ErrorCode = 59996; return(result); } columnObj.TableName = strTableName; columnObj.ColumnName = strColumnName; columnObj.OperatedBy = NormalSession.UserId.ToGuid(); columnObj.OperatedOn = DateTime.Now; statements.Add(new IBatisNetBatchStatement { StatementName = columnObj.GetUpdateMethodName(), ParameterObject = columnObj.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new ColumnPK { TableName = strTableName, ColumnName = strColumnName }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public InvokeResult DeleteSelected2(string strTreeIdItemIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrTreeIdItemIds = strTreeIdItemIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrTreeIdItemIds.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new TreeItem().GetDeleteMethodName(); foreach (string strTreeIdItemId in arrTreeIdItemIds) { string[] arrTreeIdItemId = strTreeIdItemId.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); TreeItemPK pk = new TreeItemPK { TreeId = arrTreeIdItemId[0], ItemId = arrTreeIdItemId[1] }; DeleteCascade(statements, pk); statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = pk, Type = SqlExecuteType.DELETE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <GroupPK> Delete(string strGroupId) { ModelInvokeResult <GroupPK> result = new ModelInvokeResult <GroupPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_GroupId = strGroupId.ToGuid(); if (_GroupId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } GroupPK pk = new GroupPK { GroupId = _GroupId }; DeleteCascade(statements, pk); statements.Add(new IBatisNetBatchStatement { StatementName = new Group().GetDeleteMethodName(), ParameterObject = pk, Type = SqlExecuteType.DELETE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder(GetHttpHeader(GlobalManager.ConnectIdKey)).ExecuteNativeSqlNoneQuery(statements); result.instance = pk; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <SubSetColumnPK> CreateEmployee(SubSetColumn subSetColumn) { ModelInvokeResult <SubSetColumnPK> result = new ModelInvokeResult <SubSetColumnPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if (subSetColumn.ColumnNameNew == "自动生成") { subSetColumn.ColumnNameNew = GlobalManager.getPK(subSetColumn.GetMappingTableName(), "ColumnNameNew"); } /***********************begin 自定义代码*******************/ subSetColumn.OperatedBy = NormalSession.UserId.ToGuid(); subSetColumn.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = subSetColumn.GetCreateMethodName(), ParameterObject = subSetColumn.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new SubSetColumnPK { SubSetId = subSetColumn.SubSetId, ColumnNameNew = subSetColumn.ColumnNameNew }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public string isAuthOrBound(RequestXML requestXML) { var AppID = Global.TheServiceAccount.AppId; var openId = requestXML.FromUserName;//获取openid var dictionaryAuth = new { OpenId = openId, Status = 1 }.ToStringObjectDictionary(); //判断用户是否认证 IList <NormalAccount> normalAccounts = BuilderFactory.DefaultBulder().List <NormalAccount>(dictionaryAuth); if (TypeConverter.ChangeString(normalAccounts[0].IDNo) == "" || TypeConverter.ChangeString(normalAccounts[0].Mobile) == "") { return(new ReplyContent().replyContent(requestXML.FromUserName, requestXML.ToUserName, "您还未认证,<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + AppID + "&redirect_uri=http://www.leblue.cn/weixin/views/children-auth.htm&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">点击此处认证</a>")); } //判断用户是否绑定老人 var dictionaryBound = new { OpenId = openId }.ToStringObjectDictionary(); IList <NormalAccountFollow> normalAccountFollows = BuilderFactory.DefaultBulder().List <NormalAccountFollow>(dictionaryBound); if (normalAccountFollows.Count == 0) { return(new ReplyContent().replyContent(requestXML.FromUserName, requestXML.ToUserName, "您还未绑定老人,<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + AppID + "&redirect_uri=http://www.leblue.cn/weixin/views/oldman-bind.htm&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">点击此处绑定老人</a>")); } //绑定老人 回复 老人 图文信息 ReplyNew(string Title, string Description, string PicUrl, string Url) List <ReplyNew> news = new List <ReplyNew>(); news.Add(new ReplyNew("可查询老人服务记录", "", "", "")); foreach (NormalAccountFollow accountFollow in normalAccountFollows) { news.Add(new ReplyNew(accountFollow.FollowToName, "", Util.baseUrl() + "images/test.jpg", Util.baseUrl() + "views/search-home.htm?openid=" + TypeConverter.ChangeString(normalAccounts[0].OpenId) + "&type=OldMan&FollowToIDNo=" + accountFollow.FollowToIDNo)); } Util.WriteTxt(Util.baseUrl() + "views/search-home.htm?openid=" + TypeConverter.ChangeString(normalAccounts[0].OpenId) + "&type=OldMan"); string str = new ReplyNew().replyNews(requestXML.FromUserName, requestXML.ToUserName, (normalAccountFollows.Count + 1).ToString(), news); //string str = new ReplyNew().replyNew(requestXML.FromUserName, requestXML.ToUserName, "这里是一个标题", "这里是摘要", "http://wjweixin.ngrok.com/SmartLife.WeiXin/images/test.jpg", "http://www.4ugood.net"); return(str); }
public InvokeResult CreateAll(IList <BookMeal> bookMeals) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); List <string> arroldManIds = new List <string>(); foreach (BookMeal bookMeal in bookMeals) { /***********************begin 自定义代码*******************/ bookMeal.OperatedBy = NormalSession.UserId.ToGuid(); bookMeal.OperatedOn = DateTime.Now; bookMeal.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = "BookMeal_Create_All", ParameterObject = bookMeal.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); }
public InvokeResult BatchCreateServeItem(string packageId, IList <EPay_PackageItem> packageItems) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); statements.Add(new IBatisNetBatchStatement { StatementName = new EPay_PackageItem().GetDeleteMethodName(), ParameterObject = new { PackageId = packageId.ToGuid() }.ToStringObjectDictionary(false), Type = SqlExecuteType.DELETE }); foreach (var item in packageItems) { item.OperatedBy = NormalSession.UserId.ToGuid(); item.OperatedOn = DateTime.Now; item.DataSource = GlobalManager.DIKey_00012_ManualEdit; item.PackageId = packageId.ToGuid(); item.Id = null; statements.Add(new IBatisNetBatchStatement { StatementName = item.GetCreateMethodName(), ParameterObject = item.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); } if (statements.Count > 0) { BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <HouseBaseInfoPK> Create(HouseBaseInfo houseBaseInfo) { ModelInvokeResult <HouseBaseInfoPK> result = new ModelInvokeResult <HouseBaseInfoPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if (houseBaseInfo.HouseId == GlobalManager.GuidAsAutoGenerate) { houseBaseInfo.HouseId = Guid.NewGuid(); } /***********************begin 自定义代码*******************/ houseBaseInfo.OperatedBy = NormalSession.UserId.ToGuid(); houseBaseInfo.OperatedOn = DateTime.Now; houseBaseInfo.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = houseBaseInfo.GetCreateMethodName(), ParameterObject = houseBaseInfo.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements); result.instance = new HouseBaseInfoPK { HouseId = houseBaseInfo.HouseId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <ServiceCallBackPK> CreateByNoOperator(ServiceCallBack serviceCallBack) { ModelInvokeResult <ServiceCallBackPK> result = new ModelInvokeResult <ServiceCallBackPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if (serviceCallBack.CallBackId == GlobalManager.GuidAsAutoGenerate) { serviceCallBack.CallBackId = Guid.NewGuid(); } /***********************begin 自定义代码*******************/ //serviceCallBack.OperatedBy = NormalSession.UserId.ToGuid(); //serviceCallBack.OperatedOn = DateTime.Now; serviceCallBack.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = serviceCallBack.GetCreateMethodName(), ParameterObject = serviceCallBack.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new ServiceCallBackPK { CallBackId = serviceCallBack.CallBackId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public InvokeResult IgnoreReminder(IgnoreReminderParam param) { InvokeResult result = new InvokeResult { Success = true }; try { object p = param; if (param.SourceKey == null) { p = param.ToStringObjectDictionary(false, e0571.web.core.Other.CaseSensitive.NORMAL); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(new IBatisNetBatchStatement { StatementName = "IgnoreReminderByMerchant", ParameterObject = p, Type = SqlExecuteType.UPDATE }); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public InvokeResult DeleteSelected(string strIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrIds = strIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrIds.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new FlowDefineMapping().GetDeleteMethodName(); foreach (string strId in arrIds) { FlowDefineMappingPK pk = new FlowDefineMappingPK { Id = int.Parse(strId) }; 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); }
public ModelInvokeResult <CourseSchedulePK> Nullify(string strId) { ModelInvokeResult <CourseSchedulePK> result = new ModelInvokeResult <CourseSchedulePK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); int _Id = Convert.ToInt32(strId); CourseSchedule courseSchedule = new CourseSchedule { Id = _Id, Status = 0 }; /***********************begin 自定义代码*******************/ courseSchedule.OperatedBy = NormalSession.UserId.ToGuid(); courseSchedule.OperatedOn = DateTime.Now; courseSchedule.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = courseSchedule.GetUpdateMethodName(), ParameterObject = courseSchedule.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new CourseSchedulePK { Id = _Id }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public bool NullifyWorkPlan(string strOldManId, string strUserId) { bool result = false; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_OldManId = strOldManId.ToGuid(); Guid?_UserId = strUserId.ToGuid(); if (_UserId == null || _OldManId == null) { result = false; return(result); } WorkPlan workPlan = new WorkPlan(); /***********************begin 自定义代码*******************/ workPlan.Status = 0; workPlan.OperatedBy = NormalSession.UserId.ToGuid(); workPlan.OperatedOn = DateTime.Now; workPlan.UserId = _UserId; workPlan.OldManId = _OldManId; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = "NullifyWorkPlan_Update", ParameterObject = workPlan.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result = true; /***********************end 自定义代码*********************/ } catch (Exception ex) { result = false; } return(result); }
static BuilderFactories() { Default = MSBuild.Factory; dic.Add("MSBuild", MSBuild.Factory); }