public RateRow(RateType RateType, int ColumCount) { this.RateType = RateType; Columns = new List <RateColumn>(); CodeListBL CodeListBL = new CodeListBL(); for (int i = 0; i < ColumCount; i++) { var col = new RateColumn(RateType) { Id = i + 1 }; if (i == 0) { col.IsDropDown = true; col.DropDownType = ColumnDropDownType.Carrier; var list = CodeListBL.GetCarrierList(); foreach (var item in list) { col.DropDownItems.Add(new SelectListItem() { Text = item.Text, Value = item.Value }); } } if (i == 1 || i == 2) { col.IsDropDown = true; col.DropDownType = ColumnDropDownType.Port; var list = CodeListBL.GetPortList(); foreach (var item in list) { col.DropDownItems.Add(new SelectListItem() { Text = item.Text, Value = item.Value }); } } if (i == 3) { col.IsDropDown = true; } Columns.Add(col); } }
private void CreateCustomerSellingRateHeaderColums(RateType RateType, int ColumCount, CodeListBL CodeListBL, int i, RateHeaderColumn col) { col.Text = ""; col.Value = ""; if (i == 0) { col.IsDropDown = true; col.DropDownType = ColumnDropDownType.Customer; } if (i == 3) { col.IsDropDown = true; col.DropDownType = ColumnDropDownType.Unit; col.DropDownItems.Add(new SelectListItem() { Text = "LB", Value = "L" }); col.DropDownItems.Add(new SelectListItem() { Text = "KG", Value = "K" }); } if (i == 1 || i == 2) { col.IsDropDown = true; col.DropDownType = ColumnDropDownType.Port; var list = CodeListBL.GetPortList(); foreach (var item in list) { col.DropDownItems.Add(new SelectListItem() { Text = item.Text, Value = item.Value }); } } if (i == 4) { col.IsMin = true; } if (i == ColumCount - 1) { col.IsProfitShare = true; } col.RateType = RateType; RateHeaderColumns.Add(col); }