示例#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);
        }