Ejemplo n.º 1
0
        ///<summary>If none assigned, it will return None.</summary>
        public static EbenefitCategory GetEbenCat(long covCatNum)
        {
            //No need to check RemotingRole; no call to db.
            CovCat covCat = CovCats.GetFirstOrDefault(x => x.CovCatNum == covCatNum, true);

            return(covCat == null ? EbenefitCategory.None : covCat.EbenefitCat);
        }
Ejemplo n.º 2
0
        ///<summary></summary>
        public static void FillLists(DataSet ds)
        {
            DataTable table = ds.Tables[0];

            Listt = new CovCat[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                Listt[i]                = new CovCat();
                Listt[i].CovCatNum      = PIn.PInt(table.Rows[i][0].ToString());
                Listt[i].Description    = PIn.PString(table.Rows[i][1].ToString());
                Listt[i].DefaultPercent = PIn.PInt(table.Rows[i][2].ToString());
                Listt[i].CovOrder       = PIn.PInt(table.Rows[i][3].ToString());
                Listt[i].IsHidden       = PIn.PBool(table.Rows[i][4].ToString());
                Listt[i].EbenefitCat    = (EbenefitCategory)PIn.PInt(table.Rows[i][5].ToString());
            }
            table     = ds.Tables[1];
            ListShort = new CovCat[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                ListShort[i]                = new CovCat();
                ListShort[i].CovCatNum      = PIn.PInt(table.Rows[i][0].ToString());
                ListShort[i].Description    = PIn.PString(table.Rows[i][1].ToString());
                ListShort[i].DefaultPercent = PIn.PInt(table.Rows[i][2].ToString());
                ListShort[i].CovOrder       = PIn.PInt(table.Rows[i][3].ToString());
                ListShort[i].IsHidden       = PIn.PBool(table.Rows[i][4].ToString());
                ListShort[i].EbenefitCat    = (EbenefitCategory)PIn.PInt(table.Rows[i][5].ToString());
            }
        }
Ejemplo n.º 3
0
        ///<summary></summary>
        public static long GetCovCatNum(int orderShort)
        {
            //No need to check RemotingRole; no call to db.
            CovCat covCat = GetLastOrDefault(x => x.CovOrder == orderShort, true);

            return(covCat == null ? 0 : covCat.CovCatNum);
        }
Ejemplo n.º 4
0
		///<summary></summary>
		public static long Insert(CovCat covcat) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				covcat.CovCatNum=Meth.GetLong(MethodBase.GetCurrentMethod(),covcat);
				return covcat.CovCatNum;
			}
			return Crud.CovCatCrud.Insert(covcat);
		}
Ejemplo n.º 5
0
        ///<summary>Returns a non-empty string if there would be a display issue due to invalid settings.
        ///Use the result to block the display from the user when needed.</summary>
        public static string ValidateSettings()
        {
            string validationErrors  = "";
            Array  arrayEbenetitCats = Enum.GetValues(typeof(EbenefitCategory));

            for (int i = 0; i < arrayEbenetitCats.Length; i++)
            {
                EbenefitCategory ebenCat = (EbenefitCategory)arrayEbenetitCats.GetValue(i);
                if (ebenCat == EbenefitCategory.None)
                {
                    continue;
                }
                CovCat covCat = CovCats.GetForEbenCat(ebenCat);
                if (covCat == null)
                {
                    if (validationErrors != "")
                    {
                        validationErrors += ", ";
                    }
                    validationErrors += ebenCat.ToString();
                }
            }
            if (validationErrors != "")
            {
                validationErrors = "Missing or hidden insurance category for each of the following E-benefits:" + "\r\n"
                                   + validationErrors + "\r\n"
                                   + "Go to Setup then Insurance Categories to add or edit.";
            }
            return(validationErrors);
        }
Ejemplo n.º 6
0
        ///<summary></summary>
        public static double GetDefaultPercent(long myCovCatNum)
        {
            //No need to check RemotingRole; no call to db.
            CovCat covCat = GetFirstOrDefault(x => x.CovCatNum == myCovCatNum);

            return(covCat == null ? 0 : (double)covCat.DefaultPercent);
        }
Ejemplo n.º 7
0
        ///<summary></summary>
        public static string GetDesc(long covCatNum)
        {
            //No need to check RemotingRole; no call to db.
            CovCat covCat = GetLastOrDefault(x => x.CovCatNum == covCatNum);

            return(covCat == null ? "" : covCat.Description);
        }
Ejemplo n.º 8
0
		///<summary></summary>
		public static void Update(CovCat covcat) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),covcat);
				return;
			}
			Crud.CovCatCrud.Update(covcat);
		}
Ejemplo n.º 9
0
 ///<summary></summary>
 public static void Update(CovCat covcat)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), covcat);
         return;
     }
     Crud.CovCatCrud.Update(covcat);
 }
Ejemplo n.º 10
0
 ///<summary></summary>
 public static long Insert(CovCat covcat)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         covcat.CovCatNum = Meth.GetLong(MethodBase.GetCurrentMethod(), covcat);
         return(covcat.CovCatNum);
     }
     return(Crud.CovCatCrud.Insert(covcat));
 }
Ejemplo n.º 11
0
Archivo: CovCat.cs Proyecto: mnisl/OD
		///<summary></summary>
		public CovCat Copy() {
			CovCat c=new CovCat();
			c.CovCatNum=CovCatNum;
			c.Description=Description;
			c.DefaultPercent=DefaultPercent;
			c.CovOrder=CovOrder;
			c.IsHidden=IsHidden;
			c.EbenefitCat=EbenefitCat;
			return c;
		}
