Пример #1
0
    /// <summary>
    /// Grid 数据绑定
    /// </summary>
    #region   DataBinder()   Author: Micro ( 2011-08-26 )
    void DataBinder()
    {
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_DomesticKid_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "List")
            .Append("dept", userDept)
            .Append("dk_STAT", FSecurityHelper.CurrentUserDataGET()[12])
        }).GetList();                                                             //修改grace 2014-09-23 用于决定是否分站

        if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
        {
            //if (!string.IsNullOrEmpty(Request["txtCode"]))
            //{

            //}

            if (txtCode.Text != "")
            {
                div_bottom.Html  = "<p class=''>Status : Edit the record  of <span>" + txtCode.Text + "</span>.</p>";
                txtCode.Disabled = true;
            }

            StoreDomestic.DataSource = ds;
            StoreDomestic.DataBind();
        }
        else
        {
            div_bottom.Html = "<p class=''>Status: New Container Size record .</p>";
        }
    }
Пример #2
0
    /// <summary>
    /// Grid 数据绑定
    /// </summary>
    #region   DataBinder()   Author: Micro ( 2011-08-26 )
    void DataBinder()
    {
        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_SystemString_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "List")
        }).GetList();

        StoreDomestic.DataSource = ds;
        StoreDomestic.DataBind();
    }
Пример #3
0
    /// <summary>
    /// Grid 数据绑定
    /// </summary>
    #region   DataBinder()   Author: Micro ( 2011-08-27 )  修改时间2014-09-20 Grace
    void DataBinder()
    {
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Item_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "List").Append("itm_ROWID", txtRowID.Text)
            .Append("itm_STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("itm_code", Request["code"])
            .Append("itm_SYS", sys)//FSecurityHelper.CurrentUserDataGET()[11].Substring(0,1))
            .Append("dept", userDept)
        }).GetList();

        if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
        {
            if (ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0)
            {
                txtRowID.Text     = ds.Tables[1].Rows[0]["itm_RowID"].ToString();
                txtCode.Text      = ds.Tables[1].Rows[0]["itm_Code"].ToString();
                txtShort.Text     = ds.Tables[1].Rows[0]["itm_Short"].ToString();
                txtDes.Text       = ds.Tables[1].Rows[0]["itm_Description"].ToString();
                txtDesCN.Text     = ds.Tables[1].Rows[0]["itm_Description_CN"].ToString();
                cmbFCurrency.Text = ds.Tables[1].Rows[0]["itm_FCurrency"].ToString();
                cmbFby.Text       = ds.Tables[1].Rows[0]["itm_FCalcQty"].ToString();
                cmbFUnit.Text     = ds.Tables[1].Rows[0]["itm_FUnit"].ToString();
                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_FMin"].ToString()))
                {
                    txtFMain.Clear();
                }
                else
                {
                    txtFMain.Text = ds.Tables[1].Rows[0]["itm_FMin"].ToString();
                }

                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_FRate"].ToString()))
                {
                    txtFRate.Clear();
                }
                else
                {
                    txtFRate.Text = ds.Tables[1].Rows[0]["itm_FRate"].ToString();
                }

                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_FAmount"].ToString()))
                {
                    txtFAmount.Clear();
                }
                else
                {
                    txtFAmount.Text = ds.Tables[1].Rows[0]["itm_FAmount"].ToString();
                }

                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_FRound"].ToString()))
                {
                    txtFRound.Clear();
                }
                else
                {
                    txtFRound.Text = ds.Tables[1].Rows[0]["itm_FRound"].ToString();
                }

                chbFUp.Checked   = Convert.ToBoolean(ds.Tables[1].Rows[0]["itm_FMarkUp"]);
                chbFDown.Checked = Convert.ToBoolean(ds.Tables[1].Rows[0]["itm_FMarkDown"]);
                labCurrency.Text = ds.Tables[1].Rows[0]["itm_LCurrency"].ToString(); //保存获取不到Text值
                txtlab.Text      = ds.Tables[1].Rows[0]["itm_LCurrency"].ToString();
                cmbLby.Text      = ds.Tables[1].Rows[0]["itm_LCalcQty"].ToString();
                cmbLUnit.Text    = ds.Tables[1].Rows[0]["itm_LUnit"].ToString();
                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_LMin"].ToString()))
                {
                    txtLMin.Clear();
                }
                else
                {
                    txtLMin.Text = ds.Tables[1].Rows[0]["itm_LMin"].ToString();
                }

                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_LRate"].ToString()))
                {
                    txtLRate.Clear();
                }
                else
                {
                    txtLRate.Text = ds.Tables[1].Rows[0]["itm_LRate"].ToString();
                }

                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_LAmount"].ToString()))
                {
                    txtLAmount.Clear();
                }
                else
                {
                    txtLAmount.Text = ds.Tables[1].Rows[0]["itm_LAmount"].ToString();
                }

                if (string.IsNullOrEmpty(ds.Tables[1].Rows[0]["itm_LRound"].ToString()))
                {
                    txtLRound.Clear();
                }
                else
                {
                    txtLRound.Text = ds.Tables[1].Rows[0]["itm_LRound"].ToString();
                }

                chbLUp.Checked    = Convert.ToBoolean(ds.Tables[1].Rows[0]["itm_LMarkUp"]);
                chbLDown.Checked  = Convert.ToBoolean(ds.Tables[1].Rows[0]["itm_LMarkDown"]);
                chbActive.Checked = Convert.ToBoolean(ds.Tables[1].Rows[0]["itm_Active"]);
                labFvalues.Text   = ds.Tables[1].Rows[0]["Fvalues"].ToString();
                labFRound.Text    = ds.Tables[1].Rows[0]["FRound"].ToString();
                labLValues.Text   = ds.Tables[1].Rows[0]["Lvalues"].ToString();
                labLRound.Text    = ds.Tables[1].Rows[0]["LRound"].ToString();

                string[] statlist = string.IsNullOrEmpty(ds.Tables[1].Rows[0]["StatList"].ToString()) ? new string[] { } : ds.Tables[1].Rows[0]["StatList"].ToString().Split(',');
                CheckGroupClear();

                foreach (string str in statlist)
                {
                    for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
                    {
                        if (tblChkGroup.Items[i].Tag.ToString().Trim().ToUpper() == str.Trim().ToUpper())
                        {
                            tblChkGroup.Items[i].Checked = true;
                            break;
                        }
                    }
                }
            }
            //txtCode.Focus(true);
            if (txtCode.Text != "")
            {
                div_bottom.Html  = "<p class=''>Status : Edit the record  of <span>" + txtCode.Text + "</span>.</p>";
                txtCode.Disabled = true;
            }
            StoreDomestic.DataSource = ds.Tables[0];
            StoreDomestic.DataBind();
        }
        else
        {
            div_bottom.Html = "<p class=''>Status: New Item record.</p>";
        }
    }