public void Update(BatchTypeView batchTypeView) { using (var batchtyperepo = new BatchTypeRepository()) { BatchType batchtype = batchtyperepo.GetById(batchTypeView.BatchTypeid); if (batchtype != null) { batchtype.BatchTypeid = batchTypeView.BatchTypeid; batchtype.BatchTypeDesc = batchTypeView.BatchTypeDesc; batchtyperepo.Update(batchtype); } } }
public BatchTypeView GetBatchTypeById(int id) { using (var batchtyperepo = new BatchTypeRepository()) { BatchType batchtype = batchtyperepo.GetById(id); var batchtypeView = new BatchTypeView(); if (batchtype != null) { batchtypeView.BatchTypeDesc = batchtype.BatchTypeDesc; batchtypeView.BatchTypeid = batchtype.BatchTypeid; } return batchtypeView; } }