Exemplo n.º 1
0
 public static DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] Query(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause)
 {
     //平台自动生成代码
     #region Parameters Block
     OracleParameter[] parameters = null;
     #endregion
     string sSql = " select  V_MCE_ASSET_OUTSTOCK_BACK.ASSETS_CODE, V_MCE_ASSET_OUTSTOCK_BACK.BASE_ID, V_MCE_ASSET_OUTSTOCK_BACK.CARD_CODE, V_MCE_ASSET_OUTSTOCK_BACK.OUT_D_ID, V_MCE_ASSET_OUTSTOCK_BACK.SPEC, V_MCE_ASSET_OUTSTOCK_BACK.ID, V_MCE_ASSET_OUTSTOCK_BACK.ASSETS_NAME from V_MCE_ASSET_OUTSTOCK_BACK where (1=1)";
     sSql += PrepareCause(cause, out parameters);
     if (cause.Recursion != null && !string.IsNullOrEmpty(cause.Recursion.RecursionFieldValue))
     {
         sSql = "select t.* from (" + sSql + ") t,( select t." + cause.Recursion.TargetKeyFieldName + " from " + cause.Recursion.TargetDataObjectName + " t start with t." + cause.Recursion.TargetKeyFieldName + " = '" + cause.Recursion.RecursionFieldValue + "' connect by  t." + cause.Recursion.TargetLevelFieldName + "  = PRIOR t." + cause.Recursion.TargetKeyFieldName + "  ) t1 where t." + cause.Recursion.RecursionFieldName + " = t1." + cause.Recursion.TargetKeyFieldName;
     }
     #region Push Block
     DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK dataObj = null;
     ArrayList     objArray   = new ArrayList();
     IDbConnection connection = IDALProvider.IDAL.PopConnection();
     IDataReader   sqlReader  = IDALProvider.IDAL.ExecuteReader(sSql, parameters, connection);
     while (sqlReader.Read())
     {
         dataObj = new DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK();
         if (!sqlReader.IsDBNull(0))
         {
             dataObj.ASSETS_CODE = sqlReader.GetString(0);
         }
         if (!sqlReader.IsDBNull(1))
         {
             dataObj.BASE_ID = sqlReader.GetString(1);
         }
         if (!sqlReader.IsDBNull(2))
         {
             dataObj.CARD_CODE = sqlReader.GetString(2);
         }
         if (!sqlReader.IsDBNull(3))
         {
             dataObj.OUT_D_ID = sqlReader.GetString(3);
         }
         if (!sqlReader.IsDBNull(4))
         {
             dataObj.SPEC = sqlReader.GetString(4);
         }
         if (!sqlReader.IsDBNull(5))
         {
             dataObj.ID = sqlReader.GetString(5);
         }
         if (!sqlReader.IsDBNull(6))
         {
             dataObj.ASSETS_NAME = sqlReader.GetString(6);
         }
         objArray.Add(dataObj);
     }
     sqlReader.Close();
     IDALProvider.IDAL.PushConnection(connection);
     #endregion
     DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] objs = new DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[objArray.Count];
     objArray.CopyTo(0, objs, 0, objs.Length);
     return(objs);
 }
Exemplo n.º 2
0
 public static int Delete(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, IDbTransaction trans)
 {
     //平台自动生成代码
     #region Parameters Block
     OracleParameter[] parameters = null;
     #endregion
     string sSql = "delete from V_MCE_ASSET_OUTSTOCK_BACK where (1=1)";
     sSql += PrepareCause(cause, out parameters);
     return(IDALProvider.IDAL.ExecuteNonQuery(sSql, parameters, trans));
 }
        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;

                string strIDS = "";
                if (!string.IsNullOrEmpty(request["ids"]))
                {
                    strIDS = request["ids"].ToString();
                }

                if (string.IsNullOrEmpty(strIDS))
                {
                    throw new Exception("参数错误.");
                }

                string[]         arrID   = strIDS.Split(',');
                OrderByParameter orderBy = new OrderByParameter();
                orderBy.Asc     = true;
                orderBy.OrderBy = "assets_code";
                CauseObject_V_MCE_ASSET_OUTSTOCK_BACK p = new CauseObject_V_MCE_ASSET_OUTSTOCK_BACK();
                foreach (string strID in arrID)
                {
                    p.SetINValue("BASE_ID", strID);
                }

                DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] list = BizLogicObject_V_MCE_ASSET_OUTSTOCK_BACK.Proxy.Query(p);

                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();
            }
        }
 public int DeleteByTrans2(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, IDbTransaction transaction)
 {
     if (LocalMode)
     {
         return(HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Delete(cause, transaction));
         //平台自动生成代码
     }
     else
     {
         throw new InvalidConstraintException();
     }
 }
