Beispiel #1
0
        public static string GetDetailUrl(this Benefit benefit)
        {
            var urlhelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
            var detailurl = urlhelper.Action("Detail", "Benefit", routeValues: new { area = "", benefit.Id });

            return(detailurl);
        }
Beispiel #2
0
		///<summary>Inserts one Benefit into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
		public static long InsertNoCache(Benefit benefit,bool useExistingPK){
			bool isRandomKeys=Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
			string command="INSERT INTO benefit (";
			if(!useExistingPK && isRandomKeys) {
				benefit.BenefitNum=ReplicationServers.GetKeyNoCache("benefit","BenefitNum");
			}
			if(isRandomKeys || useExistingPK) {
				command+="BenefitNum,";
			}
			command+="PlanNum,PatPlanNum,CovCatNum,BenefitType,Percent,MonetaryAmt,TimePeriod,QuantityQualifier,Quantity,CodeNum,CoverageLevel) VALUES(";
			if(isRandomKeys || useExistingPK) {
				command+=POut.Long(benefit.BenefitNum)+",";
			}
			command+=
				     POut.Long  (benefit.PlanNum)+","
				+    POut.Long  (benefit.PatPlanNum)+","
				+    POut.Long  (benefit.CovCatNum)+","
				+    POut.Int   ((int)benefit.BenefitType)+","
				+    POut.Int   (benefit.Percent)+","
				+"'"+POut.Double(benefit.MonetaryAmt)+"',"
				+    POut.Int   ((int)benefit.TimePeriod)+","
				+    POut.Int   ((int)benefit.QuantityQualifier)+","
				+    POut.Byte  (benefit.Quantity)+","
				+    POut.Long  (benefit.CodeNum)+","
				+    POut.Int   ((int)benefit.CoverageLevel)+")";
			if(useExistingPK || isRandomKeys) {
				Db.NonQ(command);
			}
			else {
				benefit.BenefitNum=Db.NonQ(command,true,"BenefitNum","benefit");
			}
			return benefit.BenefitNum;
		}
Beispiel #3
0
        ///<summary>Used in the Plan edit window to get a list of benefits for specified plan and patPlan.  patPlanNum can be 0.</summary>
        public static List <Benefit> RefreshForPlan(int planNum, int patPlanNum)
        {
            string command = "SELECT *" //,IFNULL(covcat.CovCatNum,0) AS covorder "
                             + " FROM benefit"
                                        //+" LEFT JOIN covcat ON covcat.CovCatNum=benefit.CovCatNum"
                             + " WHERE PlanNum = " + POut.PInt(planNum);

            if (patPlanNum != 0)
            {
                command += " OR PatPlanNum = " + POut.PInt(patPlanNum);
            }
            DataTable      table  = General.GetTable(command);
            List <Benefit> retVal = new List <Benefit>();
            Benefit        ben;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                ben                   = new Benefit();
                ben.BenefitNum        = PIn.PInt(table.Rows[i][0].ToString());
                ben.PlanNum           = PIn.PInt(table.Rows[i][1].ToString());
                ben.PatPlanNum        = PIn.PInt(table.Rows[i][2].ToString());
                ben.CovCatNum         = PIn.PInt(table.Rows[i][3].ToString());
                ben.ADACode           = PIn.PString(table.Rows[i][4].ToString());
                ben.BenefitType       = (InsBenefitType)PIn.PInt(table.Rows[i][5].ToString());
                ben.Percent           = PIn.PInt(table.Rows[i][6].ToString());
                ben.MonetaryAmt       = PIn.PDouble(table.Rows[i][7].ToString());
                ben.TimePeriod        = (BenefitTimePeriod)PIn.PInt(table.Rows[i][8].ToString());
                ben.QuantityQualifier = (BenefitQuantity)PIn.PInt(table.Rows[i][9].ToString());
                ben.Quantity          = PIn.PInt(table.Rows[i][10].ToString());
                retVal.Add(ben);
            }
            return(retVal);
        }
Beispiel #4
0
    public void Remove(Benefit benefit)
    {
        var result = Benefits.Remove(benefit);

        Debug.Log($"Removing {benefit.Title} result {result}");
        CalculateFlowData();
    }
