Beispiel #1
0
 public DesignationModel AddDesignation(DesignationModel model)
 {
     model.CreatedOn = DateTime.Now;
     db.Designation.Add(model);
     db.SaveChanges();
     return(model);
 }
Beispiel #2
0
 public FractionPercentVM AddFractionPercent(FractionPercentModel model)
 {
     model.CreatedOn = DateTime.Now;
     db.FractionPercent.Add(model);
     db.SaveChanges();
     return(GetFractionPercent(model.PercentSettingId));
 }
        public int AddFractionCalculation(FractionCalculationModel[] model)
        {
            Dictionary <double, int> doctorParent = new Dictionary <double, int>();

            foreach (var fraction in model)
            {
                FractionCalculationModel frac = new FractionCalculationModel();
                frac = fraction;
                double ParentId   = fraction.IsParentId;
                bool   is_integer = (ParentId % 1) == 0;

                doctorParent.Add(frac.ParentId, frac.DoctorId);

                if (fraction.IsParentId != 0)
                {
                    frac.IsParentId = doctorParent[Convert.ToInt32(ParentId)];
                }
                db.FractionCalculation.Add(frac);
                db.SaveChanges();
            }
            return(model[0].BillTxnItemId);
        }