Esempio n. 1
0
        public List <GK_OA_ChangeStationModel> GetGK_OA_ChangeStationList(string SortColumns, int StartRecord, int MaxRecords, string SystemCodeEqual, string FileCodeEqual, string UnitCodeEqual, DateTime InComDateEqualStart, DateTime InComDateEqualEnd, string StatusEqual)
        {
            List <GK_OA_ChangeStationModel> models        = new List <GK_OA_ChangeStationModel>();
            GK_OA_ChangeStationQueryModel   objQueryModel = new GK_OA_ChangeStationQueryModel();

            objQueryModel.StartRecord         = StartRecord;
            objQueryModel.MaxRecords          = MaxRecords;
            objQueryModel.SortColumns         = SortColumns;
            objQueryModel.SystemCodeEqual     = SystemCodeEqual;
            objQueryModel.FileCodeEqual       = FileCodeEqual;
            objQueryModel.UnitCodeEqual       = UnitCodeEqual;
            objQueryModel.InComDateEqualStart = InComDateEqualStart;
            objQueryModel.InComDateEqualEnd   = InComDateEqualEnd;
            objQueryModel.StatusEqual         = StatusEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new GK_OA_ChangeStationBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Esempio n. 2
0
        private List <GK_OA_ChangeStationModel> _Select(GK_OA_ChangeStationQueryModel qmObj)
        {
            List <GK_OA_ChangeStationModel> list = new List <GK_OA_ChangeStationModel>();
            StringBuilder builder = new StringBuilder();

            builder.Append("select * from GK_OA_ChangeStation ");
            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)))
                        {
                            GK_OA_ChangeStationModel model = new GK_OA_ChangeStationModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Esempio n. 3
0
        public List <GK_OA_ChangeStationModel> GetGK_OA_ChangeStationList(GK_OA_ChangeStationQueryModel QueryModel)
        {
            List <GK_OA_ChangeStationModel> models = new List <GK_OA_ChangeStationModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OA_ChangeStationQueryModel();
                    }
                    models = new GK_OA_ChangeStationBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Esempio n. 4
0
        public List <GK_OA_ChangeStationModel> GetModels(GK_OA_ChangeStationQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            GK_OA_ChangeStationDAL ndal = new GK_OA_ChangeStationDAL(Transaction);

            return(ndal.Select(ObjQueryModel));
        }
Esempio n. 5
0
 public List <GK_OA_ChangeStationModel> Select(GK_OA_ChangeStationQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Esempio n. 6
0
        public List <GK_OA_ChangeStationModel> Select()
        {
            GK_OA_ChangeStationQueryModel qmObj = new GK_OA_ChangeStationQueryModel();

            return(this._Select(qmObj));
        }