public bool MeasureDelete(MeasuresDTO measure) { try { Measures.Delete(Measures.GetAll().FirstOrDefault(c => c.MeasureId == measure.MeasureId)); return(true); } catch (Exception ex) { return(false); } }
public MeasureEditFm(Utils.Operation operation, MeasuresDTO measure, Action<object> callback) : this(operation) { this.callback = callback; this.measure1 = measure; if (this.callback.Target == null)// null - в режиме изменение { this.measure2 = new MeasuresDTO { MeasureId = measure.MeasureId, Height = measure.Height, Length = measure.Length, UnitWeight = measure.UnitWeight , Width = measure.Width,UnitId = measure.UnitId, PackingTypeId = measure.PackingTypeId, UnitLocalName = measure.UnitLocalName, PackingName = measure.PackingName }; packingTypeEdit.EditValue = measure.PackingTypeId; unitEdit.EditValue = measure.UnitId; ButtonEnabled(); } else { this.measure2 = new MeasuresDTO(); ButtonEnabled(); } this.measuresBS.DataSource = this.measure2; }
public void MeasureUpdate(MeasuresDTO measure) { var eGroup = Measures.GetAll().SingleOrDefault(c => c.MeasureId == measure.MeasureId); Measures.Update((mapper.Map <MeasuresDTO, Measures>(measure, eGroup))); }
public int MeasureCreate(MeasuresDTO measure) { var createrecord = Measures.Create(mapper.Map <Measures>(measure)); return((int)createrecord.MeasureId); }