示例#1
0
        ///<summary>Takes a list of fees to be deleted and deletes them from rest of the clinics in the feeschedgroup.</summary>
        public static void DeleteGroupFees(List <Fee> listFees)
        {
            //No need to check RemotingRole; no call to db.
            List <long> listFeeNumsToDelete = new List <long>();

            foreach (Fee feeCur in listFees)
            {
                FeeSchedGroup groupCur = GetOneForFeeSchedAndClinic(feeCur.FeeSched, feeCur.ClinicNum);
                if (groupCur == null)
                {
                    continue;
                }
                //Go through the clinics in the group and delete the fee.
                foreach (long clinicNum in groupCur.ListClinicNumsAll)
                {
                    //Skip fees passed into this method, they will be deleted elsewhere by FeeCrud
                    if (clinicNum == feeCur.ClinicNum)
                    {
                        continue;
                    }
                    Fee feeToDelete = Fees.GetFeeFromDb(feeCur.CodeNum, feeCur.FeeSched, clinicNum, feeCur.ProvNum, true);
                    if (feeToDelete != null)
                    {
                        listFeeNumsToDelete.Add(feeToDelete.FeeNum);
                    }
                }
            }
            Fees.DeleteMany(listFeeNumsToDelete, false);
        }
示例#2
0
 ///<summary></summary>
 public static void Update(FeeSchedGroup feeSchedGroup)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), feeSchedGroup);
         return;
     }
     Crud.FeeSchedGroupCrud.Update(feeSchedGroup);
 }
示例#3
0
 ///<summary></summary>
 public static long Insert(FeeSchedGroup feeSchedGroup)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         feeSchedGroup.FeeSchedGroupNum = Meth.GetLong(MethodBase.GetCurrentMethod(), feeSchedGroup);
         return(feeSchedGroup.FeeSchedGroupNum);
     }
     return(Crud.FeeSchedGroupCrud.Insert(feeSchedGroup));
 }
示例#4
0
 ///<summary>Takes a list of fees that have been inserted/updated and copies those changes to the rest of the clinics in the feeschedgroup.</summary>
 public static void UpsertGroupFees(List <Fee> listFees)
 {
     //No need to check RemotingRole; no call to db.
     foreach (Fee feeCur in listFees)
     {
         FeeSchedGroup groupCur = GetOneForFeeSchedAndClinic(feeCur.FeeSched, feeCur.ClinicNum);
         if (groupCur == null)
         {
             continue;
         }
         //Found a group, pass feeCur and list of clinics to upsert method.  Remove clinic for feeCur as that fee has already been modified.
         CopyFeeAmountToGroup(feeCur, groupCur.ListClinicNumsAll.Where(x => x != feeCur.ClinicNum).ToList());
     }
 }