Exemplo n.º 1
0
        //public void ASPxComPline_DataBinding(object sender, EventArgs e)
        //{
        //    ASPxComboBox comPline = sender as ASPxComboBox;
        //    List<ProductLineEntity> all = ProductLineFactory.GetAll();
        //    comPline.DataSource = all;
        //    comPline.TextField = "PLINE_NAME";
        //    comPline.ValueField = "PLINE_CODE";
        //}

        protected void WorkUnit_Callback(object sender, CallbackEventArgsBase e)
        {
            string               pline    = e.Parameter;
            ASPxComboBox         location = (ASPxComboBox)sender;
            List <StationEntity> all      = StationFactory.GetByProductLine(pline);

            location.DataSource = all;
            location.TextField  = "LOCATION_NAME";
            location.ValueField = "WORKUNIT_CODE";
            location.DataBind();
        }
Exemplo n.º 2
0
        protected void ASPxComboBoxStationSub_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            string plineCode = e.Parameter;
            List <StationEntity> stationEntities = StationFactory.GetByProductLine(plineCode);
            ASPxComboBox         station         = sender as ASPxComboBox;

            station.DataSource = stationEntities;
            station.ValueField = "RMES_ID";
            station.TextField  = "STATION_NAME";
            station.DataBind();
        }
Exemplo n.º 3
0
        protected void comWorkUnit_Callback(object sender, CallbackEventArgsBase e)
        {
            //ASPxComboBox _pline = ASPxGridView1.FindEditFormTemplateControl("combPline") as ASPxComboBox;
            string pline = e.Parameter;

            List <StationEntity> stations = StationFactory.GetByProductLine(pline);
            ASPxComboBox         workUnit = (ASPxComboBox)sender;

            workUnit.DataSource = stations;
            workUnit.TextField  = "STATION_NAME";
            workUnit.ValueField = "WORKUNIT_CODE";

            workUnit.DataBind();
        }
Exemplo n.º 4
0
        private void initComboBoxByCompany()
        {
            initing = true;
            object val = null;

            val = comboBox1.SelectedValue;
            try
            {
                if (val != null)
                {
                    comboBox2.DataSource    = ProductLineFactory.GetByCompanyCode(val.ToString());
                    comboBox2.SelectedValue = DB.ReadConfigLocal("PRODUCTLINE_CODE");
                    setComboxBoxCurrent(comboBox2);

                    val = comboBox2.SelectedValue;
                    if (val != null)
                    {
                        comboBox3.DataSource = StationFactory.GetByProductLine(val.ToString());
                    }
                    else
                    {
                        List <StationEntity> stas = StationFactory.GetAll();
                        var sta1 = from ss in stas
                                   where ss.COMPANY_CODE == LoginInfo.CompanyInfo.COMPANY_CODE
                                   select ss;
                        comboBox3.DataSource = sta1.ToList <StationEntity>();
                    }
                    comboBox6.SelectedValue = DB.ReadConfigLocal("WORKSHOP_CODE");
                    comboBox6.DataSource    = WorkShopFactory.GetAll();
                    setComboxBoxCurrent(comboBox6);

                    comboBox3.SelectedValue = DB.ReadConfigLocal("STATION_CODE");
                    setComboxBoxCurrent(comboBox3);

                    comboBox4.DataSource    = ShiftFactory.GetAll();
                    comboBox4.SelectedValue = DB.ReadConfigLocal("SHIFT_CODE");
                    setComboxBoxCurrent(comboBox4);

                    comboBox5.DataSource    = TeamFactory.GetByPlineCode(val.ToString());
                    comboBox5.SelectedValue = DB.ReadConfigLocal("TEAM_CODE");
                    setComboxBoxCurrent(comboBox5);
                }
            }
            catch
            {
            }
            initing = false;
        }
Exemplo n.º 5
0
        public void BindData()
        {
            List <DepartmentEntity> dept = DB.GetInstance().Fetch <DepartmentEntity>("");

            com_DEPT.DataSource = dept;
            com_DEPT.ValueField = "DEPT_CODE";
            com_DEPT.TextField  = "DEPT_NAME";
            com_DEPT.DataBind();
            if (com_DEPT.SelectedItem == null)
            {
                return;
            }
            string _dept = com_DEPT.SelectedItem.Value.ToString();
            List <ProductLineEntity> plines = DB.GetInstance().Fetch <ProductLineEntity>("where pline_code in (select pline_code from REL_DEPT_PLINE where dept_code=@0)", _dept);

            ASPxComboBox1.DataSource = plines;
            ASPxComboBox1.TextField  = "PLINE_NAME";
            ASPxComboBox1.ValueField = "PLINE_CODE";
            ASPxComboBox1.DataBind();
            if (ASPxComboBox1.SelectedItem == null)
            {
                return;
            }
            string pline = ASPxComboBox1.SelectedItem.Value.ToString();
            List <StationEntity> stations = StationFactory.GetByProductLine(pline);

            ASPxComboBox2.DataSource = stations;
            ASPxComboBox2.TextField  = "STATION_NAME";
            ASPxComboBox2.ValueField = "WORKUNIT_CODE";
            ASPxComboBox2.DataBind();
            string workunit = "";

            if (ASPxComboBox2.SelectedItem != null)
            {
                workunit = ASPxComboBox2.SelectedItem.Value.ToString();
            }
            Report_Exp2200 report = new Report_Exp2200(ASPxComboBox1.SelectedItem.Value.ToString(), workunit, ASPxDateEdit1.Date, ASPxDateEdit2.Date);

            ReportViewer1.Report = report;
        }
Exemplo n.º 6
0
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            ASPxComboBox pline      = ASPxGridView1.FindEditFormTemplateControl("combPline") as ASPxComboBox;
            ASPxComboBox workUnit   = ASPxGridView1.FindEditFormTemplateControl("comWorkUnit") as ASPxComboBox;
            ASPxComboBox detectItem = ASPxGridView1.FindEditFormTemplateControl("comDetectItem") as ASPxComboBox;

            pline.TextField  = "PLINE_NAME";
            pline.ValueField = "PLINE_CODE";

            string plineCode    = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "PLINE_CODE").ToString();
            string workUnitCode = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "WORKUNIT_CODE").ToString();


            List <StationEntity> stations = StationFactory.GetByProductLine(plineCode);

            workUnit.DataSource = stations;
            workUnit.TextField  = "STATION_NAME";
            workUnit.ValueField = "WORKUNIT_CODE";



            List <DetectDataEntity> detectItems = DetectDataFactory.GetByWorkunit(theCompanyCode, workUnitCode);

            detectItem.DataSource = detectItems;
            detectItem.TextField  = "DETECT_ITEM_NAME";
            detectItem.ValueField = "DETECT_ITEM_CODE";



            if (ASPxGridView1.IsEditing)
            {
                //string _workUnit = ASPxGridView1.GetRowValues(ASPxGridView1.EditingRowVisibleIndex, "WORKUNIT_CODE").ToString();
                //for (int i = 0; i < workUnit.Items.Count; i++)
                //{
                //    if (_workUnit == workUnit.Items[i].Value.ToString())
                //        workUnit.Items[i].Selected = true;
                //}
            }
        }