コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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);
        }