public InvokeResult NullifySelected(string strMutualAidPersonIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrMutualAidPersonIds = strMutualAidPersonIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrMutualAidPersonIds.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new MutualAidPerson().GetUpdateMethodName(); foreach (string strMutualAidPersonId in arrMutualAidPersonIds) { MutualAidPerson mutualAidPerson = new MutualAidPerson { MutualAidPersonId = strMutualAidPersonId.ToGuid(), Status = 0 }; /***********************begin 自定义代码*******************/ mutualAidPerson.OperatedBy = NormalSession.UserId.ToGuid(); mutualAidPerson.OperatedOn = DateTime.Now; mutualAidPerson.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = mutualAidPerson.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } 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>(); MutualAidPerson mutualAidPerson = new MutualAidPerson() { DataSource = GlobalManager.DIKey_00012_UploadFile, OperatedBy = NormalSession.UserId.ToGuid(), OperatedOn = DateTime.Now, AreaId = AreaId }; foreach (var data in datas) { mutualAidPerson.MutualAidPersonId = Guid.NewGuid(); StringObjectDictionary sod = mutualAidPerson.ToStringObjectDictionary(false); IDictionary <string, object> dataItem = sod.MixInObject(data, false, e0571.web.core.Other.CaseSensitive.NORMAL); statements.Add(new IBatisNetBatchStatement { StatementName = mutualAidPerson.GetCreateMethodName(), ParameterObject = dataItem, Type = SqlExecuteType.INSERT }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失 context.Response.Write("1"); } else { context.Response.Write("0"); } }
public ModelInvokeResult <MutualAidPersonPK> Nullify(string strMutualAidPersonId) { ModelInvokeResult <MutualAidPersonPK> result = new ModelInvokeResult <MutualAidPersonPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); Guid?_MutualAidPersonId = strMutualAidPersonId.ToGuid(); if (_MutualAidPersonId == null) { result.Success = false; result.ErrorCode = 59996; return(result); } MutualAidPerson mutualAidPerson = new MutualAidPerson { MutualAidPersonId = _MutualAidPersonId, Status = 0 }; /***********************begin 自定义代码*******************/ mutualAidPerson.OperatedBy = NormalSession.UserId.ToGuid(); mutualAidPerson.OperatedOn = DateTime.Now; mutualAidPerson.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = mutualAidPerson.GetUpdateMethodName(), ParameterObject = mutualAidPerson.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new MutualAidPersonPK { MutualAidPersonId = _MutualAidPersonId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <MutualAidPersonPK> Create(MutualAidPerson mutualAidPerson) { ModelInvokeResult <MutualAidPersonPK> result = new ModelInvokeResult <MutualAidPersonPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if (mutualAidPerson.MutualAidPersonId == GlobalManager.GuidAsAutoGenerate) { mutualAidPerson.MutualAidPersonId = Guid.NewGuid(); } /***********************begin 自定义代码*******************/ mutualAidPerson.OperatedBy = NormalSession.UserId.ToGuid(); mutualAidPerson.OperatedOn = DateTime.Now; mutualAidPerson.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = mutualAidPerson.GetCreateMethodName(), ParameterObject = mutualAidPerson.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new MutualAidPersonPK { MutualAidPersonId = mutualAidPerson.MutualAidPersonId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }