public int Save(RowMatrial mt) { int saveIndex = 0; try { mt.IsActive = true; saveIndex = _rrowMeterialRepository.Save(mt); } catch (Exception exception) { throw new Exception(exception.Message); } return(saveIndex); }
public List <RowMatrial> GetAllRowMeterial(out int totalrecords, RowMatrial model) { List <RowMatrial> meteriaList; try { meteriaList = _rrowMeterialRepository.GetAllRowMeterial(out totalrecords, model); } catch (Exception exception) { throw new Exception(exception.Message); } return(meteriaList); }
public ActionResult Edit(ClinicRowMeterialViewModel model) { if (model.RowMaterialId > 0) { RowMatrial meterials = RowMeterialManager.GetRowMeterialById(model.RowMaterialId); model.RowMaterialId = meterials.RowMaterialId; model.Name = meterials.Name; model.Cost = meterials.Cost; model.ManufacturingDate = meterials.ManufacturingDate; model.ExpireDate = meterials.ExpireDate; model.Amount = meterials.Amount; } return(View(model)); }
public int Delete(int id) { int deleteIndex = 0; try { RowMatrial mt = GetRowMeterialById(id); mt.IsActive = false; deleteIndex = _rrowMeterialRepository.Edit(mt); } catch (Exception exception) { throw new Exception(exception.Message); } return(deleteIndex); }
public JsonResult Save(ClinicRowMeterialViewModel model) { int saveIndex = 0; RowMatrial mt = new RowMatrial(); mt.RowMaterialId = model.RowMaterialId; mt.Name = model.Name; mt.Cost = model.Cost; mt.ManufacturingDate = model.ManufacturingDate; mt.ExpireDate = model.ExpireDate; mt.Amount = model.Amount; saveIndex = model.RowMaterialId == 0 ? RowMeterialManager.Save(mt) : RowMeterialManager.Edit(mt); return(Reload(saveIndex)); }
public int Edit(RowMatrial mt) { int editIndex = 0; try { RowMatrial _rowMatrial = GetRowMeterialById(mt.RowMaterialId); _rowMatrial.RowMaterialId = mt.RowMaterialId; _rowMatrial.Name = mt.Name; _rowMatrial.Cost = mt.Cost; _rowMatrial.ManufacturingDate = mt.ManufacturingDate; _rowMatrial.ExpireDate = mt.ExpireDate; _rowMatrial.Amount = mt.Amount; editIndex = _rrowMeterialRepository.Edit(_rowMatrial); } catch (Exception exception) { throw new Exception(exception.Message); } return(editIndex); }