예제 #1
0
        public List <V_MaterialInventoryModel> GetV_MaterialInventoryList(V_MaterialInventoryQueryModel QueryModel)
        {
            List <V_MaterialInventoryModel> models;
            SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                if (QueryModel == null)
                {
                    QueryModel = new V_MaterialInventoryQueryModel();
                }
                models = new MaterialInventoryBLL().GetModels(QueryModel, connection);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(models);
        }
예제 #2
0
        public V_MaterialInventoryModel GetV_MaterialInventoryByMaterialProject(string MaterialCode, string ProjectCode)
        {
            V_MaterialInventoryModel      model         = new V_MaterialInventoryModel();
            V_MaterialInventoryQueryModel objQueryModel = new V_MaterialInventoryQueryModel();

            objQueryModel.StartRecord       = 0;
            objQueryModel.MaxRecords        = -1;
            objQueryModel.SortColumns       = "";
            objQueryModel.MaterialCodeEqual = MaterialCode;
            objQueryModel.ProjectCodeEqual  = ProjectCode;
            SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                List <V_MaterialInventoryModel> models = new MaterialInventoryBLL().GetModels(objQueryModel, connection);
                if (models.Count > 0)
                {
                    model = models[0];
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(model);
        }
예제 #3
0
        private List <V_MaterialInventoryModel> _Select(V_MaterialInventoryQueryModel qmObj)
        {
            List <V_MaterialInventoryModel> list2;

            try
            {
                List <V_MaterialInventoryModel> list = new List <V_MaterialInventoryModel>();
                StringBuilder builder = new StringBuilder();
                builder.Append("select * from V_MaterialInventory ");
                builder.Append(qmObj.QueryConditionStr);
                if ((qmObj.SortColumns != null) && (qmObj.SortColumns.Length != 0))
                {
                    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)))
                        {
                            V_MaterialInventoryModel model = new V_MaterialInventoryModel();
                            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);
        }
예제 #4
0
        public List <V_MaterialInventoryModel> GetModels(V_MaterialInventoryQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            List <V_MaterialInventoryModel> list;

            try
            {
                list = new V_MaterialInventoryDAL(Transaction).Select(ObjQueryModel);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
예제 #5
0
        public List <V_MaterialInventoryModel> Select(V_MaterialInventoryQueryModel qmObj)
        {
            List <V_MaterialInventoryModel> list;

            try
            {
                list = this._Select(qmObj);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
예제 #6
0
        public List <V_MaterialInventoryModel> GetV_MaterialInventoryList(string SortColumns, int StartRecord, int MaxRecords, string AccessRange, string ProjectCodeEqual, string ProjectNameEqual, string MaterialCodeEqual, string InQtyRange1, string InQtyRange2, string InMoneyRange1, string InMoneyRange2, string OutQtyRange1, string OutQtyRange2, string InvQtyRange1, string InvQtyRange2, string MaterialNameEqual, string SpecEqual, string UnitEqual, string StandardPriceRange1, string StandardPriceRange2, string GroupCodeEqual, string GroupNameEqual, string GroupFullIDEqual, string GroupSortIDEqual)
        {
            List <V_MaterialInventoryModel> models;
            V_MaterialInventoryQueryModel   objQueryModel = new V_MaterialInventoryQueryModel();

            objQueryModel.StartRecord         = StartRecord;
            objQueryModel.MaxRecords          = MaxRecords;
            objQueryModel.SortColumns         = SortColumns;
            objQueryModel.AccessRange         = AccessRange;
            objQueryModel.ProjectCodeEqual    = ProjectCodeEqual;
            objQueryModel.ProjectNameEqual    = ProjectNameEqual;
            objQueryModel.MaterialCodeEqual   = MaterialCodeEqual;
            objQueryModel.InQtyRange1         = InQtyRange1;
            objQueryModel.InQtyRange2         = InQtyRange2;
            objQueryModel.InMoneyRange1       = InMoneyRange1;
            objQueryModel.InMoneyRange2       = InMoneyRange2;
            objQueryModel.OutQtyRange1        = OutQtyRange1;
            objQueryModel.OutQtyRange2        = OutQtyRange2;
            objQueryModel.InvQtyRange1        = InvQtyRange1;
            objQueryModel.InvQtyRange2        = InvQtyRange2;
            objQueryModel.MaterialNameEqual   = MaterialNameEqual;
            objQueryModel.SpecEqual           = SpecEqual;
            objQueryModel.UnitEqual           = UnitEqual;
            objQueryModel.StandardPriceRange1 = StandardPriceRange1;
            objQueryModel.StandardPriceRange2 = StandardPriceRange2;
            objQueryModel.GroupCodeEqual      = GroupCodeEqual;
            objQueryModel.GroupNameEqual      = GroupNameEqual;
            objQueryModel.GroupFullIDEqual    = GroupFullIDEqual;
            objQueryModel.GroupSortIDEqual    = GroupSortIDEqual;
            SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString());

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