示例#1
0
 public ProductsController(ProductCategoriesBL productCategoriesBL,
                           ProductsBL productsBL, BrandsBL brandsBL, CountriesBL countriesBL,
                           ContentContentTypesBL contentContentTypesBL, ProductPhotosBL productPhotosBL,
                           CurrenciesBL currenciesBL)
 {
     _productCategoriesBL   = productCategoriesBL;
     _productsBL            = productsBL;
     _brandsBL              = brandsBL;
     _countriesBL           = countriesBL;
     _contentContentTypesBL = contentContentTypesBL;
     _productPhotosBL       = productPhotosBL;
     _currenciesBL          = currenciesBL;
 }
 private void BindCurrency()
 {
     CurrenciesBL currencyBL = new CurrenciesBL();
     ddlAddCurrency.DataSource = currencyBL.GetCurrency();
     ddlAddCurrency.DataValueField = "Currancy";
     ddlAddCurrency.DataTextField = "Currancy";
     ddlAddCurrency.DataBind();
 }
        protected void grdLoans_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            DataTable data = new DataTable();

            switch (e.Column.DataField)
            {
                case "CodeName":
                    data.Columns.Add("CodeName");
                    LoansBLL loansBLL = new LoansBLL();
                    List<Loans> loans = loansBLL.GetLoans();

                    for (int i = 0; i <= loans.Count - 1; i++)
                    {
                        data.Rows.Add(loans[i].CodeName);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "CodeName";
                    e.ListBox.DataTextField = "CodeName";
                    e.ListBox.DataValueField = "CodeName";
                    e.ListBox.DataBind();

                    break;
                case "Borrower":
                    data = new DataTable();
                    data.Columns.Add("Borrower");

                    BorrowersBL borrowerBL = new BorrowersBL();
                    List<Borrower> borrower = borrowerBL.GetBorrowers();
                    for (int i = 0; i < borrower.Count - 1; i++)
                    {
                        data.Rows.Add(borrower[i].Name);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "Borrower";
                    e.ListBox.DataTextField = "Borrower";
                    e.ListBox.DataValueField = "Borrower";
                    e.ListBox.DataBind();
                    break;
                case "Country":
                    data = new DataTable();
                    data.Columns.Add("Country");

                    CountryBL CountryBL = new CountryBL();
                    List<tblCountry> country = CountryBL.GetCountry();
                    for (int i = 0; i < country.Count - 1; i++)
                    {
                        data.Rows.Add(country[i].Name);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "Country";
                    e.ListBox.DataTextField = "Country";
                    e.ListBox.DataValueField = "Country";
                    e.ListBox.DataBind();
                    break;
                case "CreditRating":
                    data = new DataTable();
                    data.Columns.Add("CreditRating");

                    CreditRatingsBL CreditRatingsBL = new CreditRatingsBL();
                    List<CreditRating> CreditRating = CreditRatingsBL.GetRatings();
                    for (int i = 0; i < CreditRating.Count - 1; i++)
                    {
                        data.Rows.Add(CreditRating[i].Rating);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "CreditRating";
                    e.ListBox.DataTextField = "CreditRating";
                    e.ListBox.DataValueField = "CreditRating";
                    e.ListBox.DataBind();
                    break;
                case "Sector":
                    data = new DataTable();
                    data.Columns.Add("Sector");

                    LoansBLL loansBll = new LoansBLL();
                    List<Sectors> sector = loansBll.GetSector();

                    for (int i = 0; i < sector.Count; i++)
                    {
                        if (sector[i] != null)
                        {
                            data.Rows.Add(sector[i].Sector);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "Sector";
                    e.ListBox.DataTextField = "Sector";
                    e.ListBox.DataValueField = "Sector";
                    e.ListBox.DataBind();
                    break;
                case "PP":
                    data = new DataTable();
                    data.Columns.Add("PP");

                    loansBll = new LoansBLL();
                    List<PP> pp = loansBll.GetPP();

                    for (int i = 0; i < pp.Count; i++)
                    {
                        if (pp[i] != null)
                        {
                            data.Rows.Add(pp[i].pp);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "PP";
                    e.ListBox.DataTextField = "PP";
                    e.ListBox.DataValueField = "PP";
                    e.ListBox.DataBind();
                    break;
                case "FixedOrFloating":
                    data = new DataTable();
                    data.Columns.Add("FixedOrFloating");

                    loansBll = new LoansBLL();
                    List<BLL.FixedOrFloating> fof = loansBll.GetFixedFloating();

                    for (int i = 0; i < fof.Count; i++)
                    {
                        if (fof[i] != null)
                        {
                            data.Rows.Add(fof[i].fixedorfloating);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "FixedOrFloating";
                    e.ListBox.DataTextField = "FixedOrFloating";
                    e.ListBox.DataValueField = "FixedOrFloating";
                    e.ListBox.DataBind();
                    break;
                case "Notional":
                    data = new DataTable();
                    data.Columns.Add("Notional");

                    loansBll = new LoansBLL();
                    List<BLL.Notional> notional = loansBll.GetNotional();

                    for (int i = 0; i < notional.Count; i++)
                    {
                        if (notional[i] != null)
                        {
                            data.Rows.Add(notional[i].notional);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "Notional";
                    e.ListBox.DataTextField = "Notional";
                    e.ListBox.DataValueField = "Notional";
                    e.ListBox.DataBind();
                    break;
                case "Margin":
                    data = new DataTable();
                    data.Columns.Add("Margin");

                    loansBll = new LoansBLL();
                    List<BLL.Margin> margin = loansBll.GetMargin();

                    for (int i = 0; i < margin.Count; i++)
                    {
                        if (margin[i] != null)
                        {
                            data.Rows.Add(margin[i].margin);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "Margin";
                    e.ListBox.DataTextField = "Margin";
                    e.ListBox.DataValueField = "Margin";
                    e.ListBox.DataBind();
                    break;
                case "Currency":
                    data = new DataTable();
                    data.Columns.Add("Currency");

                    CurrenciesBL currencyBL = new CurrenciesBL();
                    List<Currency> currency = currencyBL.GetCurrency();

                    for (int i = 0; i < currency.Count; i++)
                    {
                        if (currency[i].Currancy != null)
                        {
                            data.Rows.Add(currency[i].Currancy);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "Currency";
                    e.ListBox.DataTextField = "Currency";
                    e.ListBox.DataValueField = "Currency";
                    e.ListBox.DataBind();
                    break;
                case "CouponFrequency":
                    data = new DataTable();
                    data.Columns.Add("CouponFrequency");

                    loansBll = new LoansBLL();
                    List<BLL.CouponFrequency> couponFreq = loansBll.GetCouponFrequency();

                    for (int i = 0; i < couponFreq.Count; i++)
                    {
                        if (couponFreq[i] != null)
                        {
                            data.Rows.Add(couponFreq[i].coupon);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "CouponFrequency";
                    e.ListBox.DataTextField = "CouponFrequency";
                    e.ListBox.DataValueField = "CouponFrequency";
                    e.ListBox.DataBind();
                    break;
                case "FacilitySize":
                    data = new DataTable();
                    data.Columns.Add("FacilitySize");

                    loansBll = new LoansBLL();
                    List<BLL.FacilitySize> facility = loansBll.GetFacilitySize();

                    for (int i = 0; i < facility.Count; i++)
                    {
                        if (facility[i] != null)
                        {
                            data.Rows.Add(facility[i].facility);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "FacilitySize";
                    e.ListBox.DataTextField = "FacilitySize";
                    e.ListBox.DataValueField = "FacilitySize";
                    e.ListBox.DataBind();
                    break;
                case "CreditRatingModys":
                    data = new DataTable();
                    data.Columns.Add("CreditRatings");

                    loansBll = new LoansBLL();

                    List<CreditRating> creditRatingModdys = loansBll.GetCreditRatingModdys();
                    for (int i = 0; i < creditRatingModdys.Count; i++)
                    {
                        data.Rows.Add(creditRatingModdys[i].Rating);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "CreditRatings";
                    e.ListBox.DataTextField = "CreditRatings";
                    e.ListBox.DataValueField = "CreditRatings";
                    e.ListBox.DataBind();

                    break;
                case "CreditRatingSPs":
                    data = new DataTable();
                    data.Columns.Add("CreditRatings");

                    loansBll = new LoansBLL();

                    List<CreditRating> creditRatingSPs = loansBll.GetCreditRatingSP();
                    for (int i = 0; i < creditRatingSPs.Count; i++)
                    {
                        data.Rows.Add(creditRatingSPs[i].Rating);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "CreditRatings";
                    e.ListBox.DataTextField = "CreditRatings";
                    e.ListBox.DataValueField = "CreditRatings";
                    e.ListBox.DataBind();

                    break;
                case "CreditRatingFitch":
                    data = new DataTable();
                    data.Columns.Add("CreditRatings");

                    loansBll = new LoansBLL();

                    List<CreditRating> creditRatingFitch = loansBll.GetCreditRatingFitch();
                    for (int i = 0; i < creditRatingFitch.Count; i++)
                    {
                        data.Rows.Add(creditRatingFitch[i].Rating);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "CreditRatings";
                    e.ListBox.DataTextField = "CreditRatings";
                    e.ListBox.DataValueField = "CreditRatings";
                    e.ListBox.DataBind();

                    break;
                case "CreditRatingING":
                    data = new DataTable();
                    data.Columns.Add("CreditRatings");

                    loansBll = new LoansBLL();

                    List<CreditRating> creditRatingING = loansBll.GetCreditRatingING();
                    for (int i = 0; i < creditRatingING.Count; i++)
                    {
                        data.Rows.Add(creditRatingING[i].Rating);
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "CreditRatings";
                    e.ListBox.DataTextField = "CreditRatings";
                    e.ListBox.DataValueField = "CreditRatings";
                    e.ListBox.DataBind();

                    break;
                //case "NoOfAmortisation":
                //    data = new DataTable();
                //    data.Columns.Add("NoOfAmortrization");

                //    loansBll = new LoansBLL();
                //    List<BLL.NoOfAmortrization> noOfAmort = loansBll.GetNoOfAmortrization();

                //    for (int i = 0; i < noOfAmort.Count; i++)
                //    {
                //        if (noOfAmort[i] != null)
                //        {
                //            data.Rows.Add(noOfAmort[i].noofAmort);
                //        }
                //    }

                //    e.ListBox.DataSource = data;
                //    e.ListBox.DataKeyField = "noofAmort";
                //    e.ListBox.DataTextField = "noofAmort";
                //    e.ListBox.DataValueField = "noofAmort";
                //    e.ListBox.DataBind();
                //    break;
                case "StructureID":
                    data = new DataTable();
                    data.Columns.Add("StructureID");

                    loansBll = new LoansBLL();
                    List<BLL.StructureID> structure = loansBll.GetStructureID();

                    for (int i = 0; i < structure.Count; i++)
                    {
                        if (structure[i] != null)
                        {
                            data.Rows.Add(structure[i].structureID);
                        }
                    }

                    e.ListBox.DataSource = data;
                    e.ListBox.DataKeyField = "StructureID";
                    e.ListBox.DataTextField = "StructureID";
                    e.ListBox.DataValueField = "StructureID";
                    e.ListBox.DataBind();
                    break;
                default:
                    break;
            }

            //// sector

            //data = new DataTable();
            //data.Columns.Add("CreditRating");

            //CreditRatingsBL CreditRatingsBL = new CreditRatingsBL();
            //List<CreditRating> CreditRating = CreditRatingsBL.GetRatings();
            //for (int i = 0; i < CreditRating.Count - 1; i++)
            //{
            //    data.Rows.Add(CreditRating[i].Rating);
            //}

            //e.ListBox.DataSource = data;
            //e.ListBox.DataKeyField = "CreditRating";
            //e.ListBox.DataTextField = "CreditRating";
            //e.ListBox.DataValueField = "CreditRating";
            //e.ListBox.DataBind();
        }
示例#4
0
 public CurrenciesController(CurrenciesBL currenciesBL)
 {
     _currenciesBL = currenciesBL;
 }
示例#5
0
 public CurrencyRatesController(CurrencyRatesBL currencyRatesBL, CurrenciesBL currenciesBL)
 {
     _currencyRatesBL = currencyRatesBL;
     _currenciesBL    = currenciesBL;
 }
        protected void btnCurrencySave_Click(object sender, EventArgs e)
        {
            Currency model = new Currency();
            CurrenciesBL bl = new CurrenciesBL();
            if (txtCurrency.Text.Trim() == string.Empty)
            {
                RadWindowManager1.RadAlert("Name is required", 330, 180, "realedge associates", "alertCallBackFn"); return;
            }
            else
            {
                model.Currancy = txtCurrency.Text.Trim();
                if (!string.IsNullOrEmpty(hdnCurrency.Value))
                {
                    model.ID = Convert.ToInt32(hdnCurrency.Value);
                    LogActivity("Currency Updated", "Currency has been updated", string.Empty);
                }
                else
                {
                    LogActivity("Currency Created", "Currency has been created", string.Empty);
                }

                string str = bl.SaveCurrency(model);
                BindCurrencies();
                if (str != "Entry of the same Name is already exists.")
                {
                    hdnBorrower.Value = string.Empty;
                }

                RadWindowManager1.RadAlert(str, 330, 180, "realedge associates", "alertCallBackFn");
            }
        }
 private void BindCurrencies()
 {
     CurrenciesBL bl = new CurrenciesBL();
     grdCurrency.DataSource = bl.GetCurrency().OrderBy(c => c.Currancy).ToList();
     grdCurrency.DataBind();
 }
        protected void grdCurrency_ItemCommand(object sender, GridCommandEventArgs e)
        {
            CurrenciesBL bll = new CurrenciesBL();
            if (e.CommandName == "RemoveCurrency")
            {
                int id = Convert.ToInt32(e.CommandArgument);
                bll.Delete(id);
                BindCurrencies();
                LogActivity("Currency Removed", "Currency has been removed", string.Empty);
            }
            else if (e.CommandName == "EditCurrency")
            {
                int id = Convert.ToInt32(e.CommandArgument);
                Currency model = bll.GetByID(id);
                txtCurrency.Text = model.Currancy;
                hdnCurrency.Value = model.ID.ToString();

            }

            BindCurrencies();
        }
示例#9
0
 public CurrenciesController(CurrenciesBL currenciesBL, CountriesBL countriesBL)
 {
     _currenciesBL = currenciesBL;
     _countriesBL  = countriesBL;
 }