Пример #1
0
        private List <GK_OA_EquipmentMaintainApplyModel> _Select(GK_OA_EquipmentMaintainApplyQueryModel qmObj)
        {
            List <GK_OA_EquipmentMaintainApplyModel> list = new List <GK_OA_EquipmentMaintainApplyModel>();
            StringBuilder builder = new StringBuilder();

            builder.Append("select * from GK_OA_EquipmentMaintainApply ");
            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_EquipmentMaintainApplyModel model = new GK_OA_EquipmentMaintainApplyModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
        public List <GK_OA_EquipmentMaintainApplyModel> GetGK_OA_EquipmentMaintainApplyList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string NameEqual, string DeptEqual, string ModelNOEqual, string TypeEqual, string NumberEqual, decimal BudgetMoneyEqual, string UserNameEqual, DateTime ApplyDateEqual, string ReasonEqual, string StateEqual, string QualityNOEqual, string SNRuleEqual, DateTime StartDate, DateTime EndDate)
        {
            List <GK_OA_EquipmentMaintainApplyModel> models        = new List <GK_OA_EquipmentMaintainApplyModel>();
            GK_OA_EquipmentMaintainApplyQueryModel   objQueryModel = new GK_OA_EquipmentMaintainApplyQueryModel();

            objQueryModel.StartRecord      = StartRecord;
            objQueryModel.MaxRecords       = MaxRecords;
            objQueryModel.SortColumns      = SortColumns;
            objQueryModel.CodeEqual        = CodeEqual;
            objQueryModel.NameEqual        = NameEqual;
            objQueryModel.DeptEqual        = DeptEqual;
            objQueryModel.ModelNOEqual     = ModelNOEqual;
            objQueryModel.TypeEqual        = TypeEqual;
            objQueryModel.NumberEqual      = NumberEqual;
            objQueryModel.BudgetMoneyEqual = BudgetMoneyEqual;
            objQueryModel.UserNameEqual    = UserNameEqual;
            objQueryModel.ApplyDateEqual   = ApplyDateEqual;
            objQueryModel.ReasonEqual      = ReasonEqual;
            objQueryModel.StateEqual       = StateEqual;
            objQueryModel.QualityNOEqual   = QualityNOEqual;
            objQueryModel.SNRuleEqual      = SNRuleEqual;
            objQueryModel.StartDateEqual   = StartDate;
            objQueryModel.EndDateEqual     = EndDate;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new GK_OA_EquipmentMaintainApplyBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
        public List <GK_OA_EquipmentMaintainApplyModel> GetGK_OA_EquipmentMaintainApplyList(GK_OA_EquipmentMaintainApplyQueryModel QueryModel)
        {
            List <GK_OA_EquipmentMaintainApplyModel> models = new List <GK_OA_EquipmentMaintainApplyModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OA_EquipmentMaintainApplyQueryModel();
                    }
                    models = new GK_OA_EquipmentMaintainApplyBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
        public List <GK_OA_EquipmentMaintainApplyModel> GetModels(GK_OA_EquipmentMaintainApplyQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            GK_OA_EquipmentMaintainApplyDAL ydal = new GK_OA_EquipmentMaintainApplyDAL(Transaction);

            return(ydal.Select(ObjQueryModel));
        }
Пример #5
0
 public List <GK_OA_EquipmentMaintainApplyModel> Select(GK_OA_EquipmentMaintainApplyQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Пример #6
0
        public List <GK_OA_EquipmentMaintainApplyModel> Select()
        {
            GK_OA_EquipmentMaintainApplyQueryModel qmObj = new GK_OA_EquipmentMaintainApplyQueryModel();

            return(this._Select(qmObj));
        }