Exemplo n.º 5
0
 public static int Update(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj, CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, IDbTransaction trans)
 {
     //平台自动生成代码
     #region Parameters Block
     List <OracleParameter> list       = new List <OracleParameter>();
     OracleParameter[]      parameters = null;
     #endregion
     string sSql = "update V_MCE_ASSET_OUTSTOCK_BACK set ";
     sSql += PrepareUpdate(obj, out parameters, false);
     list.AddRange(parameters);
     sSql += " where 1=1 ";
     sSql += PrepareCause(cause, out parameters);
     list.AddRange(parameters);
     parameters = list.ToArray();
     return(IDALProvider.IDAL.ExecuteNonQuery(sSql, parameters, trans));
 }
        public DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] Query(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, PagingParamter paging, OrderByParameter order)
        {
            if (LocalMode)
            {
                SystemLogic.Proxy.AuditQuery(cause);

                //平台自动生成代码
                return(HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Query(cause, paging, order));
            }
            else
            {
                using (ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
                {
                    return(smgr.Service.Query(cause, paging, order));
                }
            }
        }
 public BizLogicMsg Delete(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     int amount = HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.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_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
         {
             return(smgr.Service.Delete(cause));
         }
     }
 }
Exemplo n.º 8
0
 public static DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] Query(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, PagingParamter paging, OrderByParameter order, IDbTransaction trans)
 {
     //平台自动生成代码
     #region Parameters Block
     OracleParameter[] parameters = null;
     IDataReader       sqlReader  = null;
     #endregion
     string sSql      = " select  V_MCE_ASSET_OUTSTOCK_BACK.ASSETS_CODE, V_MCE_ASSET_OUTSTOCK_BACK.BASE_ID, V_MCE_ASSET_OUTSTOCK_BACK.CARD_CODE, V_MCE_ASSET_OUTSTOCK_BACK.OUT_D_ID, V_MCE_ASSET_OUTSTOCK_BACK.SPEC, V_MCE_ASSET_OUTSTOCK_BACK.ID, V_MCE_ASSET_OUTSTOCK_BACK.ASSETS_NAME from V_MCE_ASSET_OUTSTOCK_BACK where (1=1)";
     string sCauseSql = PrepareCause(cause, out parameters);
     sSql += sCauseSql;
     if (cause.Recursion != null && !string.IsNullOrEmpty(cause.Recursion.RecursionFieldValue))
     {
         sSql = "select t.* from (" + sSql + ") t,( select t." + cause.Recursion.TargetKeyFieldName + " from " + cause.Recursion.TargetDataObjectName + " t start with t." + cause.Recursion.TargetKeyFieldName + " = '" + cause.Recursion.RecursionFieldValue + "' connect by  t." + cause.Recursion.TargetLevelFieldName + "  = PRIOR t." + cause.Recursion.TargetKeyFieldName + "  ) t1 where t." + cause.Recursion.RecursionFieldName + " = t1." + cause.Recursion.TargetKeyFieldName;
     }
     #region Push Block
     if (paging != null)
     {
         string countSql = string.Empty;
         if (cause.Recursion != null && !string.IsNullOrEmpty(cause.Recursion.RecursionFieldValue))
         {
             countSql = "Select Count(*) From (" + sSql + ") t";
         }
         else
         {
             countSql = "Select Count(*) From (" + sSql + ") t";
         }
         if (paging.TotalRecords == 0)
         {
             paging.TotalRecords = IDALProvider.IDAL.DatabaseType == Ipedf.Common.DatabaseType.SqlServer || IDALProvider.IDAL.DatabaseType == Ipedf.Common.DatabaseType.Db2? (int)IDALProvider.IDAL.ExecuteScalar(countSql, parameters, trans) : (int)(decimal)IDALProvider.IDAL.ExecuteScalar(countSql, parameters, trans);
         }
         sqlReader = IDALProvider.IDAL.ExecutePagingReader("V_MCE_ASSET_OUTSTOCK_BACK", paging, order, sSql, parameters, trans);
     }
     else if (order != null)
     {
         sSql     += order.ToString();
         sqlReader = IDALProvider.IDAL.ExecuteReader(sSql, parameters, trans);
     }
     else
     {
         sqlReader = IDALProvider.IDAL.ExecuteReader(sSql, parameters, trans);
     }
     DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK dataObj = null;
     ArrayList objArray = new ArrayList();
     while (sqlReader.Read())
     {
         dataObj = new DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK();
         if (!sqlReader.IsDBNull(0))
         {
             dataObj.ASSETS_CODE = sqlReader.GetString(0);
         }
         if (!sqlReader.IsDBNull(1))
         {
             dataObj.BASE_ID = sqlReader.GetString(1);
         }
         if (!sqlReader.IsDBNull(2))
         {
             dataObj.CARD_CODE = sqlReader.GetString(2);
         }
         if (!sqlReader.IsDBNull(3))
         {
             dataObj.OUT_D_ID = sqlReader.GetString(3);
         }
         if (!sqlReader.IsDBNull(4))
         {
             dataObj.SPEC = sqlReader.GetString(4);
         }
         if (!sqlReader.IsDBNull(5))
         {
             dataObj.ID = sqlReader.GetString(5);
         }
         if (!sqlReader.IsDBNull(6))
         {
             dataObj.ASSETS_NAME = sqlReader.GetString(6);
         }
         objArray.Add(dataObj);
     }
     sqlReader.Close();
     #endregion
     DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] objs = new DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[objArray.Count];
     objArray.CopyTo(0, objs, 0, objs.Length);
     return(objs);
 }
