Ejemplo n.º 1
0
        public List <YF_AssetMainApplyModel> GetYF_AssetMainApplyList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, int ManageCodeEqual, string UserCodeEqual, string DeptEqual, string ApplyDateEqual, string ReasonEqual, string RemarkEqual, string StatusEqual)
        {
            List <YF_AssetMainApplyModel> models        = new List <YF_AssetMainApplyModel>();
            YF_AssetMainApplyQueryModel   objQueryModel = new YF_AssetMainApplyQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.ManageCodeEqual = ManageCodeEqual;
            objQueryModel.UserCodeEqual   = UserCodeEqual;
            objQueryModel.DeptEqual       = DeptEqual;
            objQueryModel.ApplyDateEqual  = ApplyDateEqual;
            objQueryModel.ReasonEqual     = ReasonEqual;
            objQueryModel.RemarkEqual     = RemarkEqual;
            objQueryModel.StatusEqual     = StatusEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new YF_AssetMainApplyBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Ejemplo n.º 2
0
        private List <YF_AssetMainApplyModel> _Select(YF_AssetMainApplyQueryModel qmObj)
        {
            List <YF_AssetMainApplyModel> list = new List <YF_AssetMainApplyModel>();
            StringBuilder builder = new StringBuilder();

            builder.Append("select * from YF_AssetMainApply ");
            builder.Append(qmObj.QueryConditionStr);
            if (qmObj.SortColumns.Length == 0)
            {
                builder.Append(" ORDER BY Code desc");
            }
            else
            {
                builder.Append(" ORDER BY " + qmObj.SortColumns);
            }
            this._DataProcess.CommandText   = builder.ToString();
            this._DataProcess.SqlParameters = qmObj.Parameters;
            SqlDataReader sqlDataReader = null;
            int           num           = 0;

            try
            {
                try
                {
                    sqlDataReader = this._DataProcess.GetSqlDataReader();
                    while (sqlDataReader.Read())
                    {
                        if ((num >= qmObj.StartRecord) && ((list.Count < qmObj.MaxRecords) || (qmObj.MaxRecords == -1)))
                        {
                            YF_AssetMainApplyModel model = new YF_AssetMainApplyModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Ejemplo n.º 3
0
        public List <YF_AssetMainApplyModel> GetYF_AssetMainApplyList(YF_AssetMainApplyQueryModel QueryModel)
        {
            List <YF_AssetMainApplyModel> models = new List <YF_AssetMainApplyModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new YF_AssetMainApplyQueryModel();
                    }
                    models = new YF_AssetMainApplyBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Ejemplo n.º 4
0
 public List <YF_AssetMainApplyModel> Select(YF_AssetMainApplyQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Ejemplo n.º 5
0
        public List <YF_AssetMainApplyModel> Select()
        {
            YF_AssetMainApplyQueryModel qmObj = new YF_AssetMainApplyQueryModel();

            return(this._Select(qmObj));
        }
Ejemplo n.º 6
0
        public List <YF_AssetMainApplyModel> GetModels(YF_AssetMainApplyQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            YF_AssetMainApplyDAL ydal = new YF_AssetMainApplyDAL(Transaction);

            return(ydal.Select(ObjQueryModel));
        }