Exemple #1
0
        public InvokeResult NullifySelected(string strWorkOrderIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrWorkOrderIds = strWorkOrderIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrWorkOrderIds.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new ServiceWorkOrder().GetUpdateMethodName();
                foreach (string strWorkOrderId in arrWorkOrderIds)
                {
                    ServiceWorkOrder serviceWorkOrder = new ServiceWorkOrder {
                        WorkOrderId = strWorkOrderId.ToGuid(), Status = 0
                    };
                    /***********************begin 自定义代码*******************/
                    serviceWorkOrder.OperatedBy = NormalSession.UserId.ToGuid();
                    serviceWorkOrder.OperatedOn = DateTime.Now;
                    serviceWorkOrder.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                    /***********************end 自定义代码*********************/
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = serviceWorkOrder.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Exemple #2
0
        public ModelInvokeResult <ServiceWorkOrderPK> Nullify(string strWorkOrderId)
        {
            ModelInvokeResult <ServiceWorkOrderPK> result = new ModelInvokeResult <ServiceWorkOrderPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_WorkOrderId = strWorkOrderId.ToGuid();
                if (_WorkOrderId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                ServiceWorkOrder serviceWorkOrder = new ServiceWorkOrder {
                    WorkOrderId = _WorkOrderId, Status = 0
                };
                /***********************begin 自定义代码*******************/
                serviceWorkOrder.OperatedBy = NormalSession.UserId.ToGuid();
                serviceWorkOrder.OperatedOn = DateTime.Now;
                serviceWorkOrder.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = serviceWorkOrder.GetUpdateMethodName(), ParameterObject = serviceWorkOrder.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ServiceWorkOrderPK {
                    WorkOrderId = _WorkOrderId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Exemple #3
0
        public ModelInvokeResult <ServiceWorkOrderPK> Create(ServiceWorkOrder serviceWorkOrder)
        {
            ModelInvokeResult <ServiceWorkOrderPK> result = new ModelInvokeResult <ServiceWorkOrderPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (serviceWorkOrder.WorkOrderId == GlobalManager.GuidAsAutoGenerate)
                {
                    serviceWorkOrder.WorkOrderId = Guid.NewGuid();
                }
                /***********************begin 自定义代码*******************/
                serviceWorkOrder.OperatedBy = NormalSession.UserId.ToGuid();
                serviceWorkOrder.OperatedOn = DateTime.Now;
                serviceWorkOrder.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = serviceWorkOrder.GetCreateMethodName(), ParameterObject = serviceWorkOrder.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ServiceWorkOrderPK {
                    WorkOrderId = serviceWorkOrder.WorkOrderId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }