Beispiel #1
0
        public List <MaterialOutModel> GetMaterialOutList(MaterialOutQueryModel QueryModel)
        {
            List <MaterialOutModel> models     = new List <MaterialOutModel>();
            SqlConnection           connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                if (QueryModel == null)
                {
                    QueryModel = new MaterialOutQueryModel();
                }
                models = new MaterialOutBLL().GetModels(QueryModel, connection);
                connection.Close();
            }
            catch (SqlException exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(models);
        }
Beispiel #2
0
        private List <MaterialOutModel> _Select(MaterialOutQueryModel qmObj)
        {
            List <MaterialOutModel> list2;

            try
            {
                List <MaterialOutModel> list    = new List <MaterialOutModel>();
                StringBuilder           builder = new StringBuilder();
                builder.Append("select * from V_MaterialOut as MaterialOut ");
                builder.Append(qmObj.QueryConditionStr);
                if ((qmObj.SortColumns == null) || (qmObj.SortColumns.Length == 0))
                {
                    builder.Append(" ORDER BY MaterialOutCode 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
                {
                    sqlDataReader = this._DataProcess.GetSqlDataReader();
                    while (sqlDataReader.Read())
                    {
                        if ((num >= qmObj.StartRecord) && ((list.Count < qmObj.MaxRecords) || (qmObj.MaxRecords == -1)))
                        {
                            MaterialOutModel model = new MaterialOutModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (Exception exception)
                {
                    throw exception;
                }
                finally
                {
                    if (sqlDataReader != null)
                    {
                        sqlDataReader.Close();
                    }
                }
                list2 = list;
            }
            catch (Exception exception2)
            {
                throw exception2;
            }
            return(list2);
        }
Beispiel #3
0
        public List <MaterialOutModel> GetModels(MaterialOutQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            List <MaterialOutModel> list;

            try
            {
                list = new MaterialOutDAL(Transaction).Select(ObjQueryModel);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
Beispiel #4
0
        public List <MaterialOutModel> Select(MaterialOutQueryModel qmObj)
        {
            List <MaterialOutModel> list;

            try
            {
                list = this._Select(qmObj);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
Beispiel #5
0
        public List <MaterialOutModel> GetMaterialOutList(string SortColumns, int StartRecord, int MaxRecords, string AccessRange, string MaterialOutCodeEqual, string MaterialOutIDEqual, string ProjectCodeEqual, string GroupCodeEqual, string OutDateRange1, string OutDateRange2, string OutPersonEqual, string StatusEqual, string InputPersonEqual, string InputDateRange1, string InputDateRange2, string CheckPersonEqual, string CheckDateRange1, string CheckDateRange2, string ContractCodeEqual, string RemarkEqual)
        {
            List <MaterialOutModel> models        = new List <MaterialOutModel>();
            MaterialOutQueryModel   objQueryModel = new MaterialOutQueryModel();

            objQueryModel.StartRecord          = StartRecord;
            objQueryModel.MaxRecords           = MaxRecords;
            objQueryModel.SortColumns          = SortColumns;
            objQueryModel.AccessRange          = AccessRange;
            objQueryModel.MaterialOutCodeEqual = MaterialOutCodeEqual;
            objQueryModel.MaterialOutIDEqual   = MaterialOutIDEqual;
            objQueryModel.ProjectCodeEqual     = ProjectCodeEqual;
            objQueryModel.GroupCodeEqual       = GroupCodeEqual;
            objQueryModel.OutDateRange1        = OutDateRange1;
            objQueryModel.OutDateRange2        = OutDateRange2;
            objQueryModel.OutPersonEqual       = OutPersonEqual;
            objQueryModel.StatusEqual          = StatusEqual;
            objQueryModel.InputPersonEqual     = InputPersonEqual;
            objQueryModel.InputDateRange1      = InputDateRange1;
            objQueryModel.InputDateRange2      = InputDateRange2;
            objQueryModel.CheckPersonEqual     = CheckPersonEqual;
            objQueryModel.CheckDateRange1      = CheckDateRange1;
            objQueryModel.CheckDateRange2      = CheckDateRange2;
            objQueryModel.ContractCodeEqual    = ContractCodeEqual;
            objQueryModel.RemarkEqual          = RemarkEqual;
            SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                models = new MaterialOutBLL().GetModels(objQueryModel, connection);
                connection.Close();
            }
            catch (SqlException exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(models);
        }