Ejemplo n.º 1
0
    /// <summary>
    /// 查询数据绑定
    /// </summary>
    void DataBinder()
    {
        int voy_vessel = -1;

        try
        {
            voy_vessel = Convert.ToInt32(cmbVessel.SelectedItem.Value);
        }
        catch
        {
            cmbVessel.Value = "";
            cmbVessel.Text  = "";
        }

        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_Voyage_SP", new List <IFields>()
        {
            dal.CreateIFields().
            Append("Option", "list").
            Append("voy_Stat", FSecurityHelper.CurrentUserDataGET()[12]).
            Append("voy_Vessel", voy_vessel)
        }).GetList();

        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            txtVoyageID.Text = "0";
            //labCarrierCode.Text = "";
            txtVoyage.Text     = "";
            txtCFS.RawText     = "";
            txtCY.RawText      = "";
            txtETA.RawText     = "";
            txtETD.RawText     = "";
            txtOnboard.RawText = "";
            cmbPOD.setValue("");
            cmbPOL.setValue("");
            gridVoyageRoute.GetStore().RemoveAll();
        }
        if (ds != null && ds.Tables[1].Rows.Count > 0)
        {
            labCarrierCode.Text = ds.Tables[1].Rows[0]["Carrier"].ToString();
        }

        storeVoyage.DataSource = ds;
        storeVoyage.DataBind();
        if ((string.IsNullOrEmpty(Request["vessel"]) && Request["vesselID"] == null) && refresh)
        {
            RowSelectionModel sm = gridVoyage.GetSelectionModel() as RowSelectionModel;
            sm.SelectRow(0);
            sm.SelectedRows.Add(new SelectedRow(0));
        }
        else if (Request["vesselID"] != null && cmbVessel.SelectedItem.Value != Request["vesselID"].ToString() && refresh)
        {
            RowSelectionModel sm = gridVoyage.GetSelectionModel() as RowSelectionModel;
            sm.SelectRow(0);
            sm.SelectedRows.Add(new SelectedRow(0));
        }
    }
Ejemplo n.º 2
0
    private void DataBindList()
    {
        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "List")
                    .Append("wbm_Seed", hidSeed.Text == "" ? null : hidSeed.Text)
                    );
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_Manifest_SP", Getlist).GetList();

        if (ds != null && ds.Tables[0].Rows[0][0].ToString() == "Y")
        {
            if (ds != null && ds.Tables[1].Rows.Count > 0)
            {
                txtHAWB.Text  = ds.Tables[1].Rows[0]["wbm_HAWB"].ToString();
                txtPKG.Text   = ds.Tables[1].Rows[0]["wbm_RCP"].ToString();
                txtWT.Text    = ds.Tables[1].Rows[0]["wbm_WT"].ToString();
                txtPreWT.Text = ds.Tables[1].Rows[0]["wbm_PreAlertWT"].ToString();
                txtInfo.Text  = ds.Tables[1].Rows[0]["wbm_WTLine"].ToString();
                CmbDest.SelectedItem.Value = ds.Tables[1].Rows[0]["wbm_Final"].ToString();

                CmbShipperCode.setValue(ds.Tables[1].Rows[0]["wbm_ShipperCode"].ToString());
                lblShipper1.Text = ds.Tables[1].Rows[0]["wbm_Shipper1"].ToString();
                lblShipper2.Text = ds.Tables[1].Rows[0]["wbm_Shipper2"].ToString();
                lblShipper3.Text = ds.Tables[1].Rows[0]["wbm_Shipper3"].ToString();
                lblShipper4.Text = ds.Tables[1].Rows[0]["wbm_Shipper4"].ToString();
                lblShipper5.Text = ds.Tables[1].Rows[0]["wbm_Shipper5"].ToString();
                lblShipper6.Text = ds.Tables[1].Rows[0]["wbm_Shipper6"].ToString();

                CmbConsignee.setValue(ds.Tables[1].Rows[0]["wbm_ConsigneeCode"].ToString());
                lblConsignee1.Text = ds.Tables[1].Rows[0]["wbm_Consignee1"].ToString();
                lblConsignee2.Text = ds.Tables[1].Rows[0]["wbm_Consignee2"].ToString();
                lblConsignee3.Text = ds.Tables[1].Rows[0]["wbm_Consignee3"].ToString();
                lblConsignee4.Text = ds.Tables[1].Rows[0]["wbm_Consignee4"].ToString();
                lblConsignee5.Text = ds.Tables[1].Rows[0]["wbm_Consignee5"].ToString();
                lblConsignee6.Text = ds.Tables[1].Rows[0]["wbm_Consignee6"].ToString();

                lblNature1.Text = ds.Tables[1].Rows[0]["wbm_Nature1"].ToString();
                lblNature2.Text = ds.Tables[1].Rows[0]["wbm_Nature2"].ToString();
                lblNature3.Text = ds.Tables[1].Rows[0]["wbm_Nature3"].ToString();
                lblNature4.Text = ds.Tables[1].Rows[0]["wbm_Nature4"].ToString();
                lblNature5.Text = ds.Tables[1].Rows[0]["wbm_Nature5"].ToString();
                lblNature6.Text = ds.Tables[1].Rows[0]["wbm_Nature6"].ToString();
            }

            if (ds != null && ds.Tables[2].Rows.Count > 0)
            {
                gpHawb.GetStore().DataSource = ds.Tables[2];
                gpHawb.GetStore().DataBind();
                RowSelectionModel sm = gpHawb.GetSelectionModel() as RowSelectionModel;
                sm.SelectRow(0);
                sm.SelectedRows.Add(new SelectedRow(0));
            }
        }
        else
        {
            if (ds.Tables[1].Rows.Count > 0)
            {
                txtHAWB.Text = ds.Tables[1].Rows[0]["wbm_HAWB"].ToString();
                txtPKG.Text  = ds.Tables[1].Rows[0]["wbm_RCP"].ToString();
                txtWT.Text   = ds.Tables[1].Rows[0]["wbm_WT"].ToString();
                CmbDest.SelectedItem.Value = ds.Tables[1].Rows[0]["wbm_Final"].ToString();
            }
        }
    }