Exemple #1
0
        public RateHeaderRow(RateType RateType)
        {
            this.RateType = RateType;
            int ColumCount = 0;

            RateHeaderColumns = new List <RateHeaderColumn>();
            CodeListBL CodeListBL = new CodeListBL();

            if (RateType == CDT.RateType.CustomerSellingRate)
            {
                ColumCount = AppConstants.CustomerSellingRateHeaderColumCount;
            }
            if (RateType == CDT.RateType.AirLineBuyingRate)
            {
                ColumCount = AppConstants.AirLineBuyingRateHeaderColumCount;
            }
            if (RateType == CDT.RateType.AgentBuyingRate)
            {
                ColumCount = AppConstants.AgentBuyingRateHeaderColumCount;
            }
            if (RateType == CDT.RateType.IATARate)
            {
                ColumCount = AppConstants.IATARateHeaderColumnCount;
            }

            for (int i = 0; i < ColumCount; i++)
            {
                var col = new RateHeaderColumn(RateType)
                {
                    Id = i + 1
                };
                if (RateType == CDT.RateType.CustomerSellingRate)
                {
                    CreateCustomerSellingRateHeaderColums(RateType, ColumCount, CodeListBL, i, col);
                }
                if (RateType == CDT.RateType.AirLineBuyingRate)
                {
                    CreateAirlineBuyingRateHeaderColums(RateType, ColumCount, CodeListBL, i, col);
                }
                if (RateType == CDT.RateType.AgentBuyingRate)
                {
                    CreateAgentBuyingRateHeaderColums(RateType, ColumCount, CodeListBL, i, col);
                }
                if (RateType == CDT.RateType.IATARate)
                {
                    CreateIATARateHeaderColums(RateType, ColumCount, CodeListBL, i, col);
                }
            }
        }
Exemple #2
0
        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);
        }