public async Task <IActionResult> PutCustomerTypes(int id, CustomerTypes customerTypes)
        {
            if (id != customerTypes.Id || !ModelState.IsValid)
            {
                return(BadRequest());
            }

            _context.Entry(customerTypes).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CustomerTypesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 // Constructors
 public Account(string cName, CustomerTypes cType, decimal balance, decimal iRate)
 {
     this.Customer = cName;
     this.CustomerType = cType;
     this.Balance = balance;
     this.Interest = iRate;
 }
 // Constructors
 public Account(string cName, CustomerTypes cType, decimal balance, decimal iRate)
 {
     this.Customer     = cName;
     this.CustomerType = cType;
     this.Balance      = balance;
     this.Interest     = iRate;
 }
 public Account(CustomerTypes customer, double balance, double interest, string holderName)
 {
     this.Customer = customer;
     this.Balance = balance;
     this.InterestRate = interest;
     this.HolderName = holderName;
     this.month = 0;
 }
Esempio n. 5
0
 /// <summary>
 /// Retrieves customer credentials from Admin resource file
 /// </summary>
 /// <param name="user">The user you wish to retrieve</param>
 /// <returns>The MySpaceUser you specified</returns>
 public static CustomerInformation GetCustomerCredentials(CustomerTypes customerType)
 {
     var cusInfo = new CustomerInformation();
     string[] custCreds = AdminSuite.Common.GetCustomerCredentials(Convert.ToString(customerType));
     cusInfo.MCustomerName = custCreds[0];
     cusInfo.MPassword = custCreds[1];
     return cusInfo;
 }
Esempio n. 6
0
        public List <Models.ExcelPriceList> ImportPrice(DataTable dt)
        {
            List <Models.ExcelPriceList> list = new List <Models.ExcelPriceList>();
            // OfferActionType checkIsExist;
            OfferActionType actionTypes = OfferActionType.Non;
            DateTime        StartDate   = DateTime.Now;
            DateTime        EndDate     = DateTime.Now;

            //Getting the default Margin for reseller
            ViewModel.DefaultMargin.DefaultMarginResellers odjDMR = new DefaultMargin.DefaultMarginResellers();
            Models.DefaultMargin defaultResellerMargin            = odjDMR.GetDefaultMargin();

            //Getting the default Margin for Customer
            ViewModel.DefaultMargin.DefaultMarginUsers odjDMU = new DefaultMargin.DefaultMarginUsers();
            Models.DefaultMargin defaultUserMargin            = odjDMU.GetDefaultMargin();

            foreach (DataRow item in dt.Rows)
            {
                if (item[0].ToString() != "A/C/D/U")
                {
                    if (item[0].ToString() != "")
                    {
                        actionTypes = OfferActionTypes.ParseEnum <OfferActionType>(item[0].ToString()); //item["A/C/D/U"]
                    }
                    if (item[1].ToString() != "")
                    {
                        StartDate = Convert.ToDateTime(item[1].ToString());  //item["Valid-From Date"]
                    }
                    if (item[2].ToString() != "")
                    {
                        EndDate = Convert.ToDateTime(item[2].ToString());                                        //item["Valid To Date"]
                    }
                    AgreementType agreementTypes = AgreementTypes.ParseEnum <AgreementType>(item[5].ToString()); //item["License Agreement Type"]
                    CustomerType  customerTypes  = CustomerTypes.ParseEnum <CustomerType>(item[8].ToString());   //item["End Customer Type"]
                    LicenseType   licenseTypes   = LicenseTypes.ParseEnum <LicenseType>(item[7].ToString());     //item["Secondary License Type"]


                    string[]              unit         = item[6].ToString().Split(' ');//item["Purchase Unit"]
                    PurchaseUnit          purchaseUnit = PurchaseUnits.ParseEnum <PurchaseUnit>(unit[1]);
                    Models.ExcelPriceList _m           = new Models.ExcelPriceList();
                    _m.ActionType         = Convert.ToInt16(actionTypes);
                    _m.AgreementType      = Convert.ToInt16(agreementTypes);
                    _m.CustomerType       = Convert.ToInt16(customerTypes);
                    _m.LicenseType        = Convert.ToInt16(licenseTypes);
                    _m.PurchaseUnitNumber = Convert.ToInt16(unit[0]);
                    _m.PurchaseUnit       = Convert.ToInt16(purchaseUnit);
                    _m.MicrosoftId        = item[4].ToString();//item["Offer ID"]
                    _m.StartDate          = StartDate;
                    _m.EndDate            = EndDate;
                    _m.Price         = float.Parse(item[9].ToString());                                                                                                                                                       //item["List Price"]
                    _m.Name          = item[3].ToString();
                    _m.CustomerPrice = item[10].ToString() != "" && item[10].ToString() != " " ? Convert.ToDouble(item[10].ToString()) : Convert.ToDouble((_m.Price * defaultUserMargin.DefaultPercentage / 100) + _m.Price); //item["ERP Price"]
                    _m.ResellerPrice = 0;                                                                                                                                                                                     //item[11].ToString() != "" && item[11].ToString() != " " ? Convert.ToDouble(item[11].ToString()) : Convert.ToDouble(((_m.Price * defaultResellerMargin.DefaultPercentage / 100) + _m.Price));//item["Reseller Price"]
                    list.Add(_m);
                }
            }
            return(list);
        }
        public async Task <ActionResult <CustomerTypes> > PostCustomerTypes(CustomerTypes customerTypes)
        {
            if (!ModelState.IsValid)
            {
                BadRequest();
            }
            _context.CustomerTypes.Add(customerTypes);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCustomerTypes", new { id = customerTypes.Id }, customerTypes));
        }
Esempio n. 8
0
        private async Task LoadCustomerTypeLookup()
        {
            CustomerTypes.Clear();
            CustomerTypes.Add(new NullLookupItem {
                DisplayMember = "[Not Selected]"
            });

            var lookup = await _customerTypeLookupDataService.GetCustomerTypeLookupAsync();

            foreach (var lookupItem in lookup)
            {
                CustomerTypes.Add(lookupItem);
            }
        }
Esempio n. 9
0
        protected void gridMain_InsertCommand(object source, GridCommandEventArgs e)
        {
            var editableItem = ((GridEditableItem)e.Item);

            using (var dbContext = new OTERTConnStr()) {
                var       custType = new CustomerTypes();
                Hashtable values   = new Hashtable();
                editableItem.ExtractValues(values);
                custType.NameGR = (string)values["NameGR"];
                custType.NameEN = (string)values["NameEN"];
                dbContext.CustomerTypes.Add(custType);
                try { dbContext.SaveChanges(); }
                catch (Exception) { ShowErrorMessage(-1); }
            }
        }
Esempio n. 10
0
 public Customer(
     int customerId,
     CustomerTypes customerType,
     string sSNorEIN,
     string nameOrCompanyName,
     string lastNameOrTradingName,
     DateTime birthDate,
     Address address)
 {
     CustomerId            = customerId;
     CustomerType          = customerType;
     SSNorEIN              = sSNorEIN;
     NameOrCompanyName     = nameOrCompanyName;
     LastNameOrTradingName = lastNameOrTradingName;
     BirthDate             = birthDate;
     Address = address;
 }
Esempio n. 11
0
 public Customer(
     string firstName,
     string middleName,
     string lastName,
     string id,
     string mobilePhone,
     string address,
     string email,
     CustomerTypes customerType)
 {
     this.FirstName    = firstName;
     this.MiddleName   = middleName;
     this.LastName     = lastName;
     this.ID           = id;
     this.MobilePhone  = mobilePhone;
     this.Address      = address;
     this.Email        = email;
     this.CustomerType = customerType;
     this.payments     = new List <IPayment>();
 }
Esempio n. 12
0
        public decimal GetPrice(CustomerTypes customerType, SeatTypes seatType)
        {
            decimal price = 0;

            switch (seatType)
            {
            case SeatTypes.Stalls:
                price = StallPrice;
                break;

            case SeatTypes.Orchestra:
                price = OrchestraPrice;
                break;

            case SeatTypes.Back:
                price = BackPrice;
                break;
            }

            switch (customerType)
            {
            case CustomerTypes.Adult:
                price = price - price * (decimal)AdultDiscount / 100.0m;
                break;

            case CustomerTypes.Child:
                price = price - price * (decimal)ChildDiscount / 100.0m;
                break;

            case CustomerTypes.Senior:
                price = price - price * (decimal)SeniorDiscount / 100.0m;
                break;

            case CustomerTypes.Student:
                price = price - price * (decimal)StudentDiscount / 100.0m;
                break;
            }

            return(price);
        }
Esempio n. 13
0
        private int SetContractorId(CustomerTypes contractor, int shipperId, int consigneeId, int?notify1Id, int?notify2Id)
        {
            int contractId = 0;

            switch (contractor)
            {
            case CustomerTypes.Shipper:
                contractId = shipperId;
                break;

            case CustomerTypes.Consignee:
                contractId = consigneeId;
                break;

            case CustomerTypes.Notify1:
                contractId = notify1Id.Value;
                break;

            case CustomerTypes.Notify2:
                contractId = notify2Id.Value;
                break;
            }
            return(contractId);
        }
Esempio n. 14
0
        private void OpenModuleDetail(int moduleDetailID)
        {
            if (moduleDetailID > 0)
            {
                Form openingView = null;//Form to open

                for (int i = 0; i < this.MdiChildren.Length; i++)
                {//Find and active the current form
                    IToolstripChild mdiChildCallToolStrip = this.MdiChildren[i] as IToolstripChild;
                    if (mdiChildCallToolStrip != null)
                    {
                        if (moduleDetailID == (int)mdiChildCallToolStrip.NMVNTaskID)
                        {
                            openingView = (Form)this.MdiChildren[i];
                            break;
                        }
                    }
                }

                if (openingView != null)
                {
                    openingView.Activate();
                    IToolstripChild mdiChildCallToolStrip = openingView as IToolstripChild;
                    if (mdiChildCallToolStrip != null)
                    {
                        mdiChildCallToolStrip.DoAfterActivate();
                    }
                }
                else
                { //OPEN NEW VIEW
                    switch (moduleDetailID)
                    {
                    case (int)GlobalEnums.NmvnTaskID.Customers:
                        openingView = new Customers();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.CustomerTypes:
                        openingView = new CustomerTypes();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.CustomerCategories:
                        openingView = new CustomerCategories();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Commodities:
                        openingView = new Commodities();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.CommoditySettings:
                        openingView = new CommoditySettings();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.CommodityTypes:
                        openingView = new CommodityTypes();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.CommodityCategories:
                        openingView = new CommodityCategories();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.BinLocations:
                        openingView = new BinLocations();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Teams:
                        openingView = new Teams();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Territories:
                        openingView = new Territories();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Warehouses:
                        openingView = new Warehouses();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Employees:
                        openingView = new Employees();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Pickups:
                        openingView = new Pickups();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.GoodsReceipts:
                        openingView = new GoodsReceipts();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Forecasts:
                        openingView = new Forecasts();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.SalesOrders:
                        openingView = new SalesOrders();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.DeliveryAdvices:
                        openingView = new DeliveryAdvices();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.TransferOrders:
                        openingView = new TransferOrders();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.GoodsIssues:
                        openingView = new GoodsIssues();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.WarehouseAdjustments:
                        openingView = new WarehouseAdjustments();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.AvailableItems:
                        openingView = new GoodsReceiptDetailAvailables();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.PendingOrders:
                        openingView = new PendingOrders();
                        break;

                    case (int)GlobalEnums.NmvnTaskID.Reports:
                        openingView = new Reports();
                        break;

                    default:
                        openingView = new BlankView();
                        break;
                    }

                    if (openingView != null)
                    {
                        this.OpenView(openingView);
                    }
                }

                if (!this.naviBarModuleMaster.Collapsed)
                {
                    buttonNaviBarHeader_Click(this.buttonNaviBarHeader, new EventArgs());
                }
            }
        }
 // Constructors
 public MortgageAccount(string cName, CustomerTypes cType, decimal balance, decimal iRate)
     : base(cName, cType, balance, iRate)
 {
     this.accType = AccountTypes.mortgage;
 }
Esempio n. 16
0
        //For Reseller
        public List <Models.GridPriceList> GetForReseller(int Id)
        {
            try
            {
                var db    = new Context.ConnectionStringsContext();
                var query = (from p in db.MicrosoftPriceList
                                                    //join rp in db.ResellerPrice
                                                    //on p.MicrosoftId equals rp.MicrosoftId
                                                    //into rps
                                                    //from rp in rps.DefaultIfEmpty()
                             where p.Status == true //&& rp.ResellerId == Id
                             group p by p.MicrosoftId into op
                             select new
                {
                    MicrosoftId = op.Key,
                    Name = op.Max(x => x.Name),
                    StartDate = op.Max(x => x.StartDate),
                    EndDate = op.Max(x => x.EndDate),
                    Price = op.Max(x => x.Price),
                    ResellerPrice = db.ResellerPrice.Any(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == Id && m.Status == true) ?
                                    db.ResellerPrice.Where(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == Id && m.Status == true).OrderByDescending(m => m.Id).FirstOrDefault().Price :
                                    (db.ResellerCustomersPrice.Any(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0 && m.ResellerPrice != null))
                                                 ? db.ResellerCustomersPrice.Where(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0).OrderByDescending(m => m.Id).FirstOrDefault().ResellerPrice : 0,
                    CustomerPrice = (db.CustomerPrice.Any(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == Id))
                                                    ? (db.CustomerPrice.Where(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == Id)).OrderByDescending(m => m.Id).FirstOrDefault().Price
                                                    : (db.ResellerCustomersPrice.Any(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == Id && m.CustomerPrice != null)) ?
                                    db.ResellerCustomersPrice.Where(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == Id).OrderByDescending(m => m.Id).FirstOrDefault().CustomerPrice
                                                    : op.Max(x => x.CustomerPrice),
                    AgreementType = op.Max(x => x.AgreementType),
                    CustomerType = op.Max(x => x.CustomerType),
                    LicenseType = op.Max(x => x.LicenseType),
                    PurchaseUnit = op.Max(x => x.PurchaseUnit),
                    PurchaseUnitNumber = op.Max(x => x.PurchaseUnitNumber),
                    Id = op.Max(x => x.Id),
                    DefaultMarginReseller = db.Resellers.Where(m => m.Id == Id).FirstOrDefault().Margin                //get the margin from reseller table
                }).ToList();



                List <Models.GridPriceList> mic = query.ToList().Select(r => new Models.GridPriceList
                {
                    EndDate     = r.EndDate,
                    Id          = r.Id,
                    MicrosoftId = r.MicrosoftId,
                    Name        = r.Name,
                    StartDate   = r.StartDate,
                    // Date = r.StartDate.Date + "<br/> "+r.EndDate.Date,
                    Price                   = r.Price,
                    AgreementType           = AgreementTypes.ParseEnumToString <AgreementType>(r.AgreementType),
                    CustomerType            = CustomerTypes.ParseEnumToString <CustomerType>(r.CustomerType),
                    LicenseType             = LicenseTypes.ParseEnumToString <LicenseType>(r.LicenseType),
                    ResellerPrice           = (double)r.ResellerPrice != 0 ? (double)r.ResellerPrice : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100),
                    ResellerPricePercentage = ((double)System.Math.Round(((double)((((double)r.ResellerPrice != 0 ?
                                                                                     (double)r.ResellerPrice
                    : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100)) - r.Price) * 100) / r.Price), 2)).ToString(),
                    //((double)System.Math.Round(((double)((((double)r.ResellerPrice != 0 ? (double)r.ResellerPrice : (r.CustomerPrice - (r.CustomerPrice * r.DefaultMarginReseller) / 100)) - r.Price) * 100) / r.Price), 2)).ToString(),
                    CustomerPrice           = r.CustomerPrice,
                    CustomerPricePercentage = ((double)System.Math.Round((((r.CustomerPrice - ((double)r.ResellerPrice != 0 ? (double)r.ResellerPrice : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100))) * 100) / ((double)r.ResellerPrice != 0 ? (double)r.ResellerPrice : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100))), 2)).ToString(),
                    PurchaseUnit            = r.PurchaseUnitNumber + " " + PurchaseUnits.ParseEnumToString <PurchaseUnit>(r.PurchaseUnit),
                    //PurchaseUnitNumber = r.PurchaseUnitNumber,
                    DefaultMarginReseller = (double)r.ResellerPrice != 0 ?

                                            ((double)((

                                                          ((double)System.Math.Round((((r.CustomerPrice - r.Price) * 100) / r.Price), 2))
                                                          -
                                                          ((double)System.Math.Round(((double)((((double)r.ResellerPrice != 0 ?
                                                                                                 (double)r.ResellerPrice
                    : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100)) - r.Price) * 100) / r.Price), 2)))
                                                      * 100
                                                      )
                                             / ((double)(((double)System.Math.Round((((r.CustomerPrice - r.Price) * 100) / r.Price), 2))))
                                            ).ToString()
                    : r.DefaultMarginReseller.ToString()
                }).OrderBy(m => m.Name).ToList();

                return(mic);
            }
            catch
            {
                return(new List <Models.GridPriceList>());
            }
        }
 public Account(decimal balance, double interestRate, CustomerTypes customer)
 {
     this.Balance      = balance;
     this.InterestRate = interestRate;
     this.Customer     = customer;
 }
