Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (entityId_ != null)
            {
                hash ^= EntityId.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (NoPenaltyDays != 0)
            {
                hash ^= NoPenaltyDays.GetHashCode();
            }
            if (FeeCategory != 0)
            {
                hash ^= FeeCategory.GetHashCode();
            }
            if (cancellationFeeAmount_ != null)
            {
                hash ^= CancellationFeeAmount.GetHashCode();
            }
            if (cancellationFeeRate_ != null)
            {
                hash ^= CancellationFeeRate.GetHashCode();
            }
            if (CancellationPolicyText.Length != 0)
            {
                hash ^= CancellationPolicyText.GetHashCode();
            }
            return(hash);
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,FeeCategoryName")] FeeCategory feeCategory)
        {
            if (id != feeCategory.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(feeCategory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FeeCategoryExists(feeCategory.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(feeCategory));
        }
Exemple #3
0
        public static FeeCategory UpdateFeeCategory(FeeCategory feeCategory)
        {
            AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString());

            SqlParameter[] sqlParameter =
            {
                new SqlParameter("@SetAction",               feeCategory.SetAction.ToUpper()),
                new SqlParameter("@FeeCategoryId",           feeCategory.FeeCategoryId),
                new SqlParameter("@FeeCategoryName",         feeCategory.FeeCategoryName),
                new SqlParameter("@FeeCategoryDescription ", feeCategory.FeeCategoryDescription)
            };
            DataSet ds = new DataSet();

            ds = objHelper.ExecDataSetProc("GKL_USP_UpdateFeeCategory", sqlParameter);

            List <FeeCategory> objlm = null;

            objlm = ds.Tables[0].AsEnumerable()
                    .Select(row => new FeeCategory
            {
                FeeCategoryId          = row.Field <int>("FeeCategoryId"),
                FeeCategoryName        = Common.ConvertFromDBVal <string>(row["FeeCategoryName"]),
                FeeCategoryDescription = Common.ConvertFromDBVal <string>(row["FeeCategoryDescription"]),
                Active = row.Field <bool>("Active")
            }).ToList();
            return(objlm[0]);
        }
        //Delete Internal Revenue Allotment
        public ActionResult DeleteFeeCategory(FM_Fees_Fee model, int FeeCategoryID)
        {
            FeeCategory tblFeeCategory = (from e in TOSSDB.FeeCategories where e.FeeCategoryID == FeeCategoryID select e).FirstOrDefault();

            TOSSDB.FeeCategories.Remove(tblFeeCategory);
            TOSSDB.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //Get Update Internal Revenue Allotment
        public ActionResult Get_UpdateFeeCategory(FM_Fees_Fee model, int FeeCategoryID)
        {
            FeeCategory tblFeeCategory = (from e in TOSSDB.FeeCategories where e.FeeCategoryID == FeeCategoryID select e).FirstOrDefault();

            model.getFeeCategorycolumns.FeeCategoryID   = tblFeeCategory.FeeCategoryID;
            model.getFeeCategorycolumns.FeeCategoryName = tblFeeCategory.FeeCategoryName;
            model.AccountFormTempID = tblFeeCategory.AFDescriptionID;
            return(PartialView("Fee/FeeCategory/_UpdateFeeCategory", model));
        }
        public JsonResult AddFeeCategory(FM_Fees_Fee model)
        {
            FeeCategory tblFeeCategory = new FeeCategory();

            tblFeeCategory.FeeCategoryName = model.getFeeCategorycolumns.FeeCategoryName;
            tblFeeCategory.AFDescriptionID = model.AFDescriptionID;
            TOSSDB.FeeCategories.Add(tblFeeCategory);
            TOSSDB.SaveChanges();
            return(Json(tblFeeCategory));
        }
        //Update Internal Revenue Allotment
        public ActionResult UpdateFeeCategory(FM_Fees_Fee model)
        {
            FeeCategory tblFeeCategory = (from e in TOSSDB.FeeCategories where e.FeeCategoryID == model.getFeeCategorycolumns.FeeCategoryID select e).FirstOrDefault();

            tblFeeCategory.FeeCategoryName = model.getFeeCategorycolumns.FeeCategoryName;
            tblFeeCategory.AFDescriptionID = model.AFDescriptionID;
            TOSSDB.Entry(tblFeeCategory);
            TOSSDB.SaveChanges();
            return(PartialView("Fee/FeeCategory/_UpdateFeeCategory", model));
        }
        public JsonResult DeleteFeeCategory(string Id)
        {
            FeeCategory fc = new FeeCategory();

            fc.Id = Convert.ToInt16(Id);
            Business business = new Business();

            business.Delete <FeeCategory>(fc);

            return(Json("", JsonRequestBehavior.AllowGet));
        }
        public async Task <IActionResult> Create([Bind("Id,FeeCategoryName")] FeeCategory feeCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(feeCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(feeCategory));
        }
        public ActionResult AddFeeCategory(FeeCategory feecategory)
        {
            if (ModelState.IsValid)
            {
                Business business = new Business();

                feecategory.Status = "ACTIVE";
                if (feecategory.Id == 0)
                {
                    business.Add <FeeCategory>(feecategory);
                    ModelState.Clear();
                }
                else
                {
                    business.Update <FeeCategory>(feecategory);
                    ModelState.Clear();
                }
                return(PartialView("FeeCategory"));
            }
            return(PartialView("FeeCategory"));
        }
Exemple #11
0
        public FM_Fees_Fee()
        {
            getFieldFee        = new List <FieldFee>();
            getFieldFeecolumns = new FieldFee();
            getFieldFeeList    = new List <FieldFeeList>();


            getFeeCategory        = new List <FeeCategory>();
            getFeeCategorycolumns = new FeeCategory();
            getFeeCategoryList    = new List <FeeCategoryList>();

            // fieldFeeDDs = new List<FieldFeeDD>();
            globalClasses = new GlobalClasses();

            getNatureofParticular        = new List <NatureOfParticular>();
            getNatureofParticularcolumns = new NatureOfParticular();
            getNatureofParticularList    = new List <NatureofParticularList>();


            getParticular        = new List <Particular>();
            getParticularcolumns = new Particular();
            getParticularList    = new List <ParticularList>();
        }
        public async Task <ActionResult> Create(FeeCategoryVm feeCategory)
        {
            if (Db.FeeCategories.Any(fc => fc.CategoryName.Equals(feeCategory.CategoryName)))
            {
                ModelState.AddModelError("Error", "A Fee Category already exists with the name you have supplied or your or the name is blank! Please fill a valid name for the category!");
                return(View(feeCategory));
            }

            if (ModelState.IsValid)
            {
                var model = new FeeCategory
                {
                    CategoryName        = feeCategory.CategoryName,
                    CategoryDescription = feeCategory.CategoryDescription
                };

                Db.FeeCategories.Add(model);
                await Db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(feeCategory));
        }
Exemple #13
0
 public Connection(FeeCategory category, ConnectionParams[] @params)
 {
     Category      = category;
     this.@params  = @params;
     CurrentParams = [email protected](currentParamIndex);
 }
        public async Task <string> GetReport(string patientId, string keyword, DateTime startDate, DateTime endDate, int classType, int statusType)
        {
            var list        = GetFilterFee(patientId, keyword, startDate, endDate.AddDays(1), classType, statusType);
            var feeCategory = new FeeCategory();

            foreach (var item in list.Select(t => new
            {
                t.F_ItemClass, t.F_ItemId, t.F_ItemCode, t.F_ItemName, t.F_ItemSpec, t.F_Amount, t.F_Charges, t.F_Costs, t.F_ItemUnit
            }))
            {
                var billsum = feeCategory.BillSummaries.FirstOrDefault(t => t.FeeType == item.F_ItemClass);
                if (billsum == null)
                {
                    billsum = new BillSummary
                    {
                        FeeType     = item.F_ItemClass,
                        Costs       = 0f,
                        BillDetails = new List <BillDetail>()
                    };
                    feeCategory.BillSummaries.Add(billsum);
                }
                billsum.Costs = billsum.Costs + item.F_Costs.ToFloat(2);
                var bill = billsum.BillDetails.FirstOrDefault(t => t.ItemId == item.F_ItemId);
                if (bill == null)
                {
                    bill = new BillDetail
                    {
                        ItemId   = item.F_ItemId,
                        ItemCode = item.F_ItemCode,
                        ItemName = item.F_ItemName,
                        ItemSpec = item.F_ItemSpec,
                        Amount   = item.F_Amount.ToFloat(2),
                        Charges  = item.F_Charges.ToFloat(2),
                        Price    = item.F_Charges.ToFloat(2),
                        Costs    = item.F_Costs.ToFloat(2),
                        Unit     = item.F_ItemUnit
                    };
                    billsum.BillDetails.Add(bill);
                }
                else
                {
                    bill.Amount  = bill.Amount + item.F_Amount.ToFloat(2);
                    bill.Charges = bill.Charges + item.F_Charges.ToFloat(2);
                    bill.Costs   = bill.Costs + item.F_Costs.ToFloat(2);
                }
            }
            //基本信息
            var first = list.FirstOrDefault();

            if (first != null)
            {
                var patient = await _patientApp.GetForm(patientId);

                if (feeCategory.BirthDay != null)
                {
                    feeCategory.BirthDay  = patient.F_BirthDay.ToChineseDateString();
                    feeCategory.AgeString = ((int)((DateTime.Now - patient.F_BirthDay.ToDate()).TotalDays / 365)).ToString() + "岁";
                }

                feeCategory.Costs      = list.Sum(t => t.F_Costs).ToFloat(2);
                feeCategory.DialysisNo = patient.F_DialysisNo.ToString();
                feeCategory.EndDate    = list.Max(t => t.F_BillingDateTime).ToChineseDateString(); //json.Value<DateTime>("endDate").ToChineseDateString();
                feeCategory.Gender     = patient.F_Gender;

                feeCategory.HospialName = await _organizeApp.GetHospitalName();

                feeCategory.HospialLogo = await _organizeApp.GetHospitalLogo();

                feeCategory.IdNo        = patient.F_IdNo;
                feeCategory.InsuranceNo = patient.F_InsuranceNo;
                feeCategory.Name        = patient.F_Name;
                feeCategory.PatientNo   = patient.F_PatientNo;
                feeCategory.RecordNo    = patient.F_RecordNo;
                feeCategory.StartDate   = list.Min(t => t.F_BillingDateTime).ToChineseDateString();//json.Value<DateTime>("startDate").ToChineseDateString();
            }

            return(GetBillReport(new List <FeeCategory> {
                feeCategory
            }));
        }
 public static FeeCategory ToEntity(this FeeCategoryModel model, FeeCategory destination)
 {
     return(model.MapTo(destination));
 }
        public static decimal CalculateBreakEven(DimensionContainer dimensionContainer, FeeCategory feeCategory, decimal purchasePrice, Func <decimal, decimal> funcShippingcost = null)
        {
            List <decimal> dimensions = new List <decimal>
            {
                dimensionContainer.Length,
                dimensionContainer.Width,
                dimensionContainer.Height,
            }
            .OrderByDescending(o => o)
            .ToList();

            decimal weight = dimensionContainer.Weight;

            decimal longestSide  = dimensions[0];
            decimal medianSide   = dimensions[1];
            decimal shortestSide = dimensions[2];

            ProductSizeTier productSizeTier = GetProductSize(longestSide, medianSide, shortestSide, weight);

            // Shipping Cost to Amazon (estimate) = 0.72 * max(0.25, product weight)
            decimal estimateShippingCostToAmazon = funcShippingcost != null
                                ? funcShippingcost.Invoke(weight)
                                : c_costPerPoundToShip *Math.Max(0.25m, weight);

            // Cost to get to AMZN = Base Price + Shipping Cost to Amazon (estimate)
            decimal costToGetToAmazon = purchasePrice + estimateShippingCostToAmazon;

            // Average Storage Fee = 1.2 * (Width/12) * (Length/12) * (Height/12)
            // TODO: Update storage fee cost to update starting 3/1/2016: http://www.amazon.com/gp/help/customer/display.html?nodeId=201648210
            decimal averageStorageFee = 1.2m * (longestSide / 12) * (medianSide / 12) * (shortestSide / 12);

            // Need to use the Outbound Shipping Weight for calculating the weight fee.

            decimal dimensionalWeight = CalculateDimensionalWeight(longestSide, medianSide, shortestSide);

            decimal outboundShippingWeight = CalculateOutboundShippingWeight(weight, dimensionalWeight, productSizeTier);

            // Size Fee => Multiply flat fee * ProductSizeTier
            decimal sizeFee = GetSizeFee(productSizeTier);

            decimal weightFee = GetWeightFee(productSizeTier, outboundShippingWeight);

            decimal feeCategoryPercentage = GetCategoryFee(feeCategory);

            // TODO: Implement the Zero Fee Fulfillment. Which applies to Small Standard-Size and Large Standard-Size. Price > $300, means no fulfillment fees.
            // Break Even Price = (Cost to get to AMZN + Average Storage Fee + Size Fee + Weight Fee) / (1 - Category Fee Pct)
            return((costToGetToAmazon + averageStorageFee + sizeFee + weightFee) / (1 - feeCategoryPercentage));
        }
        // Category fees listed here: https://www.amazon.com/gp/help/customer/display.html?nodeId=1161240
        private static decimal GetCategoryFee(FeeCategory feeCategory)
        {
            decimal feePercentage = 0.15m;

            switch (feeCategory)
            {
            case FeeCategory.AmazonKindle:
                feePercentage = 0.15m;
                break;

            case FeeCategory.AutomotivePartsAndAccessories:
                feePercentage = 0.12m;
                break;

            case FeeCategory.BabyProducts:
                feePercentage = 0.15m;
                break;

            case FeeCategory.Books:
                feePercentage = 0.15m;
                break;

            case FeeCategory.CameraAndPhoto:
                feePercentage = 0.08m;
                break;

            case FeeCategory.ConsumerElectronics:
                feePercentage = 0.08m;
                break;

            case FeeCategory.ElectronicsAccessories:
                feePercentage = 0.15m;
                break;

            case FeeCategory.EntertainmentCollectibles:
                feePercentage = 0.20m;
                break;

            case FeeCategory.HomeAndGarden:
                feePercentage = 0.15m;
                break;

            case FeeCategory.IndustrialScientific:
                feePercentage = 0.12m;
                break;

            case FeeCategory.KindleAccessories:
                feePercentage = 0.25m;
                break;

            case FeeCategory.Music:
                feePercentage = 0.15m;
                break;

            case FeeCategory.MusicalInstruments:
                feePercentage = 0.15m;
                break;

            case FeeCategory.OfficeProducts:
                feePercentage = 0.15m;
                break;

            case FeeCategory.PersonalComputers:
                feePercentage = 0.06m;
                break;

            case FeeCategory.SoftwareAndComputerGames:
                feePercentage = 0.15m;
                break;

            case FeeCategory.SportingGoods:
                feePercentage = 0.15m;
                break;

            case FeeCategory.SportsCollectibles:
                feePercentage = 0.20m;
                break;

            case FeeCategory.TiresAndWheels:
                feePercentage = 0.10m;
                break;

            case FeeCategory.ToolsAndHomeImprovement:
                feePercentage = 0.12m;
                break;

            case FeeCategory.Toys:
                feePercentage = 0.15m;
                break;

            case FeeCategory.UnlockedCellPhones:
                feePercentage = 0.08m;
                break;

            case FeeCategory.VideoAndDvd:
                feePercentage = 0.15m;
                break;

            case FeeCategory.VideoGameConsoles:
                feePercentage = 0.08m;
                break;

            case FeeCategory.Watches:
                feePercentage = 0.15m;
                break;

            case FeeCategory.AnyOtherProducts:
                feePercentage = 0.15m;
                break;
            }

            return(feePercentage);
        }
 public IHttpActionResult UpdateFeeCategory(FeeCategory feeCategory)
 {
     return(Ok(new { results = feeCategoryService.UpdateFeeCategory(feeCategory) }));
 }
        public static decimal CalculateProfitMargin(DimensionContainer dimensionContainer, FeeCategory feeCategory, decimal lowestPrice, decimal purchasePrice, Func <decimal, decimal> funcShippingCost = null)
        {
            if (lowestPrice <= 0)
            {
                throw new InvalidOperationException("lowestPrice must be greater than 0.");
            }

            decimal breakEvenPrice = CalculateBreakEven(dimensionContainer, feeCategory, purchasePrice, funcShippingCost);

            decimal feePercentage = GetCategoryFee(feeCategory);

            return((((lowestPrice - breakEvenPrice) * (1 - feePercentage)) - (c_returnPercentage * lowestPrice)) / lowestPrice);
        }
Exemple #20
0
 public Stratum(FeeCategory category, ConnectionParams[] paramsList) : base(category, paramsList)
 {
     RecentShares = new List <DateTime>();
 }
Exemple #21
0
 public FeeCategory UpdateFeeCategory(FeeCategory feeCategory)
 {
     return(FeeCategoryDS.UpdateFeeCategory(feeCategory));
 }
Exemple #22
0
 public FeeCategory UpdateFeeCategory(FeeCategory feeCategory)
 {
     return(Channel.UpdateFeeCategory(feeCategory));
 }
 public static FeeCategoryModel ToModel(this FeeCategory entity)
 {
     return(entity.MapTo <FeeCategory, FeeCategoryModel>());
 }