Exemplo n.º 9
0
        public static string PrepareCause(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, out OracleParameter[] parameters)
        {
            //平台自动生成代码
            System.Text.StringBuilder strBuf = new System.Text.StringBuilder();
            ArrayList       paramList        = new ArrayList();
            OracleParameter param            = null;

            #region Push Block
            if (!string.IsNullOrEmpty(cause.ASSETS_CODE))
            {
                strBuf.Append(" And V_MCE_ASSET_OUTSTOCK_BACK.ASSETS_CODE ").Append((cause.ASSETS_CODE.StartsWith("%") || cause.ASSETS_CODE.EndsWith("%")) ? " like " : " = ").Append(" :C_ASSETS_CODE");
                param = new OracleParameter();
                param.ParameterName = ":C_ASSETS_CODE";
                param.OracleType    = System.Data.OracleClient.OracleType.VarChar;
                param.Size          = 50;
                param.Value         = cause.ASSETS_CODE;
                paramList.Add(param);
            }
            if (cause.HasINValue("ASSETS_CODE"))
            {
                strBuf.Append(cause.GetINSQL("V_MCE_ASSET_OUTSTOCK_BACK", "ASSETS_CODE"));
            }
            if (!string.IsNullOrEmpty(cause.BASE_ID))
            {
                strBuf.Append(" And V_MCE_ASSET_OUTSTOCK_BACK.BASE_ID ").Append((cause.BASE_ID.StartsWith("%") || cause.BASE_ID.EndsWith("%")) ? " like " : " = ").Append(" :C_BASE_ID");
                param = new OracleParameter();
                param.ParameterName = ":C_BASE_ID";
                param.OracleType    = System.Data.OracleClient.OracleType.Char;
                param.Size          = 36;
                param.Value         = cause.BASE_ID;
                paramList.Add(param);
            }
            if (cause.HasINValue("BASE_ID"))
            {
                strBuf.Append(cause.GetINSQL("V_MCE_ASSET_OUTSTOCK_BACK", "BASE_ID"));
            }
            if (!string.IsNullOrEmpty(cause.CARD_CODE))
            {
                strBuf.Append(" And V_MCE_ASSET_OUTSTOCK_BACK.CARD_CODE ").Append((cause.CARD_CODE.StartsWith("%") || cause.CARD_CODE.EndsWith("%")) ? " like " : " = ").Append(" :C_CARD_CODE");
                param = new OracleParameter();
                param.ParameterName = ":C_CARD_CODE";
                param.OracleType    = System.Data.OracleClient.OracleType.VarChar;
                param.Size          = 50;
                param.Value         = cause.CARD_CODE;
                paramList.Add(param);
            }
            if (cause.HasINValue("CARD_CODE"))
            {
                strBuf.Append(cause.GetINSQL("V_MCE_ASSET_OUTSTOCK_BACK", "CARD_CODE"));
            }
            if (!string.IsNullOrEmpty(cause.OUT_D_ID))
            {
                strBuf.Append(" And V_MCE_ASSET_OUTSTOCK_BACK.OUT_D_ID ").Append((cause.OUT_D_ID.StartsWith("%") || cause.OUT_D_ID.EndsWith("%")) ? " like " : " = ").Append(" :C_OUT_D_ID");
                param = new OracleParameter();
                param.ParameterName = ":C_OUT_D_ID";
                param.OracleType    = System.Data.OracleClient.OracleType.Char;
                param.Size          = 36;
                param.Value         = cause.OUT_D_ID;
                paramList.Add(param);
            }
            if (cause.HasINValue("OUT_D_ID"))
            {
                strBuf.Append(cause.GetINSQL("V_MCE_ASSET_OUTSTOCK_BACK", "OUT_D_ID"));
            }
            if (!string.IsNullOrEmpty(cause.SPEC))
            {
                strBuf.Append(" And V_MCE_ASSET_OUTSTOCK_BACK.SPEC ").Append((cause.SPEC.StartsWith("%") || cause.SPEC.EndsWith("%")) ? " like " : " = ").Append(" :C_SPEC");
                param = new OracleParameter();
                param.ParameterName = ":C_SPEC";
                param.OracleType    = System.Data.OracleClient.OracleType.VarChar;
                param.Size          = 50;
                param.Value         = cause.SPEC;
                paramList.Add(param);
            }
            if (cause.HasINValue("SPEC"))
            {
                strBuf.Append(cause.GetINSQL("V_MCE_ASSET_OUTSTOCK_BACK", "SPEC"));
            }
            if (!string.IsNullOrEmpty(cause.ID))
            {
                strBuf.Append(" And V_MCE_ASSET_OUTSTOCK_BACK.ID ").Append((cause.ID.StartsWith("%") || cause.ID.EndsWith("%")) ? " like " : " = ").Append(" :C_ID");
                param = new OracleParameter();
                param.ParameterName = ":C_ID";
                param.OracleType    = System.Data.OracleClient.OracleType.Char;
                param.Size          = 36;
                param.Value         = cause.ID;
                paramList.Add(param);
            }
            if (cause.HasINValue("ID"))
            {
                strBuf.Append(cause.GetINSQL("V_MCE_ASSET_OUTSTOCK_BACK", "ID"));
            }
            if (!string.IsNullOrEmpty(cause.ASSETS_NAME))
            {
                strBuf.Append(" And V_MCE_ASSET_OUTSTOCK_BACK.ASSETS_NAME ").Append((cause.ASSETS_NAME.StartsWith("%") || cause.ASSETS_NAME.EndsWith("%")) ? " like " : " = ").Append(" :C_ASSETS_NAME");
                param = new OracleParameter();
                param.ParameterName = ":C_ASSETS_NAME";
                param.OracleType    = System.Data.OracleClient.OracleType.VarChar;
                param.Size          = 50;
                param.Value         = cause.ASSETS_NAME;
                paramList.Add(param);
            }
            if (cause.HasINValue("ASSETS_NAME"))
            {
                strBuf.Append(cause.GetINSQL("V_MCE_ASSET_OUTSTOCK_BACK", "ASSETS_NAME"));
            }
            if (!string.IsNullOrEmpty(cause.GetCustomCondition()))
            {
                strBuf.Append(cause.GetCustomCondition());
            }
            #endregion
            parameters = new OracleParameter[paramList.Count];
            paramList.CopyTo(parameters);
            return(strBuf.ToString());
        }