Ejemplo n.º 1
0
 public int DeleteByTrans2(CauseObject_V_MCE_QUERY_CONTRACT_PAY cause, IDbTransaction transaction)
 {
     if (LocalMode)
     {
         return(HelperObject_V_MCE_QUERY_CONTRACT_PAY.Delete(cause, transaction));
         //平台自动生成代码
     }
     else
     {
         throw new InvalidConstraintException();
     }
 }
Ejemplo n.º 2
0
        public DisplayObject_V_MCE_QUERY_CONTRACT_PAY[] Query(CauseObject_V_MCE_QUERY_CONTRACT_PAY cause, PagingParamter paging, OrderByParameter order)
        {
            if (LocalMode)
            {
                SystemLogic.Proxy.AuditQuery(cause);

                //平台自动生成代码
                return(HelperObject_V_MCE_QUERY_CONTRACT_PAY.Query(cause, paging, order));
            }
            else
            {
                using (ServiceManager <ServiceContract_V_MCE_QUERY_CONTRACT_PAY> smgr = new ServiceManager <ServiceContract_V_MCE_QUERY_CONTRACT_PAY>(ServiceUri))
                {
                    return(smgr.Service.Query(cause, paging, order));
                }
            }
        }
Ejemplo n.º 3
0
 public BizLogicMsg Delete(CauseObject_V_MCE_QUERY_CONTRACT_PAY cause)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     int amount = HelperObject_V_MCE_QUERY_CONTRACT_PAY.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_QUERY_CONTRACT_PAY> smgr = new ServiceManager <ServiceContract_V_MCE_QUERY_CONTRACT_PAY>(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;

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

                PagingParamter pager = new PagingParamter();
                pager.PageSize  = string.IsNullOrEmpty(request["limit"]) ? 10 : int.Parse(request["limit"].ToString());
                pager.PageIndex = string.IsNullOrEmpty(request["offset"]) ? 0 : (int.Parse(request["offset"].ToString()) <= 0) ? 0 : int.Parse(request["offset"].ToString()) - 1;

                CauseObject_V_MCE_QUERY_CONTRACT_PAY p = new CauseObject_V_MCE_QUERY_CONTRACT_PAY();
                p.H_STATE        = 3;
                p.CONTRACT_STATE = 1;

                if (!string.IsNullOrEmpty(request["status"]))
                {
                    p.STATE = int.Parse(request["status"].ToString());
                }

                if (!string.IsNullOrEmpty(request["contract_status"]))
                {
                    p.CONTRACT_STATE = int.Parse(request["contract_status"].ToString());
                }

                if (!string.IsNullOrEmpty(request["dept"]))
                {
                    p.SECOND_PARTY = request["dept"].ToString();
                }


                if (!string.IsNullOrEmpty(request["code"]))
                {
                    p.CODE = "%" + request["code"].ToString() + "%";
                }

                if (!string.IsNullOrEmpty(request["name"]))
                {
                    p.NAME = "%" + request["name"].ToString() + "%";
                }



                if (!string.IsNullOrEmpty(request["beginspan"]))
                {
                    p.PLAN_PAY_DATE     = new DateSpan();
                    p.PLAN_PAY_DATE.End = DateTime.Parse(request["beginspan"].ToString()).AddDays(1);
                }



                DisplayObject_V_MCE_QUERY_CONTRACT_PAY[] list = BizLogicObject_V_MCE_QUERY_CONTRACT_PAY.Proxy.Query(p, pager, orderBy);



                JSON_PAGER jsonPager = new JSON_PAGER();

                jsonPager.total = pager.TotalRecords;
                jsonPager.rows  = list;

                jsonMsg.Message = jsonPager;
                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();
            }
        }