Beispiel #5
0
        public IActionResult Add(AddJobViewModel addJobViewModel, List <string> Requirements, List <string> Benefits, List <string> TagNames)
        {
            if (ModelState.IsValid)
            {
                var currentUser = HttpContext.User.Identity.Name;
                Job newJob      = new Job()
                {
                    Name          = addJobViewModel.Name,
                    DatePosted    = DateTime.Now,
                    Location      = addJobViewModel.Location,
                    PositionLevel = addJobViewModel.PositionLevel,
                    PositionType  = addJobViewModel.PositionType,
                    Description   = addJobViewModel.Description,
                    Employer      = currentUser,
                    IsOpened      = true
                };
                context.Job.Add(newJob);
                context.SaveChanges();

                foreach (var item in Requirements)
                {
                    Requirement newRequirement = new Requirement()
                    {
                        RequirementName = item,
                        JobId           = newJob.JobId
                    };
                    context.Requirements.Add(newRequirement);
                    context.SaveChanges();
                }
                ;

                foreach (var item in Benefits)
                {
                    Benefit newBenefit = new Benefit()
                    {
                        BenefitName = item,
                        JobId       = newJob.JobId
                    };
                    context.Benefits.Add(newBenefit);
                    context.SaveChanges();
                }
                ;

                foreach (var item in TagNames)
                {
                    Tag newTag = new Tag()
                    {
                        TagName = item,
                        JobId   = newJob.JobId
                    };
                    context.Tag.Add(newTag);
                    context.SaveChanges();
                }

                return(RedirectToAction("ViewJob", new { id = newJob.JobId }));
            }

            // If we get here, something's wrong and re-render the form
            return(View());
        }
Beispiel #6
0
        public List <string> Get()
        {
            if (ThisIsSpell && (Character.Protagonist.SpellSlots >= 1))
            {
                Character.Protagonist.Spells.Add(Text);
                Character.Protagonist.SpellSlots -= 1;
            }
            else if ((Price > 0) && (Character.Protagonist.Gold >= Price))
            {
                Character.Protagonist.Gold -= Price;

                if (!Multiple)
                {
                    Used = true;
                }

                if (Benefit != null)
                {
                    Benefit.Do();
                }
            }

            return(new List <string> {
                "RELOAD"
            });
        }
Beispiel #7
0
 ///<summary>Inserts one Benefit into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Benefit benefit,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         benefit.BenefitNum=ReplicationServers.GetKey("benefit","BenefitNum");
     }
     string command="INSERT INTO benefit (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="BenefitNum,";
     }
     command+="PlanNum,PatPlanNum,CovCatNum,BenefitType,Percent,MonetaryAmt,TimePeriod,QuantityQualifier,Quantity,CodeNum,CoverageLevel) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(benefit.BenefitNum)+",";
     }
     command+=
              POut.Long  (benefit.PlanNum)+","
         +    POut.Long  (benefit.PatPlanNum)+","
         +    POut.Long  (benefit.CovCatNum)+","
         +    POut.Int   ((int)benefit.BenefitType)+","
         +    POut.Int   (benefit.Percent)+","
         +"'"+POut.Double(benefit.MonetaryAmt)+"',"
         +    POut.Int   ((int)benefit.TimePeriod)+","
         +    POut.Int   ((int)benefit.QuantityQualifier)+","
         +    POut.Byte  (benefit.Quantity)+","
         +    POut.Long  (benefit.CodeNum)+","
         +    POut.Int   ((int)benefit.CoverageLevel)+")";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         benefit.BenefitNum=Db.NonQ(command,true);
     }
     return benefit.BenefitNum;
 }
Beispiel #8
0
 ///<summary>Inserts one Benefit into the database.  Returns the new priKey.</summary>
 internal static long Insert(Benefit benefit)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         benefit.BenefitNum=DbHelper.GetNextOracleKey("benefit","BenefitNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(benefit,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     benefit.BenefitNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(benefit,false);
     }
 }