Ejemplo n.º 12
0
Archivo: CovCats.cs Proyecto: mnisl/OD
		///<summary>Does not update the cache.  The cache must be manually refreshed after using this method beccause it only updates the database.</summary>
		public static void MoveDown(CovCat covcat) {
			//No need to check RemotingRole; no call to db.
			List<CovCat> listCovCats=CovCatC.GetListt();
			int oldOrder=CovCatC.GetOrderLong(covcat.CovCatNum);
			if(oldOrder==listCovCats.Count-1 || oldOrder==-1) {
				return;
			}
			SetOrder(listCovCats[oldOrder],(byte)(oldOrder+1));
			SetOrder(listCovCats[oldOrder+1],(byte)oldOrder);
		}
Ejemplo n.º 13
0
		///<summary></summary>
		public static void MoveDown(CovCat covcat) {
			//No need to check RemotingRole; no call to db.
			RefreshCache();
			int oldOrder=CovCatC.GetOrderLong(covcat.CovCatNum);
			if(oldOrder==CovCatC.Listt.Count-1 || oldOrder==-1) {
				return;
			}
			SetOrder(CovCatC.Listt[oldOrder],(byte)(oldOrder+1));
			SetOrder(CovCatC.Listt[oldOrder+1],(byte)oldOrder);
		}
Ejemplo n.º 14
0
        ///<summary></summary>
        public CovCat Copy()
        {
            CovCat c = new CovCat();

            c.CovCatNum      = CovCatNum;
            c.Description    = Description;
            c.DefaultPercent = DefaultPercent;
            c.CovOrder       = CovOrder;
            c.IsHidden       = IsHidden;
            c.EbenefitCat    = EbenefitCat;
            return(c);
        }
Ejemplo n.º 15
0
 private void butAddCat_Click(object sender, System.EventArgs e)
 {
     CovCat covcat=new CovCat();
     covcat.CovOrder=(byte)CovCatC.Listt.Count;
     covcat.DefaultPercent=-1;
     FormInsCatEdit FormE=new FormInsCatEdit(covcat);
     FormE.IsNew=true;
     FormE.ShowDialog();
     if(FormE.DialogResult==DialogResult.OK){
         changed=true;
         FillSpans();
     }
 }
Ejemplo n.º 16
0
        ///<summary>Does not update the cache.  The cache must be manually refreshed after using this method beccause it only updates the database.</summary>
        public static void MoveDown(CovCat covcat)
        {
            //No need to check RemotingRole; no call to db.
            List <CovCat> listCovCats = CovCats.GetDeepCopy();
            int           oldOrder    = listCovCats.FindIndex(x => x.CovCatNum == covcat.CovCatNum);

            if (oldOrder == listCovCats.Count - 1 || oldOrder == -1)
            {
                return;
            }
            SetOrder(listCovCats[oldOrder], (byte)(oldOrder + 1));
            SetOrder(listCovCats[oldOrder + 1], (byte)oldOrder);
        }
Ejemplo n.º 17
0
        ///<summary></summary>
        public static void MoveDown(CovCat covcat)
        {
            //No need to check RemotingRole; no call to db.
            RefreshCache();
            int oldOrder = CovCatC.GetOrderLong(covcat.CovCatNum);

            if (oldOrder == CovCatC.Listt.Count - 1 || oldOrder == -1)
            {
                return;
            }
            SetOrder(CovCatC.Listt[oldOrder], (byte)(oldOrder + 1));
            SetOrder(CovCatC.Listt[oldOrder + 1], (byte)oldOrder);
        }
Ejemplo n.º 18
0
        ///<summary>Pass in list of procedures and covCat, return the sum of all CanadaTimeUnits of the procedures in that covCat as a double.</summary>
        public static double GetAmtUsedForCat(List <Procedure> listProcs, CovCat covCat)
        {
            List <ProcedureCode> listProcCodes = new List <ProcedureCode>();

            for (int i = 0; i < listProcs.Count; i++)
            {
                listProcCodes.Add(ProcedureCodes.GetProcCode(listProcs[i].CodeNum)); //turn list of procedures into list of procedurecodes.
            }
            double total = 0;                                                        //CanadaTimeUnits can be decimal numbers, like 0.5.

            for (int i = 0; i < listProcCodes.Count; i++)                            //for every procedurecode
            {
                List <CovCat> listCovCatsForProc = GetCovCats(CovSpans.GetCats(listProcCodes[i].ProcCode));
                if (listCovCatsForProc.Any(x => x.CovCatNum == covCat.CovCatNum))
                {
                    total += listProcCodes[i].CanadaTimeUnits;                   //add the Canada time units to the total.
                }
            }
            return(total);
        }
Ejemplo n.º 19
0
 ///<summary></summary>
 private static void SetOrder(CovCat covcat, byte newOrder)
 {
     //No need to check RemotingRole; no call to db.
     covcat.CovOrder = newOrder;
     Update(covcat);
 }
Ejemplo n.º 20
0
		///<summary></summary>
		private static void SetOrder(CovCat covcat, byte newOrder) {
			//No need to check RemotingRole; no call to db.
			covcat.CovOrder=newOrder;
			Update(covcat);
		}
Ejemplo n.º 21
0
		///<summary></summary>
		public FormInsCatEdit(CovCat covCatCur) {
			InitializeComponent();
			CovCatCur=covCatCur.Copy();
			Lan.F(this);
		}