Ejemplo n.º 1
0
        public int Delete(int Code, SqlTransaction Transaction)
        {
            LocaleViseDAL            edal  = new LocaleViseDAL(Transaction);
            LocaleViseCostDAL        tdal  = new LocaleViseCostDAL(Transaction);
            LocaleViseCostQueryModel qmObj = new LocaleViseCostQueryModel();

            qmObj.ViseCode = Code;
            foreach (LocaleViseCostModel model2 in tdal.Select(qmObj))
            {
                tdal.Delete(model2.ViseCostCode);
            }
            return(edal.Delete(Code));
        }
Ejemplo n.º 2
0
        public decimal GetViseSumMoney(int ViseCode, SqlTransaction Transaction)
        {
            decimal num = 0M;
            LocaleViseCostQueryModel viseCostQueryModel = new LocaleViseCostQueryModel();

            viseCostQueryModel.ViseCode = ViseCode;
            List <LocaleViseCostModel> list = this.SelectCost(viseCostQueryModel, Transaction);

            foreach (LocaleViseCostModel model2 in list)
            {
                num += model2.Money;
            }
            return(num);
        }
Ejemplo n.º 3
0
        private List <LocaleViseCostModel> _Select(LocaleViseCostQueryModel qmObj)
        {
            List <LocaleViseCostModel> list = new List <LocaleViseCostModel>();
            StringBuilder builder           = new StringBuilder();

            builder.Append("select * from LocaleViseCost ");
            builder.Append(qmObj.QueryConditionStr);
            if (qmObj.SortColumns.Length == 0)
            {
                builder.Append(" ORDER BY ViseCostCode 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)))
                        {
                            LocaleViseCostModel model = new LocaleViseCostModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Ejemplo n.º 4
0
        public List <LocaleViseCostModel> GetLocalViseCosts(int Code)
        {
            List <LocaleViseCostModel> list = new List <LocaleViseCostModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    LocaleViseCostQueryModel viseCostQueryModel = new LocaleViseCostQueryModel();
                    viseCostQueryModel.ViseCode = Code;
                    list = new LocaleViseBLL().SelectCost(viseCostQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Ejemplo n.º 5
0
        public List <LocaleViseCostModel> SelectCost(LocaleViseCostQueryModel ViseCostQueryModel, SqlTransaction Transaction)
        {
            LocaleViseCostDAL tdal = new LocaleViseCostDAL(Transaction);

            return(tdal.Select(ViseCostQueryModel));
        }
Ejemplo n.º 6
0
 public List <LocaleViseCostModel> Select(LocaleViseCostQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Ejemplo n.º 7
0
        public List <LocaleViseCostModel> Select()
        {
            LocaleViseCostQueryModel qmObj = new LocaleViseCostQueryModel();

            return(this._Select(qmObj));
        }