Ejemplo n.º 1
0
        public FeePage()
        {
            InitializeComponent();

            _feeViewModel = new FeeViewModel(Navigation);

            BindingContext = _feeViewModel;
        }
Ejemplo n.º 2
0
        public IActionResult UpdateFee(int feeupdateid)
        {
            var          feeid = dbc.Fee.Where(q => q.FeeID == feeupdateid).FirstOrDefault();
            FeeViewModel feevm = new FeeViewModel();

            feevm.feeidVM     = feeupdateid;
            feevm.feeamountVM = feeid.FeeAmount;
            return(View(feevm));
        }
Ejemplo n.º 3
0
        public IActionResult SetFee(FeeViewModel feeinfo)
        {
            Fee fee = new Fee();

            fee.FeeAmount = feeinfo.feeamountVM;
            dbc.Fee.Add(fee);
            dbc.SaveChanges();
            ModelState.Clear();
            return(View());
        }
Ejemplo n.º 4
0
        public IActionResult UpdateFee(FeeViewModel feeupdate)
        {
            Fee fee = new Fee();

            fee.FeeID     = feeupdate.feeidVM;
            fee.FeeAmount = feeupdate.feeamountVM;
            dbc.Fee.Update(fee);
            dbc.SaveChanges();
            ModelState.Clear();
            return(RedirectToAction("FeeDetails"));
        }
Ejemplo n.º 5
0
        public JsonNetResult GetFeeById(int Id)
        {
            FeeViewModel Fee = new FeeViewModel();

            Data.Models.Fee objFee = this._feeService.GetForId(Id);
            if (Fee != null)
            {
                Fee.Id        = objFee.Id;
                Fee.Name      = objFee.Name;
                Fee.Frequency = objFee.Frequency.ToString();
                Fee.Amount    = objFee.Amount;
            }
            return(JsonNet(Fee, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        public ActionResult Index()
        {
            string       uid = (string)Session["UserID"];
            FeeViewModel fee = new FeeViewModel();

            fee.FeeUser       = db.V_Fee_Per_User.SingleOrDefault(a => a.trpayment_user_id == uid);
            fee.FeeUserPerJob = db.V_Fee_Per_User_Job.Where(a => a.trpayment_user_id == uid).ToList();
            if (Session["UserID"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            return(View(fee));
        }
Ejemplo n.º 7
0
        public IActionResult FeeDetails()
        {
            int serialno  = 1;
            var fee       = dbc.Fee.ToList();
            var listoffee = new List <FeeViewModel>();

            foreach (var item in fee)
            {
                FeeViewModel feevm = new FeeViewModel();
                feevm.serialnoVM = serialno;
                serialno++;
                feevm.feeidVM     = item.FeeID;
                feevm.feeamountVM = item.FeeAmount;
                listoffee.Add(feevm);
            }
            return(View(listoffee));
        }
Ejemplo n.º 8
0
        // GET: Calculate
        public ActionResult Index()
        {
            FeeViewModel Calculator = new FeeViewModel();

            Calculator.param = new FeeSearchViewModel();
            //populate dropdownlists
            Calculator.param.origins      = PopulateCitiesDropdownlist().ToList();
            Calculator.param.destinations = PopulateCitiesDropdownlist().ToList();
            Calculator.param.packageTypes = PopulatePackageTypesDropdownlist().ToList();
            Calculator.param.serviceTypes = PopulateServiceTypesDropdownlist().ToList();
            Calculator.param.currencies   = PopulateCurrenciesDropdownlist().ToList();
            //Calculator.param.sizes = PopulatePackageTypeSizesDropdownlist().ToList();
            Calculator.packages = new List <FeePackageViewModel>();
            Calculator.packages.Add(new FeePackageViewModel());
            //populate size dropdownlist

            Calculator.param.sizes = PopulatePackageTypeSizesDropdownlist();
            return(View(Calculator));
        }
Ejemplo n.º 9
0
 public IActionResult Payment(FeeViewModel updatefee)
 {
     return(View());
 }
Ejemplo n.º 10
0
        public ActionResult Index([Bind(Include = "packages,origin,destination,serviceType,currencyCode,param")] FeeViewModel Calculator)
        {
            if (ModelState.IsValid)
            {
                decimal exchangeRate = db.Currencies.Where(s => s.CurrencyCode == Calculator.currencyCode).Select(s => s.ExchangeRate).First();
                foreach (FeePackageViewModel package in Calculator.packages)
                {
                    //string limitString = db.PackageTypeSizes.Where(a => a.Description == package.packageType).Select(a => a).First().WeightLimit;
                    int limitString = 30;
                    //package.limit = Int32.Parse(limitString);
                    package.limit  = limitString;
                    package.weight = Math.Round((decimal)package.weight, 1);

                    package.result = db.ServicePackageFees.SingleOrDefault(s => s.PackageType.Type == package.packageType && s.ServiceType.Type == Calculator.serviceType);
                    decimal fee = 0;
                    package.penalty = false;
                    switch (package.result.PackageTypeID)
                    {
                    //Envelope
                    case 1:
                        fee = package.result.Fee;
                        break;

                    //Pak
                    case 2:
                        if (package.weight * package.result.Fee > package.result.MinimumFee)
                        {
                            fee = (decimal)package.weight * package.result.Fee;
                            if (package.weight > package.limit)     //Oversized Packaged
                            {
                                fee            += 500;
                                package.penalty = true;
                            }
                        }
                        else     //Under the minimum weight
                        {
                            fee = package.result.MinimumFee;
                        }
                        break;

                    //Tube
                    case 3:
                        if (package.weight * package.result.Fee > package.result.MinimumFee)
                        {
                            fee = (decimal)package.weight * package.result.Fee;
                        }
                        else
                        {
                            fee = package.result.MinimumFee;
                        }
                        break;

                    //Box
                    case 4:
                        if (package.weight * package.result.Fee > package.result.MinimumFee)
                        {
                            fee = (decimal)package.weight * package.result.Fee;
                            if (package.weight > package.limit)     //Oversized Packaged
                            {
                                fee            += 500;
                                package.penalty = true;
                            }
                        }
                        else     //Under the minimum weight
                        {
                            fee = package.result.MinimumFee;
                        }
                        break;

                    //Customer
                    case 5:
                        if (package.weight * package.result.Fee > package.result.MinimumFee)
                        {
                            fee = (decimal)package.weight * package.result.Fee;
                        }
                        else
                        {
                            fee = package.result.MinimumFee;
                        }
                        break;

                    default:
                        fee = 0;
                        break;
                    }
                    package.fee = fee * exchangeRate;
                }
                return(View("Result", Calculator));
            }

            Calculator.param = new FeeSearchViewModel();
            //populate dropdownlists
            Calculator.param.origins      = PopulateCitiesDropdownlist().ToList();
            Calculator.param.destinations = PopulateCitiesDropdownlist().ToList();
            Calculator.param.packageTypes = PopulatePackageTypesDropdownlist().ToList();
            Calculator.param.serviceTypes = PopulateServiceTypesDropdownlist().ToList();
            Calculator.param.currencies   = PopulateCurrenciesDropdownlist().ToList();
            //Calculator.param.sizes = PopulatePackageTypeSizesDropdownlist().ToList();
            Calculator.param.sizes = PopulatePackageTypeSizesDropdownlist();

            return(View("Index", Calculator));
        }