Beispiel #1
0
        public List <DeskTopTypeModel> GetDeskTopTypeList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, int ControldIDEqual, string DeskTypeEqual)
        {
            List <DeskTopTypeModel> models        = new List <DeskTopTypeModel>();
            DeskTopTypeQueryModel   objQueryModel = new DeskTopTypeQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.ControldIDEqual = ControldIDEqual;
            objQueryModel.DeskTypeEqual   = DeskTypeEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new DeskTopTypeBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #2
0
        private List <DeskTopTypeModel> _Select(DeskTopTypeQueryModel qmObj)
        {
            List <DeskTopTypeModel> list    = new List <DeskTopTypeModel>();
            StringBuilder           builder = new StringBuilder();

            builder.Append("select * from DeskTopType ");
            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)))
                        {
                            DeskTopTypeModel model = new DeskTopTypeModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Beispiel #3
0
        public static List <string> GetIDCollectionByDesktopType(DesktopType deskType)
        {
            List <string>         list       = new List <string>();
            DeskTopTypeQueryModel queryModel = new DeskTopTypeQueryModel();

            queryModel.DeskTypeEqual = deskType.ToString("d");
            List <DeskTopTypeModel> deskTopTypeList = new DeskTopTypeBFL().GetDeskTopTypeList(queryModel);

            foreach (DeskTopTypeModel model2 in deskTopTypeList)
            {
                list.Add(model2.ControldID.ToString());
            }
            return(list);
        }
Beispiel #4
0
        public List <DeskTopTypeModel> GetDeskTopTypeList(DeskTopTypeQueryModel QueryModel)
        {
            List <DeskTopTypeModel> models = new List <DeskTopTypeModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new DeskTopTypeQueryModel();
                    }
                    models = new DeskTopTypeBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #5
0
 public List <DeskTopTypeModel> Select(DeskTopTypeQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Beispiel #6
0
        public List <DeskTopTypeModel> Select()
        {
            DeskTopTypeQueryModel qmObj = new DeskTopTypeQueryModel();

            return(this._Select(qmObj));
        }
Beispiel #7
0
        public List <DeskTopTypeModel> GetModels(DeskTopTypeQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            DeskTopTypeDAL edal = new DeskTopTypeDAL(Transaction);

            return(edal.Select(ObjQueryModel));
        }