Beispiel #1
0
        public List <ProjectCostModel> Select(ProjectCostQueryModel qmObj)
        {
            List <ProjectCostModel> list;

            try
            {
                list = this._Select(qmObj);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
Beispiel #2
0
        public List <ProjectCostModel> GetModels(ProjectCostQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            List <ProjectCostModel> list;

            try
            {
                list = new ProjectCostDAL(Transaction).Select(ObjQueryModel);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
Beispiel #3
0
        public List <ProjectCostModel> GetProjectCostList(ProjectCostQueryModel QueryModel)
        {
            List <ProjectCostModel> models;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new ProjectCostQueryModel();
                    }
                    models = new ProjectCostBLL().GetModels(QueryModel, connection);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #4
0
        public List <ProjectCostModel> GetProjectCostList(string SortColumns, int StartRecord, int MaxRecords, string AccessRange, string ProjectCostCodeEqual, string ProjectNameEqual, string GroupCodeEqual, string AreaRange1, string AreaRange2, string PriceRange1, string PriceRange2, string MoneyRange1, string MoneyRange2, string QtyRange1, string QtyRange2, string UnitEqual, string InputPersonEqual, string InputDateRange1, string InputDateRange2, string RemarkEqual)
        {
            List <ProjectCostModel> models;
            ProjectCostQueryModel   objQueryModel = new ProjectCostQueryModel();

            objQueryModel.StartRecord          = StartRecord;
            objQueryModel.MaxRecords           = MaxRecords;
            objQueryModel.SortColumns          = SortColumns;
            objQueryModel.AccessRange          = AccessRange;
            objQueryModel.ProjectCostCodeEqual = ProjectCostCodeEqual;
            objQueryModel.ProjectNameEqual     = ProjectNameEqual;
            objQueryModel.GroupCodeEqual       = GroupCodeEqual;
            objQueryModel.AreaRange1           = AreaRange1;
            objQueryModel.AreaRange2           = AreaRange2;
            objQueryModel.PriceRange1          = PriceRange1;
            objQueryModel.PriceRange2          = PriceRange2;
            objQueryModel.MoneyRange1          = MoneyRange1;
            objQueryModel.MoneyRange2          = MoneyRange2;
            objQueryModel.QtyRange1            = QtyRange1;
            objQueryModel.QtyRange2            = QtyRange2;
            objQueryModel.UnitEqual            = UnitEqual;
            objQueryModel.InputPersonEqual     = InputPersonEqual;
            objQueryModel.InputDateRange1      = InputDateRange1;
            objQueryModel.InputDateRange2      = InputDateRange2;
            objQueryModel.RemarkEqual          = RemarkEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new ProjectCostBLL().GetModels(objQueryModel, connection);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #5
0
        private List <ProjectCostModel> _Select(ProjectCostQueryModel qmObj)
        {
            Exception exception;
            List <ProjectCostModel> list2;

            try
            {
                List <ProjectCostModel> list    = new List <ProjectCostModel>();
                StringBuilder           builder = new StringBuilder();
                builder.Append("select * from ProjectCost ");
                builder.Append(qmObj.QueryConditionStr);
                if ((qmObj.SortColumns == null) || (qmObj.SortColumns.Length == 0))
                {
                    builder.Append(" ORDER BY ProjectCostCode 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)))
                            {
                                ProjectCostModel model = new ProjectCostModel();
                                this.Initialize(sqlDataReader, model);
                                list.Add(model);
                            }
                            num++;
                        }
                    }
                    catch (Exception exception1)
                    {
                        exception = exception1;
                        throw exception;
                    }
                }
                finally
                {
                    if (sqlDataReader != null)
                    {
                        sqlDataReader.Close();
                    }
                }
                list2 = list;
            }
            catch (Exception exception2)
            {
                exception = exception2;
                throw exception;
            }
            return(list2);
        }