public List <MaterialOutModel> GetModels(SqlConnection Connection) { List <MaterialOutModel> list; try { list = new MaterialOutDAL(Connection).Select(); } catch (Exception exception) { throw exception; } return(list); }
public MaterialOutModel GetModel(int Code, SqlTransaction Transaction) { MaterialOutModel model; try { model = new MaterialOutDAL(Transaction).GetModel(Code); } catch (Exception exception) { throw exception; } return(model); }
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); }
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); }
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); }