Esempio n. 1
0
        public int Edit(ClinicEstablishment clesEstablishment)
        {
            int editIndex = 0;

            try
            {
                ClinicEstablishment _cl = GetById(clesEstablishment.EstablishmentId);
                _cl.EstablishmentId       = clesEstablishment.EstablishmentId;
                _cl.ClinicHouseCharge     = clesEstablishment.ClinicHouseCharge;
                _cl.ElectricityBill       = clesEstablishment.ElectricityBill;
                _cl.EmployeeCost          = clesEstablishment.EmployeeCost;
                _cl.InstrumentServiceCost = clesEstablishment.InstrumentServiceCost;
                _cl.RowmaterialCost       = clesEstablishment.RowmaterialCost;
                _cl.Vat  = clesEstablishment.Vat;
                _cl.Date = clesEstablishment.Date;

                _cl.TotalCharge = _cl.ClinicHouseCharge + _cl.ElectricityBill + _cl.EmployeeCost +
                                  _cl.InstrumentServiceCost + _cl.RowmaterialCost + _cl.Vat;

                editIndex = _cliniEstablismentRepository.Edit(_cl);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(editIndex);
        }
        public JsonResult Save(ClinicEstablishmentViewModel model)
        {
            int saveIndex = 0;

            ClinicEstablishment clesEstablishment = new ClinicEstablishment();

            clesEstablishment.EstablishmentId       = model.EstablishmentId;
            clesEstablishment.ClinicHouseCharge     = model.ClinicHouseCharge;
            clesEstablishment.ElectricityBill       = model.ElectricityBill;
            clesEstablishment.EmployeeCost          = model.EmployeeCost;
            clesEstablishment.InstrumentServiceCost = model.InstrumentServiceCost;
            clesEstablishment.RowmaterialCost       = model.RowmaterialCost;
            clesEstablishment.Date = model.Date;
            clesEstablishment.Vat  = model.Vat;

            clesEstablishment.TotalCharge = clesEstablishment.ClinicHouseCharge + clesEstablishment.ElectricityBill +
                                            clesEstablishment.EmployeeCost + clesEstablishment.InstrumentServiceCost +
                                            clesEstablishment.RowmaterialCost + clesEstablishment.Vat;


            saveIndex = model.EstablishmentId == 0 ? ClinicEstablishmentManager.Save(clesEstablishment) : ClinicEstablishmentManager.Edit(clesEstablishment);


            return(Reload(saveIndex));
        }
Esempio n. 3
0
        public int Save(ClinicEstablishment clesEstablishment)
        {
            int saveIndex = 0;

            try
            {
                clesEstablishment.IsActive = true;
                saveIndex = _cliniEstablismentRepository.Save(clesEstablishment);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(saveIndex);
        }
Esempio n. 4
0
        public List <ClinicEstablishment> GetAllAByPaging(out int totalrecords, ClinicEstablishment model)
        {
            List <ClinicEstablishment> clinicEstablishments;

            try
            {
                clinicEstablishments = _cliniEstablismentRepository.GetAllAByPaging(out totalrecords, model);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }

            return(clinicEstablishments);
        }
Esempio n. 5
0
        public int Delete(int id)
        {
            int deletIndex = 0;

            try
            {
                ClinicEstablishment cles = GetById(id);
                cles.IsActive = false;
                deletIndex    = _cliniEstablismentRepository.Edit(cles);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }

            return(deletIndex);
        }
        public ActionResult Edit(ClinicEstablishmentViewModel model)
        {
            if (model.EstablishmentId > 0)
            {
                ClinicEstablishment cles = ClinicEstablishmentManager.GetById(model.EstablishmentId);

                model.EstablishmentId   = cles.EstablishmentId;
                model.ClinicHouseCharge = cles.ClinicHouseCharge;
                model.ElectricityBill   = cles.ElectricityBill;
                model.EmployeeCost      = cles.EmployeeCost;
                model.Vat                   = cles.Vat;
                model.Date                  = cles.Date;
                model.RowmaterialCost       = cles.RowmaterialCost;
                model.InstrumentServiceCost = cles.InstrumentServiceCost;
                model.TotalCharge           = cles.TotalCharge;
            }

            return(View(model));
        }