Exemplo n.º 1
0
 public static FareCategory GetCategoryByName(string categoryName)
 {
     OQL oql = new OQL(typeof(FareCategory));
      if (!string.IsNullOrEmpty(categoryName))
          oql.AddCondition(Condition.Eq(FareCategory.Properties.CategoryName, categoryName.Trim()));
      FareCategoryList list = new FareCategory().GetList(oql);
      if (list.Count == 1)
          return list[0];
      else if (list.Count > 1)
          throw new Exception("Duplicate Fare Category found.");
      else
          return null;
 }
Exemplo n.º 2
0
 public FareCategoryDto(FareCategory fareCategory)
 {
     _CategoryId = fareCategory.ID;
     _CategoryName = fareCategory.CategoryName;
 }
Exemplo n.º 3
0
 private void BindFareCategory()
 {
     FareCategory fc = new FareCategory();
     FareCategoryList fclist = fc.GetAllList();
     this.ddlFareCategory.DataSource = fclist;
     this.ddlFareCategory.DataTextField = "CategoryName";
     this.ddlFareCategory.DataValueField = "ID";
     this.ddlFareCategory.DataBind();
     this.ddlFareCategory.Items.Insert(0, new ListItem("-- Show All --", "0"));
 }