示例#1
0
    protected void Page_Init(object sender, EventArgs e)
    {
        // Naviagtor assigned
        //WebNavBar1.GridID = UltraWebGrid1.UniqueID;

        // FreightEasyData Initialized
        FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData();
        feData.AddToDataSet("Ports", "SELECT port_code + ' - ' + port_desc as port_name,port_code FROM port WHERE elt_account_number=" + elt_account_number + " AND ISNULL(port_id,'')<>'' ORDER BY port_desc");
        feData.AddToDataSet("Countries", "SELECT * FROM country_code WHERE elt_account_number=" + elt_account_number + " order by country_name");
        feData.AddToDataSet("MOT", "SELECT code_id,code_desc FROM aes_codes WHERE code_type='Transport Code' ORDER BY code_id");
        feData.AddToDataSet("Carriers", "SELECT ISNULL(carrier_id,'') AS carrier_code,LEFT(dba_name,22) AS carrier_name FROM organization WHERE is_carrier='Y' AND ISNULL(carrier_id,'') <> '' AND ISNULL(carrier_code,'')<>'' AND elt_account_number=" + elt_account_number + " ORDER BY dba_name");

        // Form initialize
        POE.DataSource     = feData.Tables["Ports"];
        POE.DataTextField  = "port_name";
        POE.DataValueField = "port_code";
        POE.DataBind();
        POE.Items.Insert(0, new ListItem("", ""));

        POU.DataSource     = feData.Tables["Ports"];
        POU.DataTextField  = "port_name";
        POU.DataValueField = "port_code";
        POU.DataBind();
        POU.Items.Insert(0, new ListItem("", ""));

        COD.DataSource     = feData.Tables["Countries"];
        COD.DataTextField  = "country_name";
        COD.DataValueField = "country_code";
        COD.DataBind();
        COD.Items.Insert(0, new ListItem("", ""));

        MOT.DataSource     = feData.Tables["MOT"];
        MOT.DataTextField  = "code_desc";
        MOT.DataValueField = "code_id";
        MOT.DataBind();
        MOT.Items.Insert(0, new ListItem("", ""));

        lstCarrier.DataSource     = feData.Tables["Carriers"];
        lstCarrier.DataTextField  = "carrier_name";
        lstCarrier.DataValueField = "carrier_code";
        lstCarrier.DataBind();
        lstCarrier.Items.Insert(0, new ListItem("", ""));

        hFileType.Value = move_type;

        // New AES
        if (aes_id == "" || aes_id == "0")
        {
            labelPageTitle.Text = "New AES Form";
            trInfo1.Visible     = false;
            trInfo2.Visible     = false;
        }
        // Saved AES
        else
        {
            labelPageTitle.Text = "Edit AES Form";
        }
    }
示例#2
0
    protected void Page_Init(object sender, EventArgs e)
    {
        LoadUserInfo();
        if (!IsPostBack)
        {
            LoadParameters();
            CheckExistingAES();
        }
        // FreightEasyData Initialized
        FreightEasy.DataManager.FreightEasyData feData = SetDataList();
        // Form initialize
        POE.DataSource     = feData.Tables["Ports"];
        POE.DataTextField  = "port_name";
        POE.DataValueField = "port_code";
        POE.DataBind();
        POE.Items.Insert(0, new ListItem("", ""));

        POU.DataSource     = feData.Tables["Ports"];
        POU.DataTextField  = "port_name";
        POU.DataValueField = "port_code";
        POU.DataBind();
        POU.Items.Insert(0, new ListItem("", ""));

        COD.DataSource     = feData.Tables["Countries"];
        COD.DataTextField  = "country_name";
        COD.DataValueField = "country_code";
        COD.DataBind();
        COD.Items.Insert(0, new ListItem("", ""));

        MOT.DataSource     = feData.Tables["MOT"];
        MOT.DataTextField  = "code_desc";
        MOT.DataValueField = "code_id";
        MOT.DataBind();
        MOT.Items.Insert(0, new ListItem("", ""));

        lstCarrier.DataSource     = feData.Tables["Carriers"];
        lstCarrier.DataTextField  = "carrier_name";
        lstCarrier.DataValueField = "carrier_code";
        lstCarrier.DataBind();
        lstCarrier.Items.Insert(0, new ListItem("", ""));

        hFileType.Value = move_type;

        // New AES
        if (string.IsNullOrEmpty(AESID))
        {
            labelPageTitle.Text = "New AES Form";
            trInfo1.Visible     = false;
            trInfo2.Visible     = false;
        }
        // Saved AES
        else
        {
            labelPageTitle.Text = "Edit AES Form";
        }
    }