Пример #1
0
        public List <MaterialOutModel> GetModels(SqlConnection Connection)
        {
            List <MaterialOutModel> list;

            try
            {
                list = new MaterialOutDAL(Connection).Select();
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(list);
        }
Пример #2
0
        public MaterialOutModel GetModel(int Code, SqlTransaction Transaction)
        {
            MaterialOutModel model;

            try
            {
                model = new MaterialOutDAL(Transaction).GetModel(Code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(model);
        }
Пример #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);
        }
Пример #4
0
        public int Update(MaterialOutModel ObjModel, SqlTransaction Transaction)
        {
            int num;

            try
            {
                MaterialOutDAL tdal = new MaterialOutDAL(Transaction);
                ObjModel.InputDate = DateTime.Now;
                num = tdal.Update(ObjModel);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num);
        }
Пример #5
0
        public int Delete(int Code, SqlTransaction Transaction)
        {
            int num;

            try
            {
                MaterialOutDAL           tdal  = new MaterialOutDAL(Transaction);
                MaterialOutDtlDAL        ldal  = new MaterialOutDtlDAL(Transaction);
                MaterialOutDtlQueryModel qmObj = new MaterialOutDtlQueryModel();
                qmObj.MaterialOutCodeEqual = Code.ToString();
                foreach (MaterialOutDtlModel model2 in ldal.Select(qmObj))
                {
                    ldal.Delete(model2.MaterialOutDtlCode);
                }
                num = tdal.Delete(Code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num);
        }