Beispiel #1
0
    //public string GetCurrency(object obj)
    //{
    //    return CurrencyDAL.GetCurrencyNameById(Convert.ToInt32(obj));
    //}

    private void gridBind(int country, int cuangku, int kuwei)
    {
        DataTable table = AddReportProfit.GetProductEQueryMenu(country, cuangku, kuwei);

        this.givproduct.DataSource = table;
        this.givproduct.DataBind();
        //判断是否有产品,如果没有报损按钮不显示
        if (table.Rows.Count > 0)
        {
            this.btnProfit.Visible = true;
        }
        else
        {
            this.btnProfit.Visible = false;
        }
        for (int i = 0; i < givproduct.Rows.Count; i++)
        {
            //DataRowView row=table.DefaultView[i];
            RadioButtonList RadioBtnCate = (RadioButtonList)givproduct.Rows[i].FindControl("rdoBtnCate");
            RadioBtnCate.SelectedIndex = 0;

            HtmlInputHidden HidBigSmallMultiPle = (HtmlInputHidden)givproduct.Rows[i].FindControl("HidBigSmallMultiPle");
            HtmlInputHidden HidBigUnitName      = (HtmlInputHidden)givproduct.Rows[i].FindControl("HidBigUnitName");
            HtmlInputHidden HidSmallUnitName    = (HtmlInputHidden)givproduct.Rows[i].FindControl("HidSmallUnitName");
            RadioBtnCate.Items[0].Value = HidBigSmallMultiPle.Value;
            RadioBtnCate.Items[1].Value = "1";
            RadioBtnCate.Items[0].Text  = HidBigUnitName.Value + "(" + GetTran("000505", "数量") + ":" + HidBigSmallMultiPle.Value + ")";
            RadioBtnCate.Items[1].Text  = HidSmallUnitName.Value + "(" + GetTran("000505", "数量") + ":1)";
            RequiredFieldValidator rf = (RequiredFieldValidator)givproduct.Rows[i].FindControl("rf");
            TextBox tb        = (TextBox)givproduct.Rows[i].FindControl("txtPdtNum");
            int     productid = Convert.ToInt32(((Label)givproduct.Rows[i].FindControl("lblproductID")).Text.Trim());
            ((Label)givproduct.Rows[i].FindControl("LblPrice")).Text = ((DAL.AddFreeOrderDAL.GetCurren(Convert.ToInt32(DAL.ProductDAL.GetPCurr(productid)))) * Convert.ToDouble(((Label)givproduct.Rows[i].FindControl("LblPrice")).Text)).ToString();
            Label           lbunit        = (Label)givproduct.Rows[i].FindControl("LblPrice");
            Label           lbpv          = (Label)givproduct.Rows[i].FindControl("LblPV");
            HtmlInputHidden hidneedNumber = (HtmlInputHidden)givproduct.Rows[i].FindControl("HidNeedNumber");
            RadioBtnCate.SelectedIndex = 1;
            RadioBtnCate.Enabled       = false;
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        if (!IsPostBack)
        {
            Response.Cache.SetExpires(DateTime.Now);
            Permissions.CheckManagePermission(EnumCompanyPermission.StorageAddReWareHouse);

            this.DropCurrery.DataSource     = CountryBLL.GetCountryModels();
            this.DropCurrery.DataTextField  = "name";
            this.DropCurrery.DataValueField = "countrycode";
            this.DropCurrery.DataBind();

            int cID = Convert.ToInt32(DropCurrery.SelectedItem.Value);

            //绑定入库仓库
            //this.ddlinwareHouse.DataSource = BillOutOrderBLL.GetWareHouseName();

            CountryModel mode   = CountryBLL.GetCountryModels()[0];
            DataView     dataev = new DataView(BillOutOrderBLL.GetWareHouseName());
            dataev.RowFilter                   = "[CountryCode]=" + CountryBLL.GetCountryByCode(mode.ID);
            ddlinwareHouse.DataSource          = dataev;
            this.ddlinwareHouse.DataTextField  = "WareHouseName";
            this.ddlinwareHouse.DataValueField = "WareHouseID";
            this.ddlinwareHouse.DataBind();
            if (string.IsNullOrEmpty(ddlinwareHouse.SelectedValue))
            {
                ddlinwareHouse.DataSource     = AddReportProfit.GetProductWareHouseInfo();
                ddlinwareHouse.DataTextField  = "name";
                ddlinwareHouse.DataValueField = "id";
                ddlinwareHouse.DataBind();
                ddlinwareHouse.Enabled    = false;
                ddlintDepotSeatID.Enabled = false;
                ViewState["Ekuc"]         = "false";
            }
            //绑定出库仓库
            //this.ddloutWareHouse.DataSource = BillOutOrderBLL.GetWareHouseName();

            DataView dataev1 = new DataView(BillOutOrderBLL.GetWareHouseName());
            dataev1.RowFilter                   = "[CountryCode]=" + CountryBLL.GetCountryByCode(mode.ID);
            ddloutWareHouse.DataSource          = dataev1;
            this.ddloutWareHouse.DataTextField  = "WareHouseName";
            this.ddloutWareHouse.DataValueField = "WareHouseID";
            this.ddloutWareHouse.DataBind();
            if (string.IsNullOrEmpty(ddloutWareHouse.SelectedValue))
            {
                ddloutWareHouse.DataSource     = AddReportProfit.GetProductWareHouseInfo();
                ddloutWareHouse.DataTextField  = "name";
                ddloutWareHouse.DataValueField = "id";
                ddloutWareHouse.DataBind();
                ddloutWareHouse.Enabled   = false;
                ddloutDepotSeatID.Enabled = false;
                ViewState["Ekuc"]         = "false";
            }
            else
            {
                ViewState["Ekuc"] = "true";
            }
            ddloutWareHouse_SelectedIndexChanged(null, null);
            ddlinwareHouse_SelectedIndexChanged(null, null);
            //绑定产品列表
            gridBind(cID, Convert.ToInt32(ddloutWareHouse.SelectedValue), Convert.ToInt32(ddloutDepotSeatID.SelectedValue));
        }
        Translations();
    }