Exemplo n.º 1
0
        public List <LocaleViseModel> Select(LocaleViseQueryModel qmObj)
        {
            List <LocaleViseModel> list;

            try
            {
                list = this._Select(qmObj);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
Exemplo n.º 2
0
        public List <LocaleViseModel> GetLocalVise(int Code)
        {
            List <LocaleViseModel> list = new List <LocaleViseModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    LocaleViseQueryModel viseQueryModel = new LocaleViseQueryModel();
                    viseQueryModel.ViseCode = Code;
                    list = new LocaleViseBLL().Select(viseQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Exemplo n.º 3
0
        public List <LocaleViseModel> GetLocalVises(LocaleViseQueryModel QueryModel)
        {
            List <LocaleViseModel> list = new List <LocaleViseModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new LocaleViseQueryModel();
                    }
                    list = new LocaleViseBLL().Select(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Exemplo n.º 4
0
        public List <LocaleViseModel> GetLocalVises(string SortColumns, int StartRecord, int MaxRecords, string ViseId, string ViseName, string VisePerson, string ViseSupplier, string ViseContractCode, string ViseUnit, DateTime ViseDateStart, DateTime ViseDateEnd, DateTime ViseEndDateStart, DateTime ViseEndDateEnd, string ViseProject, string ViseType, string ViseBalanceStatusInStr, string ViseStatusInStr, int ViseReferCode)
        {
            List <LocaleViseModel> list           = new List <LocaleViseModel>();
            LocaleViseQueryModel   viseQueryModel = new LocaleViseQueryModel();

            viseQueryModel.StartRecord            = StartRecord;
            viseQueryModel.MaxRecords             = MaxRecords;
            viseQueryModel.SortColumns            = SortColumns;
            viseQueryModel.ViseId                 = ViseId;
            viseQueryModel.ViseName               = ViseName;
            viseQueryModel.VisePerson             = VisePerson;
            viseQueryModel.ViseProject            = ViseProject;
            viseQueryModel.ViseStatusInStr        = ViseStatusInStr;
            viseQueryModel.ViseSupplier           = ViseSupplier;
            viseQueryModel.ViseType               = ViseType;
            viseQueryModel.ViseUnit               = ViseUnit;
            viseQueryModel.ViseBalanceStatusInStr = ViseBalanceStatusInStr;
            viseQueryModel.ViseContractCode       = ViseContractCode;
            viseQueryModel.ViseDateEnd            = ViseDateEnd;
            viseQueryModel.ViseDateStart          = ViseDateStart;
            viseQueryModel.ViseEndDateStart       = ViseEndDateStart;
            viseQueryModel.ViseEndDateEnd         = ViseEndDateEnd;
            viseQueryModel.ViseReferCode          = ViseReferCode;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    list = new LocaleViseBLL().Select(viseQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Exemplo n.º 5
0
        public List <LocaleViseModel> Select(LocaleViseQueryModel ViseQueryModel, SqlTransaction Transaction)
        {
            LocaleViseDAL edal = new LocaleViseDAL(Transaction);

            return(edal.Select(ViseQueryModel));
        }
Exemplo n.º 6
0
        public List <LocaleViseModel> Select(LocaleViseQueryModel ViseQueryModel, SqlConnection Connection)
        {
            LocaleViseDAL edal = new LocaleViseDAL(Connection);

            return(edal.Select(ViseQueryModel));
        }
Exemplo n.º 7
0
        private List <LocaleViseModel> _Select(LocaleViseQueryModel qmObj)
        {
            Exception exception;
            List <LocaleViseModel> list2;

            try
            {
                List <LocaleViseModel> list    = new List <LocaleViseModel>();
                StringBuilder          builder = new StringBuilder();
                builder.Append("select * from LocaleVise ");
                builder.Append(qmObj.QueryConditionStr);
                if ((qmObj.SortColumns == null) || (qmObj.SortColumns.Length == 0))
                {
                    builder.Append(" ORDER BY ViseCode 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)))
                            {
                                LocaleViseModel model = new LocaleViseModel();
                                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);
        }