Esempio n. 18
0
 public CustomerType(CustomerTypes customerType, int?displayOrder)
 {
     CustomerTypeID = customerType;
     DisplayOrder   = displayOrder;
 }
Esempio n. 19
0
 public MortgageAccounts(decimal balance, double interestRate, CustomerTypes customer)
     : base(balance, interestRate, customer)
 {
 }
 public Account(decimal balance, double interestRate, CustomerTypes customer)
 {
     this.Balance = balance;
     this.InterestRate = interestRate;
     this.Customer = customer;
 }
 public DepositAccounts(decimal balance, double interestRate, CustomerTypes customer)
     : base(balance, interestRate, customer)
 {
 }
Esempio n. 22
0
        //For Admin (Overall price list => ResellerPrice > MicrosoftPriceList)
        public List <Models.GridPriceList> GetGridPriceListForAdmin()
        {
            //IEnumerable<MicrosoftOffer> microsoftOffers = await ApplicationDomain.Instance.OffersRepository.RetrieveMicrosoftOffersAsync().ConfigureAwait(false);
            try
            {
                var db    = new Context.ConnectionStringsContext();
                var query = (from p in db.MicrosoftPriceList
                             // join
                             where p.Status == true
                             group p by p.MicrosoftId into op
                             select new
                {
                    MicrosoftId = op.Key,
                    Name = op.Max(x => x.Name),
                    StartDate = op.Max(x => x.StartDate),
                    EndDate = op.Max(x => x.EndDate),
                    Price = op.Max(x => x.Price),
                    ResellerPrice = (db.ResellerCustomersPrice.Any(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0 && m.ResellerPrice != null))
                                                 ? db.ResellerCustomersPrice.Where(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0).OrderByDescending(m => m.Id).FirstOrDefault().ResellerPrice
                                                 : 0,
                    //op.Max(x => x.CustomerPrice) - (op.Max(x => x.CustomerPrice) * (db.DefaultMargin.Where(m => m.ResellerId == 0 && m.Role == (int)Roles.Resellers).FirstOrDefault().DefaultPercentage)) / 100,

                    //ResellerPrice = (db.ResellerCustomersPrice.Any(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0 && m.ResellerPrice != null)) ?
                    //               db.ResellerCustomersPrice.Where(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0).FirstOrDefault().ResellerPrice
                    //               : op.Max(x => x.ResellerPrice),
                    CustomerPrice = (db.ResellerCustomersPrice.Any(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0 && m.CustomerPrice != null)) ?
                                    db.ResellerCustomersPrice.Where(m => m.PriceId == op.Max(x => x.Id) && m.ResellerId == 0).OrderByDescending(m => m.Id).FirstOrDefault().CustomerPrice
                                                : op.Max(x => x.CustomerPrice),
                    AgreementType = op.Max(x => x.AgreementType),
                    CustomerType = op.Max(x => x.CustomerType),
                    LicenseType = op.Max(x => x.LicenseType),
                    PurchaseUnit = op.Max(x => x.PurchaseUnit),
                    PurchaseUnitNumber = op.Max(x => x.PurchaseUnitNumber),
                    Id = op.Max(x => x.Id),
                    DefaultMarginReseller = db.DefaultMargin.Where(m => m.ResellerId == 0 && m.Role == (int)Roles.Resellers).FirstOrDefault().DefaultPercentage
                }).ToList();



                List <Models.GridPriceList> mic = query.ToList().Select(r => new Models.GridPriceList
                {
                    EndDate     = r.EndDate,
                    Id          = r.Id,
                    MicrosoftId = r.MicrosoftId,
                    Name        = r.Name,
                    StartDate   = r.StartDate,
                    // Date = r.StartDate.Date + "<br/> "+r.EndDate.Date,
                    Price                   = r.Price,
                    AgreementType           = AgreementTypes.ParseEnumToString <AgreementType>(r.AgreementType),
                    CustomerType            = CustomerTypes.ParseEnumToString <CustomerType>(r.CustomerType),
                    LicenseType             = LicenseTypes.ParseEnumToString <LicenseType>(r.LicenseType),
                    ResellerPrice           = (double)r.ResellerPrice != 0 ? (double)r.ResellerPrice : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100),
                    ResellerPricePercentage = ((double)System.Math.Round(((double)(((
                                                                                        (double)r.ResellerPrice != 0
                    ? (double)r.ResellerPrice
                    : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100)
                                                                                        ) - r.Price) * 100) / r.Price), 2)).ToString(),
                    //ResellerPrice = (double)r.ResellerPrice != 0 ? (double)r.ResellerPrice : (r.CustomerPrice - (r.CustomerPrice * r.DefaultMarginReseller) / 100),
                    //ResellerPricePercentage = ((double)System.Math.Round(((double)((((double)r.ResellerPrice != 0 ? (double)r.ResellerPrice : (r.CustomerPrice - (r.CustomerPrice * r.DefaultMarginReseller) / 100)) - r.Price) * 100) / r.Price), 2)).ToString(),
                    CustomerPrice           = r.CustomerPrice,
                    CustomerPricePercentage = ((double)System.Math.Round((((r.CustomerPrice - r.Price) * 100) / r.Price), 2)).ToString(),
                    PurchaseUnit            = r.PurchaseUnitNumber + " " + PurchaseUnits.ParseEnumToString <PurchaseUnit>(r.PurchaseUnit),
                    //PurchaseUnitNumber = r.PurchaseUnitNumber,
                    DefaultMarginReseller = (double)r.ResellerPrice != 0 ?

                                            ((double)((

                                                          ((double)System.Math.Round((((r.CustomerPrice - r.Price) * 100) / r.Price), 2))
                                                          -
                                                          ((double)System.Math.Round(((double)((((double)r.ResellerPrice != 0 ?
                                                                                                 (double)r.ResellerPrice
                    : (r.Price + ((r.CustomerPrice - r.Price) * r.DefaultMarginReseller) / 100)) - r.Price) * 100) / r.Price), 2)))
                                                      * 100
                                                      )
                                             / ((double)(((double)System.Math.Round((((r.CustomerPrice - r.Price) * 100) / r.Price), 2))))
                                            ).ToString()
                    : r.DefaultMarginReseller.ToString()
                }).OrderBy(m => m.Name).ToList();

                return(mic);
            }
            catch (Exception ex)
            {
                return(new List <Models.GridPriceList>());
            }
        }
 public Customer(string name, CustomerTypes customerTypes, PaymentMethods paymentMethods)
 {
     Name           = name;
     TypeOfCustomer = customerTypes;
     PayMethod      = paymentMethods;
 }
        public MortgageAccounts(decimal balance, double interestRate, CustomerTypes customer)
            : base(balance, interestRate, customer)
        {

        }
 // Constructors
 public LoanAccount(string cName, CustomerTypes cType, decimal balance, decimal iRate)
     : base(cName, cType, balance, iRate)
 {
     this.accType = AccountTypes.loan;
 }
 // Constructors
 public DepositAccount(string cName, CustomerTypes cType, decimal balance, decimal iRate)
     : base(cName, cType, balance, iRate)
 {
     this.accType = AccountTypes.deposit;
 }
Esempio n. 27
0
 // Constructors
 public LoanAccount(string cName, CustomerTypes cType, decimal balance, decimal iRate)
     : base(cName, cType, balance, iRate)
 {
     this.accType = AccountTypes.loan;
 }
        public DepositAccounts(decimal balance, double interestRate, CustomerTypes customer)
            : base(balance, interestRate, customer)
        {

        }
 // Constructors
 public MortgageAccount(string cName, CustomerTypes cType, decimal balance, decimal iRate)
     : base(cName, cType, balance, iRate)
 {
     this.accType = AccountTypes.mortgage;
 }
Esempio n. 30
0
 public LoanAcc(CustomerTypes customer, double balance, double interest, string holder)
     : base(customer, balance, interest, holder)
 {
 }
 // Constructors
 public DepositAccount(string cName, CustomerTypes cType, decimal balance, decimal iRate)
     : base(cName, cType, balance, iRate)
 {
     this.accType = AccountTypes.deposit;
 }
Esempio n. 32
0
 public Customer(string userName, string password, string fullName, string email, UserTypes userType, CustomerTypes customerType, string address, string[] allowedModules) : base(userName, password, fullName, email, userType, allowedModules)
 {
     CustomerType = customerType;
     Address      = address;
 }