public int DeleteByTrans2(CauseObject_V_MCE_ASSETS_ROLL cause, IDbTransaction transaction)
 {
     if (LocalMode)
     {
         return(HelperObject_V_MCE_ASSETS_ROLL.Delete(cause, transaction));
         //平台自动生成代码
     }
     else
     {
         throw new InvalidConstraintException();
     }
 }
        public DisplayObject_V_MCE_ASSETS_ROLL[] Query(CauseObject_V_MCE_ASSETS_ROLL cause, PagingParamter paging, OrderByParameter order)
        {
            if (LocalMode)
            {
                SystemLogic.Proxy.AuditQuery(cause);

                //平台自动生成代码
                return(HelperObject_V_MCE_ASSETS_ROLL.Query(cause, paging, order));
            }
            else
            {
                using (ServiceManager <ServiceContract_V_MCE_ASSETS_ROLL> smgr = new ServiceManager <ServiceContract_V_MCE_ASSETS_ROLL>(ServiceUri))
                {
                    return(smgr.Service.Query(cause, paging, order));
                }
            }
        }
 public BizLogicMsg Delete(CauseObject_V_MCE_ASSETS_ROLL cause)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     int amount = HelperObject_V_MCE_ASSETS_ROLL.Delete(cause, transaction);
                     //平台自动生成代码
                     transaction.Commit();
                 }
                 catch (Exception expt)
                 {
                     transaction.Rollback();
                     msg = new BizLogicMsg(false, expt.Message);
                     Error(expt);
                 }
                 finally
                 {
                     IDALProvider.IDAL.PushConnection(connection);
                 }
             }
         }
         return(msg);
     }
     else
     {
         using (ServiceManager <ServiceContract_V_MCE_ASSETS_ROLL> smgr = new ServiceManager <ServiceContract_V_MCE_ASSETS_ROLL>(ServiceUri))
         {
             return(smgr.Service.Delete(cause));
         }
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            //允许跨域
            context.Response.AddHeader("Access-Control-Allow-Origin", "*");
            JSON_MSG jsonMsg = new JSON_MSG();

            try
            {
                context.Response.ContentType = "text/plain";
                HttpRequest request = context.Request;


                if (string.IsNullOrEmpty(request["id"]))
                {
                    throw new Exception("参数错误.");
                }


                OrderByParameter orderBy = new OrderByParameter();
                orderBy.Asc     = true;
                orderBy.OrderBy = "CODE";


                StringBuilder strCondition      = new StringBuilder();
                CauseObject_V_MCE_ASSETS_ROLL p = new CauseObject_V_MCE_ASSETS_ROLL();


                p.ASSETS_ID = request["id"];

                if (!string.IsNullOrEmpty(request["condition"]))//
                {
                    strCondition.Append(" and (V_MCE_ASSETS_ROLL.CODE like '%" + request["condition"].ToString().Trim() + "%' )");
                }



                if (!string.IsNullOrEmpty(strCondition.ToString()))
                {
                    p.SetCustomCondition(strCondition.ToString());
                }

                DisplayObject_V_MCE_ASSETS_ROLL[] list = BizLogicObject_V_MCE_ASSETS_ROLL.Proxy.Query(p, null, orderBy);



                jsonMsg.Message = list;
                jsonMsg.Succeed = 1;
            }
            catch (Exception ex)
            {
                jsonMsg.Succeed = 0;
                jsonMsg.Message = ex.Message;
            }
            finally
            {
                IsoDateTimeConverter timeConverter = new IsoDateTimeConverter {
                    DateTimeFormat = "yyyy'-'MM'-'dd HH':'mm"
                };

                string strMsg = JsonConvert.SerializeObject(jsonMsg, Formatting.Indented, timeConverter);
                strMsg = strMsg.Replace("0001-01-01 00:00", "");
                context.Response.Write(strMsg);

                context.Response.End();
            }
        }