Beispiel #9
0
        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32((sender as LinkButton).CommandArgument);

            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }

            SqlCommand cmd = new SqlCommand("sp_deleteBenefit", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Benefit_ID", id);
            Benefit b = new Benefit();

            b.Benefit_ID   = id;
            b.Benefit_Type = TextBox1.Text;
            if (new BenefitAccess().Delete(b) == b.Benefit_ID)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ClientScript", "alert('Successful')", true);
                GridView1.DataSourceID = SqlDataSource1.ID;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ClientScript", "alert('Failed')", true);
            }
            cmd.ExecuteNonQuery();
            con.Close();
        }
Beispiel #10
0
        protected void btnupdate_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(HiddenField1.Value);
            //if (con.State == ConnectionState.Closed)
            //    con.Open();
            //SqlCommand cmd = new SqlCommand("sp_updateBenefit", con);
            //cmd.CommandType = CommandType.StoredProcedure;
            //cmd.Parameters.AddWithValue("@Benefit_ID", id);
            //cmd.Parameters.AddWithValue("@Benefit_Type", TextBox1.Text);
            Benefit b = new Benefit();

            b.Benefit_ID   = id;
            b.Benefit_Type = TextBox1.Text;
            if (new BenefitAccess().Update(b) >= 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ClientScript", "alert('Successful')", true);
                //  new BenefitAccess().Display();
                GridView1.DataSourceID = SqlDataSource1.ID;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ClientScript", "alert('Failed')", true);
            }
            //cmd.ExecuteNonQuery();
            //con.Close();
        }
Beispiel #11
0
 private void butCancel_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         BenCur = null;
     }
     DialogResult = DialogResult.Cancel;
 }
Beispiel #12
0
 private double TimePointsToConsumption(double t)
 {
     if (t <= R)
     {
         return((1 - kappa) * w);
     }
     return(Benefit.Last()); // konstant benefit
 }
Beispiel #13
0
 private double TimePointsToAccount(double t)
 {
     if (t <= R)
     {
         return(t * kappa * w);
     }
     return(TimePointsToAccount(R) - (t - R) * Benefit.Last());
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Benefit benefit = db.Benefits.Find(id);

            db.Benefits.Remove(benefit);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #15
0
        public static Benefit CreateFrequencyLimitation(string procCode, byte quantity, BenefitQuantity quantityQualifier, long planNum,
                                                        BenefitTimePeriod timePeriod)
        {
            Benefit ben = Benefits.CreateFrequencyBenefit(ProcedureCodes.GetCodeNum(procCode), quantity, quantityQualifier, planNum, timePeriod);

            Benefits.Insert(ben);
            return(ben);
        }
 public void NewBenefit( Benefit benefit)
 {
     //Benefits.Add(benefit);
     //if (!_categoryBenefitsAreValid.IsSatisfiedBy(this))
     //{
     //    Benefits.Remove(benefit);
        
     //}
 }
Beispiel #17
0
 public bool BenefitAllowed(CharacterGeneration.Character character, Benefit benefit)
 {
     if (benefit.Name.Equals(CharacterGeneration.BenefitLibrary.Weapon) &&
         character.CharacterSpecies == CharacterGeneration.Character.Species.Wraither)
     {
         return(false);
     }
     return(true);
 }
Beispiel #18
0
 public bool BenefitAllowed(Character character, Benefit benefit)
 {
     if (character.Sex.Equals(Properties.Resources.Sex_Female) &&
         benefit.Name.Equals(BenefitLibrary.Independance.Name))
     {
         benefit.Name = BenefitLibrary.Weapon.Name;
     }
     return(true);
 }
Beispiel #19
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     BenCur = null;
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     DialogResult = DialogResult.OK;
 }
 public BenefitDTO(Benefit benefit, bool deepCopy)
 {
     this.benefitId = benefit.BenefitId;
     this.benefitName = benefit.BenefitName;
     this.benefitCostEmployee = benefit.BenefitCostEmployee;
     this.benefitCostDependent = benefit.BenefitCostDependent;
     this.createdDate = benefit.CreatedDate.ToJavaScriptDate();
     this.isActive = benefit.IsActive;
     this.isDeleted = benefit.IsDeleted;
 }
