Example #1
0
    private void DataBindGridview()
    {
        //绑定表数据

        List <WorkShopEntity> workShop = WorkShopFactory.GetUserWorkShops(theUserID);

        string sql = "select * from vw_data_sn_process_union t where exists(select * from data_project a where t.PROJECT_CODE=a.project_code and a.workshop_id='" + workShop[0].RMES_ID + "')";

        DataTable dt = dc.GetTable(sql);

        ASPxGridView1.DataSource = dt;

        //ASPxGridView1.DataSource = db.Fetch<SNProcessEntity>("where company_code=@0 order by pline_code", theCompanyCode);

        GridViewDataComboBoxColumn col = ASPxGridView1.Columns["PLINE_CODE"] as GridViewDataComboBoxColumn;

        col.PropertiesComboBox.DataSource = ProductLineFactory.GetByWorkShopID(workShop[0].RMES_ID);
        col.PropertiesComboBox.ValueField = "RMES_ID";
        col.PropertiesComboBox.TextField  = "PLINE_NAME";

        //GridViewDataComboBoxColumn col1 = ASPxGridView1.Columns["LOCATION_CODE"] as GridViewDataComboBoxColumn;
        //col1.PropertiesComboBox.DataSource = db.Fetch<LocationEntity>("");
        //col1.PropertiesComboBox.ValueField = "RMES_ID";
        //col1.PropertiesComboBox.TextField = "LOCATION_NAME";


        ASPxGridView1.DataBind();
    }
Example #2
0
        public void SelectPline()
        {
            Workshop_PlineEntity     pline    = Workshop_PlineFactory.GetByPline(LoginInfo.StationInfo.PLINE_CODE);
            List <ProductLineEntity> listline = ProductLineFactory.GetByWorkShopID(pline.WORKSHOP_CODE);

            foreach (ProductLineEntity LineEn in listline)
            {
                string[]     str  = new string[] { LineEn.PLINE_NAME, LineEn.PLINE_CODE, LineEn.RMES_ID };
                ListViewItem Item = new ListViewItem(str);

                ViewPline.Items.Add(Item);
            }
        }