Exemplo n.º 1
0
        public InvokeResult NullifySelected(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 CourseSchedule().GetUpdateMethodName();
                foreach (string strId in arrIds)
                {
                    CourseSchedule courseSchedule = new CourseSchedule {
                        Id = Convert.ToInt32(strId), Status = 0
                    };
                    /***********************begin 自定义代码*******************/
                    courseSchedule.OperatedBy = NormalSession.UserId.ToGuid();
                    courseSchedule.OperatedOn = DateTime.Now;
                    courseSchedule.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                    /***********************end 自定义代码*********************/
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = courseSchedule.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Exemplo n.º 2
0
        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);
        }