Beispiel #21
0
        public static string GetDefaultImageUrl(this Benefit benefit, int width = 50, int height = 50)
        {
            var urlhelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
            var url       = benefit.DefaultFileId.HasValue
                ? urlhelper.Action("Image", "File",
                                   new { area = "", id = benefit.DefaultFileId, width = width, height = height })
                : urlhelper.GetNoImageUrl(width, height);

            return(url);
        }
Beispiel #22
0
        //
        // GET: /Benefit/Details/5

        public ActionResult Details(int id = 0)
        {
            Benefit benefit = db.Benefit.Find(id);

            if (benefit == null)
            {
                return(HttpNotFound());
            }
            return(View(benefit));
        }
 public ActionResult Edit([Bind(Include = "BenefitID,Coverage,CostofBenefit,DiscountLetter,Discount")] Benefit benefit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(benefit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(benefit));
 }
 public ActionResult Edit([Bind(Include = "Benefit_ID,Benefit_Type")] Benefit benefit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(benefit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(benefit));
 }
 public Employee(string firstName, string lastName, char gender, int dependents, double annualSalary, string employeeType, Benefit benefits)
 {
     FirstName = firstName;             //Here we setup the overloaded constructor
     LastName = lastName;
     Gender = gender;
     Dependents = dependents;
     AnnualSalary = annualSalary;
     Benefits = benefits; //Adding the Benefits argument
     numEmployees++;
 }
        public ActionResult Create([Bind(Include = "Benefit_ID,Benefit_Type")] Benefit benefit)
        {
            if (ModelState.IsValid)
            {
                db.Benefits.Add(benefit);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(benefit));
        }
        private void CreateFrequencyBenefit(ValidNumber textBox, ComboBox comboBox, string procCodeStr)
        {
            if (PIn.Byte(textBox.Text, false) == 0 || ProcedureCodes.GetCodeNum(procCodeStr) == 0)
            {
                return;
            }
            Benefit ben = Benefits.CreateFrequencyBenefit(ProcedureCodes.GetCodeNum(procCodeStr), PIn.Byte(textBox.Text), GetQuantityQualifier(comboBox),
                                                          _planNum, GetTimePeriod(comboBox.SelectedIndex));

            _listBenefitsAll.Add(ben);
        }
