示例#1
0
        public ModelInvokeResult <SubSetPK> Update(string strSubSetId, SubSet subSet)
        {
            ModelInvokeResult <SubSetPK> result = new ModelInvokeResult <SubSetPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string _SubSetId = strSubSetId;
                subSet.SubSetId = _SubSetId;
                /***********************begin 自定义代码*******************/
                subSet.OperatedBy = NormalSession.UserId.ToGuid();
                subSet.OperatedOn = DateTime.Now;
                //subSet.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = subSet.GetUpdateMethodName(), ParameterObject = subSet.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new SubSetPK {
                    SubSetId = _SubSetId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
示例#2
0
        public InvokeResult NullifySelected(string strSubSetIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrSubSetIds = strSubSetIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrSubSetIds.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new SubSet().GetUpdateMethodName();
                foreach (string strSubSetId in arrSubSetIds)
                {
                    SubSet subSet = new SubSet {
                        SubSetId = strSubSetId, Status = 0
                    };
                    /***********************begin 自定义代码*******************/
                    subSet.OperatedBy = NormalSession.UserId.ToGuid();
                    subSet.OperatedOn = DateTime.Now;
                    //subSet.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                    /***********************end 自定义代码*********************/
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = subSet.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }