Example #1
0
        public void BindData()
        {
            string            orderCode             = txtOrderCode.Text.ToUpper();
            string            plineCode             = ComPline.SelectedItem.Value.ToString();
            List <PlanEntity> plans                 = PlanFactory.GetByCreatePeriod(cdate1.Date, cdate2.Date);
            string            _b                    = cdate1.Date.ToShortDateString() + " 00:00:00";
            string            _e                    = cdate2.Date.ToShortDateString() + " 23:59:59";
            List <IMESCompleteInstoreEntity> entity = db.Fetch <IMESCompleteInstoreEntity>("where aufnr in (select ORDER_CODE from DATA_PLAN where create_time between to_date(@0,'yyyy-mm-dd hh24:mi:ss') and to_date(@1,'yyyy-mm-dd hh24:mi:ss'))", _b, _e);
            UserEntity users = UserFactory.GetByUserCode(theUserID);


            if (!string.IsNullOrWhiteSpace(orderCode))
            {
                //entity = (from s in entity where (from pl in plans where pl.PROJECT_CODE == orderCode.ToUpper() && pl.RUN_FLAG == "F" select pl.ORDER_CODE).Contains(s.AUFNR) select s).ToList<IMESCompleteInstoreEntity>();
            }
            if (!ComPline.SelectedItem.Value.ToString().Equals("All"))
            {
                entity = (from s in entity where (from pl in plans where pl.PLINE_CODE == plineCode && pl.RUN_FLAG == "F" select pl.ORDER_CODE).Contains(s.AUFNR) select s).ToList <IMESCompleteInstoreEntity>();
            }
            DataTable dt1 = new DataTable();

            dt1.Columns.Add("AUFNR");
            //ASPxGridView1.DataSource = entity;
            XtraReport1 re = new XtraReport1(entity, theUserID, orderCode);

            ReportViewer1.Report = re;


            //DataTable dt = new DataTable();
            //dt.Columns.Add("Text");
            //dt.Columns.Add("Value");
            //dt.Rows.Add("初始状态", "0");
            //dt.Rows.Add("传送中", "1");
            //dt.Rows.Add("已传送", "2");

            //GridViewDataComboBoxColumn colPrind = ASPxGridView1.Columns["PRIND"] as GridViewDataComboBoxColumn;
            //colPrind.PropertiesComboBox.DataSource = dt;
            //colPrind.PropertiesComboBox.TextField = "Text";
            //colPrind.PropertiesComboBox.ValueField = "Value";

            //DataTable workshopDT = new DataTable();
            //workshopDT.Columns.Add("Value");
            //workshopDT.Columns.Add("Text");
            //workshopDT.Rows.Add("8101", "园区");
            //workshopDT.Rows.Add("8102", "基地");
            //GridViewDataComboBoxColumn workshopCol = ASPxGridView1.Columns["WERKS"] as GridViewDataComboBoxColumn;
            //workshopCol.PropertiesComboBox.DataSource = workshopDT;
            //workshopCol.PropertiesComboBox.ValueField = "Value";
            //workshopCol.PropertiesComboBox.TextField = "Text";


            //ASPxGridView1.DataBind();
        }
Example #2
0
        private void initSnEdit()
        {
            GridPrint.Rows.Clear();

            List <PlanEntity> allPlans = PlanFactory.GetByCreatePeriod(dateTimePicker1.Value, dateTimePicker2.Value);

            if (comboBox1.SelectedIndex >= 0)
            {
                string pline_code = comboBox1.SelectedValue.ToString();
                allPlans = (from s in allPlans where s.PLINE_CODE == pline_code select s).ToList();
            }
            if (allPlans.Count > 0)
            {
                foreach (var p in allPlans)
                {
                    List <PlanSnEntity> snEntity = PlanSnFactory.WebGetByOrderCode(p.ORDER_CODE);
                    if (snEntity == null)
                    {
                        continue;
                    }
                    foreach (var s in snEntity)
                    {
                        //int i = GridPrint.Rows.Add();
                        //GridPrint.Rows[i].Cells["colPrint"].Value = "打印";
                        //GridPrint.Rows[i].Cells["colProject"].Value = p.PROJECT_CODE;
                        //GridPrint.Rows[i].Cells["colOrderCode"].Value = p.ORDER_CODE;
                        //GridPrint.Rows[i].Cells["colModel"].Value = p.PLAN_SO;
                        //GridPrint.Rows[i].Cells["colSeries"].Value = p.PRODUCT_SERIES;
                        //GridPrint.Rows[i].Cells["colBarCode"].Value = p.DETECT_BARCODE;
                        //GridPrint.Rows[i].Cells["colSN"].Value = s.SN;
                    }
                }
            }
            if (statusStrip1.Items.Count == 0)
            {
                statusStrip1.Items.Add("记录数量:" + allPlans.Count.ToString());
            }
            else
            {
                statusStrip1.Items[0].Text = "记录数量:" + allPlans.Count.ToString();
            }
            // GridEdit.Rows[i].ReadOnly = true;
            // bCell.Value = "不可打印";
        }
Example #3
0
        public void BindData()
        {
            string planSO    = txtPlanSO.Text;
            string plineCode = ComPline.SelectedItem.Value.ToString();
            //if (string.IsNullOrWhiteSpace(orderCode)) return;
            List <PlanEntity> plans = PlanFactory.GetByCreatePeriod(cdate1.Date, cdate2.Date);
            //string _b = cdate1.Date.ToString("yyyyMMdd") + "000000";
            //string _e = cdate2.Date.ToString("yyyyMMdd") + "235959";
            //List<IMESPlanBOMEntity> entity = db.Fetch<IMESPlanBOMEntity>("where SERIAL between @0 and @1 order by AUFNR", _b, _e);
            string _b = "B" + cdate1.Date.ToString("yyyyMMdd") + "0000";
            string _e = "B" + cdate2.Date.ToString("yyyyMMdd") + "9999";
            List <IMESPlanBOMEntity> entity = db.Fetch <IMESPlanBOMEntity>("where BATCH between @0 and @1 order by AUFNR", _b, _e);



            if (!string.IsNullOrWhiteSpace(planSO))
            {
                entity = (from s in entity where s.MATNR == planSO select s).ToList <IMESPlanBOMEntity>();
            }
            if (!ComPline.SelectedItem.Value.ToString().Equals("All"))
            {
                entity = (from s in entity where (from pl in plans where pl.PLINE_CODE == plineCode && pl.RUN_FLAG == "F" select pl.ORDER_CODE).Contains(s.AUFNR) select s).ToList <IMESPlanBOMEntity>();
            }

            ASPxGridView1.DataSource = entity;

            DataTable dt = new DataTable();

            dt.Columns.Add("Text");
            dt.Columns.Add("Value");
            dt.Rows.Add("初始状态", "0");
            dt.Rows.Add("传送中", "1");
            dt.Rows.Add("已传送", "2");

            GridViewDataComboBoxColumn colPrind = ASPxGridView1.Columns["PRIND"] as GridViewDataComboBoxColumn;

            colPrind.PropertiesComboBox.DataSource = dt;
            colPrind.PropertiesComboBox.TextField  = "Text";
            colPrind.PropertiesComboBox.ValueField = "Value";

            ASPxGridView1.DataBind();
        }
Example #4
0
        public void BindData()
        {
            string        plineCode;
            List <object> _planSO = gridLookupItem.GridView.GetSelectedFieldValues("WBS_CODE");

            if (_planSO == null || _planSO.Count == 0)
            {
                return;
            }
            if (ComPline.SelectedItem != null)
            {
                plineCode = ComPline.SelectedItem.Value.ToString();
            }
            else
            {
                plineCode = "";
            }
            //if (string.IsNullOrEmpty(plineCode)) return;
            List <PlanEntity> entity = PlanFactory.GetByCreatePeriod(cdate1.Date, cdate2.Date);


            if (_planSO != null && _planSO.Count > 0)
            {
                //entity = (from s in entity where _planSO.Contains(s.WBS_CODE) select s).ToList<PlanEntity>();
            }

            if (!ComPline.SelectedItem.Value.ToString().Equals("All"))
            {
                entity = (from s in entity where s.PLINE_CODE == plineCode select s).ToList <PlanEntity>();
            }
            ASPxGridView1.DataSource = entity;
            XtraReport3 re = new XtraReport3(entity);

            ReportViewer1.Report = re;
            GridViewDataComboBoxColumn colPline      = ASPxGridView1.Columns["PLINE_CODE"] as GridViewDataComboBoxColumn;
            List <ProductLineEntity>   plineEntities = ProductLineFactory.GetAll();

            colPline.PropertiesComboBox.DataSource = plineEntities;
            colPline.PropertiesComboBox.ValueField = "RMES_ID";
            colPline.PropertiesComboBox.TextField  = "PLINE_NAME";

            DataTable itemDT = new DataTable();

            itemDT.Columns.Add("Value");
            itemDT.Columns.Add("Text");
            itemDT.Rows.Add("Y", "已收料");
            itemDT.Rows.Add("B", "已发料单");
            itemDT.Rows.Add("N", "未确认");
            GridViewDataComboBoxColumn itemCol = ASPxGridView1.Columns["ITEM_FLAG"] as GridViewDataComboBoxColumn;

            itemCol.PropertiesComboBox.DataSource = itemDT;
            itemCol.PropertiesComboBox.ValueField = "Value";
            itemCol.PropertiesComboBox.TextField  = "Text";


            DataTable runDT = new DataTable();

            runDT.Columns.Add("Value");
            runDT.Columns.Add("Text");
            runDT.Rows.Add("Y", "执行中");
            runDT.Rows.Add("N", "未执行");
            runDT.Rows.Add("P", "暂停中");
            runDT.Rows.Add("F", "已完成");
            GridViewDataComboBoxColumn runCol = ASPxGridView1.Columns["RUN_FLAG"] as GridViewDataComboBoxColumn;

            runCol.PropertiesComboBox.DataSource = runDT;
            runCol.PropertiesComboBox.ValueField = "Value";
            runCol.PropertiesComboBox.TextField  = "Text";


            List <UserEntity>          allusers    = UserFactory.GetAll();
            GridViewDataComboBoxColumn create_user = ASPxGridView1.Columns["CREATE_USER_ID"] as GridViewDataComboBoxColumn;

            create_user.PropertiesComboBox.DataSource = allusers;
            create_user.PropertiesComboBox.ValueField = "USER_ID";
            create_user.PropertiesComboBox.TextField  = "USER_NAME";
            DataTable typeDT = new DataTable();

            typeDT.Columns.Add("Value");
            typeDT.Columns.Add("Text");
            typeDT.Rows.Add("ZP01", "标准");
            typeDT.Rows.Add("ZP02", "返工");
            typeDT.Rows.Add("ZP03", "拆解");
            GridViewDataComboBoxColumn typeCol = ASPxGridView1.Columns["PLAN_TYPE_CODE"] as GridViewDataComboBoxColumn;

            typeCol.PropertiesComboBox.DataSource = typeDT;
            typeCol.PropertiesComboBox.ValueField = "Value";
            typeCol.PropertiesComboBox.TextField  = "Text";


            ASPxGridView1.DataBind();
        }