Beispiel #28
0
 public ActionResult Edit(Benefit benefit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(benefit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HomID = new SelectList(db.HomItems, "ID", "ID", benefit.HomID);
     return(View(benefit));
 }
Beispiel #29
0
        //
        // GET: /Benefit/Edit/5

        public ActionResult Edit(int id = 0)
        {
            Benefit benefit = db.Benefit.Find(id);

            if (benefit == null)
            {
                return(HttpNotFound());
            }
            ViewBag.HomID = new SelectList(db.HomItems, "ID", "ID", benefit.HomID);
            return(View(benefit));
        }
    public void Initialize(Benefit benefit, UiOrderWindow window, bool active)
    {
        _window        = window;
        _linkedBenefit = benefit;

        title.text       = benefit.Title;
        description.text = benefit.Description;

        buyButton.SetActive(!active);
        cancelButton.SetActive(active);
    }
        public ActionResult Create([Bind(Include = "BenefitID,Coverage,CostofBenefit,DiscountLetter,Discount")] Benefit benefit)
        {
            if (ModelState.IsValid)
            {
                db.Benefits.Add(benefit);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(benefit));
        }
Beispiel #32
0
		///<summary>Updates one Benefit in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
		public static bool Update(Benefit benefit,Benefit oldBenefit){
			string command="";
			if(benefit.PlanNum != oldBenefit.PlanNum) {
				if(command!=""){ command+=",";}
				command+="PlanNum = "+POut.Long(benefit.PlanNum)+"";
			}
			if(benefit.PatPlanNum != oldBenefit.PatPlanNum) {
				if(command!=""){ command+=",";}
				command+="PatPlanNum = "+POut.Long(benefit.PatPlanNum)+"";
			}
			if(benefit.CovCatNum != oldBenefit.CovCatNum) {
				if(command!=""){ command+=",";}
				command+="CovCatNum = "+POut.Long(benefit.CovCatNum)+"";
			}
			if(benefit.BenefitType != oldBenefit.BenefitType) {
				if(command!=""){ command+=",";}
				command+="BenefitType = "+POut.Int   ((int)benefit.BenefitType)+"";
			}
			if(benefit.Percent != oldBenefit.Percent) {
				if(command!=""){ command+=",";}
				command+="Percent = "+POut.Int(benefit.Percent)+"";
			}
			if(benefit.MonetaryAmt != oldBenefit.MonetaryAmt) {
				if(command!=""){ command+=",";}
				command+="MonetaryAmt = '"+POut.Double(benefit.MonetaryAmt)+"'";
			}
			if(benefit.TimePeriod != oldBenefit.TimePeriod) {
				if(command!=""){ command+=",";}
				command+="TimePeriod = "+POut.Int   ((int)benefit.TimePeriod)+"";
			}
			if(benefit.QuantityQualifier != oldBenefit.QuantityQualifier) {
				if(command!=""){ command+=",";}
				command+="QuantityQualifier = "+POut.Int   ((int)benefit.QuantityQualifier)+"";
			}
			if(benefit.Quantity != oldBenefit.Quantity) {
				if(command!=""){ command+=",";}
				command+="Quantity = "+POut.Byte(benefit.Quantity)+"";
			}
			if(benefit.CodeNum != oldBenefit.CodeNum) {
				if(command!=""){ command+=",";}
				command+="CodeNum = "+POut.Long(benefit.CodeNum)+"";
			}
			if(benefit.CoverageLevel != oldBenefit.CoverageLevel) {
				if(command!=""){ command+=",";}
				command+="CoverageLevel = "+POut.Int   ((int)benefit.CoverageLevel)+"";
			}
			if(command==""){
				return false;
			}
			command="UPDATE benefit SET "+command
				+" WHERE BenefitNum = "+POut.Long(benefit.BenefitNum);
			Db.NonQ(command);
			return true;
		}
        public async Task <IActionResult> CreateBenefit(Benefit benefit)
        {
            if (ModelState.IsValid)
            {
                context.Add(benefit);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(ListBenefits)));
            }
            return(View(benefit));
        }
Beispiel #34
0
        public PayrollManager()
        {
            // in a production app, these would come from an API or database
            defaultBenefit = new Benefit();
            var nameDiscount = new NameDiscount();

            calculator = new BenefitCalculator(new List <IDiscount>()
            {
                nameDiscount
            });
        }
Beispiel #35
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<Benefit> TableToList(DataTable table){
			List<Benefit> retVal=new List<Benefit>();
			Benefit benefit;
			for(int i=0;i<table.Rows.Count;i++) {
				benefit=new Benefit();
				benefit.BenefitNum       = PIn.Long  (table.Rows[i]["BenefitNum"].ToString());
				benefit.PlanNum          = PIn.Long  (table.Rows[i]["PlanNum"].ToString());
				benefit.PatPlanNum       = PIn.Long  (table.Rows[i]["PatPlanNum"].ToString());
				benefit.CovCatNum        = PIn.Long  (table.Rows[i]["CovCatNum"].ToString());
				benefit.BenefitType      = (OpenDentBusiness.InsBenefitType)PIn.Int(table.Rows[i]["BenefitType"].ToString());
				benefit.Percent          = PIn.Int   (table.Rows[i]["Percent"].ToString());
				benefit.MonetaryAmt      = PIn.Double(table.Rows[i]["MonetaryAmt"].ToString());
				benefit.TimePeriod       = (OpenDentBusiness.BenefitTimePeriod)PIn.Int(table.Rows[i]["TimePeriod"].ToString());
				benefit.QuantityQualifier= (OpenDentBusiness.BenefitQuantity)PIn.Int(table.Rows[i]["QuantityQualifier"].ToString());
				benefit.Quantity         = PIn.Byte  (table.Rows[i]["Quantity"].ToString());
				benefit.CodeNum          = PIn.Long  (table.Rows[i]["CodeNum"].ToString());
				benefit.CoverageLevel    = (OpenDentBusiness.BenefitCoverageLevel)PIn.Int(table.Rows[i]["CoverageLevel"].ToString());
				retVal.Add(benefit);
			}
			return retVal;
		}
