public ModelInvokeResult <SubSetColumnPK> UpdateEmployee(string strSubSetId, string strColumnNameNew, SubSetColumn subSetColumn) { ModelInvokeResult <SubSetColumnPK> result = new ModelInvokeResult <SubSetColumnPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string _SubSetId = strSubSetId; subSetColumn.SubSetId = _SubSetId; string _ColumnNameNew = subSetColumn.ColumnNameNew;//双主键中的一个可更新时 StringObjectDictionary dictionary = subSetColumn.ToStringObjectDictionary(false); dictionary.Add("Old_ColumnNameNew", strColumnNameNew); subSetColumn.OperatedBy = NormalSession.UserId.ToGuid(); subSetColumn.OperatedOn = DateTime.Now; statements.Add(new IBatisNetBatchStatement { StatementName = "SubSetColumn_Update2", ParameterObject = dictionary, Type = SqlExecuteType.UPDATE }); 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 InvokeResult NullifySelected(string strSubSetId, string strColumnNameNews) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrColumnNameNews = strColumnNameNews.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrColumnNameNews.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new SubSetColumn().GetUpdateMethodName(); string _SubSetId = strSubSetId; foreach (string strColumnNameNew in arrColumnNameNews) { string _ColumnNameNew = strColumnNameNew; SubSetColumn subSetColumn = new SubSetColumn { SubSetId = _SubSetId, ColumnNameNew = _ColumnNameNew, Status = 0 }; /***********************begin 自定义代码*******************/ subSetColumn.OperatedBy = NormalSession.UserId.ToGuid(); subSetColumn.OperatedOn = DateTime.Now; //SubSetColumnPK pk = new SubSetColumnPK { SubSetId = strSubSetId, ColumnNameNew = strColumnNameNews }; //DeleteCascade(statements, pk); statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = subSetColumn.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } 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 ModelInvokeResult <SubSetColumnPK> Create2(string strParam) { ModelInvokeResult <SubSetColumnPK> result = new ModelInvokeResult <SubSetColumnPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); /***********************begin 自定义代码*******************/ SubSetColumn subSetColumn = new SubSetColumn(); if (strParam != "") { string[] param = strParam.Trim().Split(new char[] { ',' }); for (int i = 0; i < param.Length; i++) { subSetColumn = new SubSetColumn(); subSetColumn.OperatedBy = NormalSession.UserId.ToGuid(); subSetColumn.OperatedOn = DateTime.Now; subSetColumn.OrderNo = 0; subSetColumn.ComputeColumnFlag = 0; string[] param1 = param[i].Split(new char[] { '.' }); subSetColumn.TableName = param1[0]; subSetColumn.ColumnName = param1[1]; subSetColumn.ColumnNameNew = param1[2]; subSetColumn.WidgetId = param1[3]; subSetColumn.SubSetId = param1[4]; subSetColumn.ColumnCNameNew = param1[5]; statements.Add(new IBatisNetBatchStatement { StatementName = subSetColumn.GetCreateMethodName(), ParameterObject = subSetColumn.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new SubSetColumnPK { SubSetId = subSetColumn.SubSetId, ColumnNameNew = subSetColumn.ColumnNameNew }; } else { result.Success = false; result.ErrorMessage = "无参数传递"; } } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <SubSetColumn> UpdateColumnNameNew(string Id, SubSetColumn subSetColumn) { ModelInvokeResult <SubSetColumn> result = new ModelInvokeResult <SubSetColumn> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); /***********************begin 自定义代码*******************/ subSetColumn.Id = int.Parse(Id); subSetColumn.OperatedBy = NormalSession.UserId.ToGuid(); subSetColumn.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = "SubSetColumn_UpdateColumnNameNew", ParameterObject = subSetColumn.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new SubSetColumn { Id = int.Parse(Id) }; } 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); }