Пример #1
0
        public List <GK_OA_ChangeStationNoticeModel> GetGK_OA_ChangeStationNoticeList(string SortColumns, int StartRecord, int MaxRecords, string SystemCodeEqual, string FileCodeEqual, string UnitCodeEqual, string PersonNameEqual, DateTime InComDateEqualStart, DateTime InComDateEqualEnd, string OldStationEqual, string NewStationEqual, string StatusEqual)
        {
            List <GK_OA_ChangeStationNoticeModel> models        = new List <GK_OA_ChangeStationNoticeModel>();
            GK_OA_ChangeStationNoticeQueryModel   objQueryModel = new GK_OA_ChangeStationNoticeQueryModel();

            objQueryModel.StartRecord         = StartRecord;
            objQueryModel.MaxRecords          = MaxRecords;
            objQueryModel.SortColumns         = SortColumns;
            objQueryModel.SystemCodeEqual     = SystemCodeEqual;
            objQueryModel.FileCodeEqual       = FileCodeEqual;
            objQueryModel.PersonNameEqual     = PersonNameEqual;
            objQueryModel.NewUnitCodeEqual    = UnitCodeEqual;
            objQueryModel.InComDateEqualStart = InComDateEqualStart;
            objQueryModel.InComDateEqualEnd   = InComDateEqualEnd;
            objQueryModel.OldStationEqual     = OldStationEqual;
            objQueryModel.NewStationEqual     = NewStationEqual;
            objQueryModel.StatusEqual         = StatusEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new GK_OA_ChangeStationNoticeBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Пример #2
0
        private List <GK_OA_ChangeStationNoticeModel> _Select(GK_OA_ChangeStationNoticeQueryModel qmObj)
        {
            List <GK_OA_ChangeStationNoticeModel> list = new List <GK_OA_ChangeStationNoticeModel>();
            StringBuilder builder = new StringBuilder();

            builder.Append("select * from GK_OA_ChangeStationNotice ");
            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_ChangeStationNoticeModel model = new GK_OA_ChangeStationNoticeModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Пример #3
0
        public List <GK_OA_ChangeStationNoticeModel> GetGK_OA_ChangeStationNoticeList(GK_OA_ChangeStationNoticeQueryModel QueryModel)
        {
            List <GK_OA_ChangeStationNoticeModel> models = new List <GK_OA_ChangeStationNoticeModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OA_ChangeStationNoticeQueryModel();
                    }
                    models = new GK_OA_ChangeStationNoticeBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Пример #4
0
 public List <GK_OA_ChangeStationNoticeModel> Select(GK_OA_ChangeStationNoticeQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Пример #5
0
        public List <GK_OA_ChangeStationNoticeModel> Select()
        {
            GK_OA_ChangeStationNoticeQueryModel qmObj = new GK_OA_ChangeStationNoticeQueryModel();

            return(this._Select(qmObj));
        }
Пример #6
0
        public List <GK_OA_ChangeStationNoticeModel> GetModels(GK_OA_ChangeStationNoticeQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            GK_OA_ChangeStationNoticeDAL edal = new GK_OA_ChangeStationNoticeDAL(Transaction);

            return(edal.Select(ObjQueryModel));
        }