Beispiel #36
0
		///<summary>Updates one Benefit in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
		public static bool Update(Benefit benefit,Benefit oldBenefit){
			string command="";
			if(benefit.PlanNum != oldBenefit.PlanNum) {
				if(command!=""){ command+=",";}
				command+="PlanNum = "+POut.Long(benefit.PlanNum)+"";
			}
			if(benefit.PatPlanNum != oldBenefit.PatPlanNum) {
				if(command!=""){ command+=",";}
				command+="PatPlanNum = "+POut.Long(benefit.PatPlanNum)+"";
			}
			if(benefit.CovCatNum != oldBenefit.CovCatNum) {
				if(command!=""){ command+=",";}
				command+="CovCatNum = "+POut.Long(benefit.CovCatNum)+"";
			}
			if(benefit.BenefitType != oldBenefit.BenefitType) {
				if(command!=""){ command+=",";}
				command+="BenefitType = "+POut.Int   ((int)benefit.BenefitType)+"";
			}
			if(benefit.Percent != oldBenefit.Percent) {
				if(command!=""){ command+=",";}
				command+="Percent = "+POut.Int(benefit.Percent)+"";
			}
			if(benefit.MonetaryAmt != oldBenefit.MonetaryAmt) {
				if(command!=""){ command+=",";}
				command+="MonetaryAmt = '"+POut.Double(benefit.MonetaryAmt)+"'";
			}
			if(benefit.TimePeriod != oldBenefit.TimePeriod) {
				if(command!=""){ command+=",";}
				command+="TimePeriod = "+POut.Int   ((int)benefit.TimePeriod)+"";
			}
			if(benefit.QuantityQualifier != oldBenefit.QuantityQualifier) {
				if(command!=""){ command+=",";}
				command+="QuantityQualifier = "+POut.Int   ((int)benefit.QuantityQualifier)+"";
			}
			if(benefit.Quantity != oldBenefit.Quantity) {
				if(command!=""){ command+=",";}
				command+="Quantity = "+POut.Byte(benefit.Quantity)+"";
			}
			if(benefit.CodeNum != oldBenefit.CodeNum) {
				if(command!=""){ command+=",";}
				command+="CodeNum = "+POut.Long(benefit.CodeNum)+"";
			}
			if(benefit.CoverageLevel != oldBenefit.CoverageLevel) {
				if(command!=""){ command+=",";}
				command+="CoverageLevel = "+POut.Int   ((int)benefit.CoverageLevel)+"";
			}
			if(command==""){
				return false;
			}
			command="UPDATE benefit SET "+command
				+" WHERE BenefitNum = "+POut.Long(benefit.BenefitNum);
			Db.NonQ(command);
			return true;
		}
Beispiel #37
0
		///<summary>Updates one Benefit in the database.</summary>
		public static void Update(Benefit benefit){
			string command="UPDATE benefit SET "
				+"PlanNum          =  "+POut.Long  (benefit.PlanNum)+", "
				+"PatPlanNum       =  "+POut.Long  (benefit.PatPlanNum)+", "
				+"CovCatNum        =  "+POut.Long  (benefit.CovCatNum)+", "
				+"BenefitType      =  "+POut.Int   ((int)benefit.BenefitType)+", "
				+"Percent          =  "+POut.Int   (benefit.Percent)+", "
				+"MonetaryAmt      = '"+POut.Double(benefit.MonetaryAmt)+"', "
				+"TimePeriod       =  "+POut.Int   ((int)benefit.TimePeriod)+", "
				+"QuantityQualifier=  "+POut.Int   ((int)benefit.QuantityQualifier)+", "
				+"Quantity         =  "+POut.Byte  (benefit.Quantity)+", "
				+"CodeNum          =  "+POut.Long  (benefit.CodeNum)+", "
				+"CoverageLevel    =  "+POut.Int   ((int)benefit.CoverageLevel)+" "
				+"WHERE BenefitNum = "+POut.Long(benefit.BenefitNum);
			Db.NonQ(command);
		}
 public Employee()
 {
     EmployeeType = DEFAULT_EMPLOYEE;
     benefits = new Benefit(); //Instantiates the Benefit class
     numEmployees++;
 }