Esempio n. 1
0
        /// <summary>
        /// carga solo una vez para ahorar tiempo
        /// </summary>
        private void cargarCombos()
        {
            using (var conexion = new DataModelFE())
            {
                /* PRODUCTO */
                string emisor = Session["emisor"].ToString();
                GridViewDataComboBoxColumn comboProducto = this.ASPxGridView1.Columns["codigo.codigo"] as GridViewDataComboBoxColumn;
                comboProducto.PropertiesComboBox.Items.Clear();
                foreach (var item in conexion.Producto.Where(x => x.emisor == emisor).ToList())
                {
                    comboProducto.PropertiesComboBox.Items.Add(item.descripcion, item.codigo);
                }
                comboProducto.PropertiesComboBox.IncrementalFilteringMode = IncrementalFilteringMode.Contains;


                /* TIPO DOCUMENTO */
                foreach (var item in conexion.TipoDocumento.Where(x => x.estado == Estado.ACTIVO.ToString()).ToList())
                {
                    this.cmbTipoDocumento.Items.Add(item.descripcion, item.codigo);
                }
                this.cmbTipoDocumento.IncrementalFilteringMode = IncrementalFilteringMode.Contains;


                /* CODIGO REFERENCIA */
                foreach (var item in conexion.CodigoReferencia.Where(x => x.estado == Estado.ACTIVO.ToString() && x.aplicaNotas == Confirmacion.SI.ToString()).ToList())
                {
                    this.cmbCodigoReferencia.Items.Add(item.descripcion, item.codigo);
                }
                this.cmbCodigoReferencia.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
            }
        }
Esempio n. 2
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();
    }
        /// <summary>
        /// carga solo una vez para ahorar tiempo
        /// </summary>
        private void cargarCombos()
        {
            // Cargar valores de combo para estado
            GridViewDataComboBoxColumn comboEstado = this.ASPxGridView1.Columns["indEstado"] as GridViewDataComboBoxColumn;

            comboEstado.PropertiesComboBox.Items.Clear();
            comboEstado.PropertiesComboBox.Items.AddRange(EstadoMensajeHaciendaClass.values());

            /* TIPO DOCUMENTO */
            GridViewDataComboBoxColumn comboTipoDocumento = this.ASPxGridView1.Columns["tipoDocumento"] as GridViewDataComboBoxColumn;

            using (var conexion = new DataModelFE())
            {
                foreach (var item in conexion.TipoDocumento.Where(x => x.estado == Estado.ACTIVO.ToString()).ToList())
                {
                    comboTipoDocumento.PropertiesComboBox.Items.Add(item.descripcion.Replace("ELECTRÓNICA", ""), item.codigo);
                }
                comboTipoDocumento.PropertiesComboBox.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
            }

            /* TIPO MONEDA */
            GridViewDataComboBoxColumn comboTipoMoneda = this.ASPxGridView1.Columns["moneda"] as GridViewDataComboBoxColumn;

            using (var conexion = new DataModelFE())
            {
                foreach (var item in conexion.TipoMoneda.Where(x => x.estado == Estado.ACTIVO.ToString()).ToList())
                {
                    comboTipoMoneda.PropertiesComboBox.Items.Add(item.descripcion, item.codigo);
                }
                comboTipoMoneda.PropertiesComboBox.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
            }
        }
Esempio n. 4
0
        public void BindData()
        {
            string planSO = txtPlanSO.Text;


            string _b = cdate1.Date.ToString("yyyyMMdd") + "000000";
            string _e = cdate2.Date.ToString("yyyyMMdd") + "235959";

            List <IMESCompleteInstoreEntity> entity = db.Fetch <IMESCompleteInstoreEntity>("where SERIAL between @0 and @1 order by AUFNR", _b, _e);

            if (!string.IsNullOrEmpty(planSO))
            {
                entity = (from s in entity where s.MATNR == planSO select s).ToList <IMESCompleteInstoreEntity>();
            }

            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();
        }
Esempio n. 5
0
        private DataTable fillGridCol()
        {
            int       noOfLec = new StdClass().getNoOfLec(int.Parse(ddlClasses.SelectedValue.ToString()));
            DataTable dt      = new StdClass().GetCourses(int.Parse(ddlClasses.SelectedValue.ToString()));
            DataTable table   = new DataTable();

            if (grid.Columns.Count != noOfLec)
            {
                GridViewDataComboBoxColumn x;
                GridViewDataComboBoxColumn ThisBool = new GridViewDataComboBoxColumn();
                for (int i = 1; i <= noOfLec; i++)
                {
                    table.Columns.Add("Lecture" + i.ToString(), typeof(String));
                    x = grid.Columns["Lecture" + i.ToString()] as GridViewDataComboBoxColumn;
                    if (x == null)
                    {
                        ThisBool              = new GridViewDataComboBoxColumn();
                        ThisBool.Caption      = "Lecture" + i.ToString();
                        ThisBool.FieldName    = "Lecture" + i.ToString();
                        ThisBool.Name         = "Lecture" + i.ToString();
                        ThisBool.VisibleIndex = i + 3;
                        ThisBool.PropertiesComboBox.DataSource = dt;
                        ThisBool.PropertiesComboBox.TextField  = "Name";
                        ThisBool.PropertiesComboBox.ValueField = "ID";
                        ThisBool.Visible = true;
                        grid.Columns.Add(ThisBool);
                    }
                }
            }
            return(table);
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack && !Page.IsCallback)
            {
                trMsg.Visible = false;
                trAbm.Visible = false;

                gvABM.SettingsBehavior.AllowSelectByRowClick    = true;
                gvABM.SettingsBehavior.AllowSelectSingleRowOnly = true;

                FormsHelper.InicializarPropsGrilla(gv);
                GridViewDataComboBoxColumn c = (GridViewDataComboBoxColumn)gvABM.Columns["DiaSemana"];
                FormsHelper.FillDias(c.PropertiesComboBox.Items);
            }

            gvABM.KeyFieldName             = "RecId";
            ASPxMenu1.ItemClick           += new DevExpress.Web.ASPxMenu.MenuItemEventHandler(ASPxMenu1_ItemClick);
            rbSemMes.AutoPostBack          = true;
            rbSemMes.SelectedIndexChanged += new EventHandler(rbSemMes_SelectedIndexChanged);


            RefreshGrid(gv);
            RefreshAbmGrid(gvABM);

            lblError.Text    = string.Empty;
            lblErrorDia.Text = string.Empty;
        }
Esempio n. 7
0
        protected void ASPxGridView2_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView grid = (ASPxGridView)sender;
            string       id   = grid.GetMasterRowFieldValues("PLAN_CODE").ToString();

            //string id = (sender as ASPxGridView).GetMasterRowKeyValue().ToString();

            //string sql = "select * from data_plan_standard_bom where plan_code='"+id+"'";
            //DataTable dt = dc.GetTable(sql);
            //List<PlanStandardBOMEntity> allEntity = db.Fetch<PlanStandardBOMEntity>("where plan_code=@0",id);
            DataTable            dataSource = dc.GetTable("select t.*,p.process_name,p.standard_machine_worktime,p.standard_man_worktime,p.machine_worktime_unit,p.man_worktime_unit from DATA_PLAN_BOM t left join DATA_PLAN_PROCESS p on t.process_code=p.process_code and t.plan_code=p.plan_code where t.plan_code='" + id + "'");
            List <PlanBomEntity> allEntity  = db.Fetch <PlanBomEntity>("where plan_code=@0 order by flag,item_code", id);

            grid.DataSource = dataSource;
            GridViewDataComboBoxColumn comboCol = grid.Columns["PLINE_CODE"] as GridViewDataComboBoxColumn;

            comboCol.PropertiesComboBox.DataSource = ProductLineFactory.GetAll();
            comboCol.PropertiesComboBox.ValueField = "RMES_ID";
            comboCol.PropertiesComboBox.TextField  = "PLINE_NAME";


            DataTable dt = new DataTable();

            dt.Columns.Add("VIEW");
            dt.Columns.Add("VALUE");
            dt.Rows.Add("新建", "N");
            dt.Rows.Add("已发料单", "B");
            dt.Rows.Add("部分收料", "R");
            dt.Rows.Add("已收料", "Y");
            GridViewDataComboBoxColumn colFlag = grid.Columns["FLAG"] as GridViewDataComboBoxColumn;

            colFlag.PropertiesComboBox.DataSource = dt;
            colFlag.PropertiesComboBox.ValueField = "VALUE";
            colFlag.PropertiesComboBox.TextField  = "VIEW";
        }
Esempio n. 8
0
        public void BindData()
        {
            string orderCode = txtOrderCode.Text;

            if (string.IsNullOrWhiteSpace(orderCode))
            {
                return;
            }
            List <SAPBOMEntity> entity = SAPBOMFactory.GetByOrderCode(orderCode);

            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();
        }
Esempio n. 9
0
        /// <summary>
        /// carga solo una vez para ahorar tiempo
        /// </summary>
        private void loadComboBox()
        {
            using (var conexion = new DataModelFE())
            {
                /* ESTADO */
                GridViewDataComboBoxColumn comboEstado = this.ASPxGridView1.Columns["estado"] as GridViewDataComboBoxColumn;
                comboEstado.PropertiesComboBox.Items.Clear();
                comboEstado.PropertiesComboBox.Items.AddRange(Enum.GetValues(typeof(Estado)));

                /* IDENTIFICACION TIPO */
                GridViewDataComboBoxColumn comboIdentificacionTipo = this.ASPxGridView1.Columns["identificacionTipo"] as GridViewDataComboBoxColumn;
                comboIdentificacionTipo.PropertiesComboBox.Items.Clear();
                foreach (var item in conexion.TipoIdentificacion.ToList())
                {
                    comboIdentificacionTipo.PropertiesComboBox.Items.Add(item.descripcion, item.codigo);
                }

                /* CODIGO PAIS */
                GridViewDataComboBoxColumn cmbEmisorTelefonoCod = this.ASPxGridView1.Columns["telefonoCodigoPais"] as GridViewDataComboBoxColumn;
                GridViewDataComboBoxColumn cmbEmisorFaxCod      = this.ASPxGridView1.Columns["faxCodigoPais"] as GridViewDataComboBoxColumn;
                cmbEmisorTelefonoCod.PropertiesComboBox.Items.Clear();
                cmbEmisorFaxCod.PropertiesComboBox.Items.Clear();
                foreach (var item in conexion.CodigoPais.Where(x => x.estado == Estado.ACTIVO.ToString()).ToList())
                {
                    cmbEmisorTelefonoCod.PropertiesComboBox.Items.Add(item.descripcion, item.codigo);
                    cmbEmisorFaxCod.PropertiesComboBox.Items.Add(item.descripcion, item.codigo);
                }
                cmbEmisorTelefonoCod.PropertiesComboBox.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
                cmbEmisorFaxCod.PropertiesComboBox.IncrementalFilteringMode      = IncrementalFilteringMode.Contains;
            }
        }
Esempio n. 10
0
        /// <summary>
        /// carga solo una vez para ahorar tiempo
        /// </summary>
        private void cargarCombos()
        {
            /* ESTADO */
            GridViewDataComboBoxColumn comboEstado = this.ASPxGridView1.Columns["estado"] as GridViewDataComboBoxColumn;

            comboEstado.PropertiesComboBox.Items.Clear();
            comboEstado.PropertiesComboBox.Items.AddRange(Enum.GetValues(typeof(Estado)));

            /* PRODUCTO */
            GridViewDataComboBoxColumn comboProducto = this.ASPxGridView1.Columns["idProducto"] as GridViewDataComboBoxColumn;

            comboProducto.PropertiesComboBox.Items.Clear();
            using (var conexion = new DataModelFE())
            {
                string emisor = Session["emisor"].ToString();
                foreach (var item in conexion.Producto.Where(x => x.emisor == emisor).Where(x => x.estado == Estado.ACTIVO.ToString()).ToList())
                {
                    comboProducto.PropertiesComboBox.Items.Add(item.descripcion, item.id);
                }
            }
            comboProducto.PropertiesComboBox.IncrementalFilteringMode = IncrementalFilteringMode.Contains;

            /* TIPO IMPUESTO */
            GridViewDataComboBoxColumn comboTipoImpuesto = this.ASPxGridView1.Columns["tipoImpuesto"] as GridViewDataComboBoxColumn;

            comboTipoImpuesto.PropertiesComboBox.Items.Clear();
            using (var conexion = new DataModelFE())
            {
                foreach (var item in conexion.TipoImpuesto.Where(x => x.estado == Estado.ACTIVO.ToString()).ToList())
                {
                    comboTipoImpuesto.PropertiesComboBox.Items.Add(item.descripcion, item.codigo);
                }
            }
            comboProducto.PropertiesComboBox.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
        }
Esempio n. 11
0
        public void BindData()
        {
            string projectCode = txtProjectCode.Text;

            if (string.IsNullOrEmpty(projectCode))
            {
                return;
            }
            List <SAPPlanEntity> entity = new List <SAPPlanEntity>(); //SAPPlanFactory.GetByOrderCode(orderCode);

            entity.AddRange(SAPPlanFactory.GetByProjectCode(projectCode));

            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();
        }
Esempio n. 12
0
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            _wbill_id = Convert.ToInt32((sender as ASPxGridView).GetMasterRowKeyValue());

            var wbd = _db.WaybillList.Find(_wbill_id);

            if (wbd != null)
            {
                if (wbd.Checked != 0)
                {
                    (sender as ASPxGridView).Columns["CommandCol"].Visible    = false;
                    (sender as ASPxGridView).SettingsDataSecurity.AllowDelete = false;
                    (sender as ASPxGridView).SettingsDataSecurity.AllowEdit   = false;
                    (sender as ASPxGridView).SettingsDataSecurity.AllowInsert = false;
                }
            }

            GridViewDataComboBoxColumn column = (sender as ASPxGridView).Columns["MatNameCol"] as GridViewDataComboBoxColumn;

            column.PropertiesComboBox.DataSource = _db.PriceList.Where(w => w.Kagent.Any(a => a.KaId == _ka_id)).SelectMany(sm => sm.PriceListDet).Select(s => new
            {
                s.MatId,
                Name = _db.Materials.FirstOrDefault(w => w.MatId == s.MatId).Name
            }).ToList();
        }
Esempio n. 13
0
    private void setCondition()
    {
        //绑定表数据
        userManager theUserManager = (userManager)Session["theUserManager"];

        theCompanyCode = theUserManager.getCompanyCode();
        string theUserId = theUserManager.getUserId();

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

        ASPxGridView1.DataSource = LineSideStockFactory.GetByWorkShopID(workShop[0].RMES_ID);

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

        col.PropertiesComboBox.DataSource = ProductLineFactory.GetAll();
        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();
    }
        protected void BindGrid()
        {
            var urun = db.S_Urunler().ToList();

            if (urun.Count > 0)
            {
                GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["UrunID"] as GridViewDataComboBoxColumn;
                combo.PropertiesComboBox.ValueType  = typeof(int);
                combo.PropertiesComboBox.DataSource = urun;
            }
            var tip = db.S_Tip(6).ToList();

            if (tip.Count > 0)
            {
                GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["Onay"] as GridViewDataComboBoxColumn;
                combo.PropertiesComboBox.ValueType  = typeof(int);
                combo.PropertiesComboBox.DataSource = tip;
            }
            ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName);
            string      bayiid     = curProfile.GetPropertyValue("BayiID").ToString();
            var         list       = db.S_Siparislerim(Convert.ToInt32(bayiid)).ToList();

            if (list.Count > 0)
            {
                EmployeesGrid.DataSource = list;
                EmployeesGrid.DataBind();
            }
        }
Esempio n. 15
0
        private void setCondition()
        {
            //绑定表数据
            List <StationSubEntity> allEntity = StationSubFactory.GetAll();

            List <string> plines = new List <string>();

            foreach (var p in allEntity)
            {
                if ((!plines.Contains(p.PLINE_CODE)) && (!string.IsNullOrWhiteSpace(p.PLINE_CODE)))
                {
                    plines.Add(p.PLINE_CODE);
                }
            }

            ASPxGridView1.DataSource = allEntity;
            GridViewDataComboBoxColumn colPline      = ASPxGridView1.Columns["PLINE_CODE"] as GridViewDataComboBoxColumn;
            List <ProductLineEntity>   plineEntities = ProductLineFactory.GetByIDs(plines.ToArray());

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

            ASPxGridView1.DataBind();
        }
    //end row command
    #endregion

    #region databinding
    /// <summary>
    /// populates combo box column(s) in datagrid
    /// </summary>
    protected void bind_target_combos()
    {
        //****************
        //priority codes 0 to 5
        //280113 changed to string and added new codes
        //bind combo in cell editor initialise event
        //WP – working prospect.  KP – Key prospect      PP – pending prospect  A – account  D – disregard
        //****************
        //for (int _ix = 0; _ix <= 5; _ix++)
        //{
        //    _combo.PropertiesComboBox.Items.Add(_ix.ToString(), _ix);
        //}

        string _path = AppDomain.CurrentDomain.BaseDirectory;

        _path += "xml\\ddl_items.xml";

        // pass _qryFilter to have keyword-filter RSS Feed
        // i.e. _qryFilter = XML -> entries with XML will be returned
        DataSet _ds = new DataSet();

        _ds.ReadXml(_path);
        DataView _dv = _ds.Tables[0].DefaultView;

        _dv.RowFilter = "ddls ='prioritycode'";

        //Run time population of GridViewDataComboBoxColumn column with data
        GridViewDataComboBoxColumn _combo = this.dxgrdTarget.Columns["colPriorityCode"] as GridViewDataComboBoxColumn;

        _combo.PropertiesComboBox.DataSource = _dv;
        _combo.PropertiesComboBox.ValueType  = typeof(int);
        _combo.PropertiesComboBox.TextField  = "name";
        _combo.PropertiesComboBox.ValueField = "value";
    }
Esempio n. 17
0
        private void setCondition()
        {
            //绑定表数据
            //string sql = "select t.RMES_ID,t.plineCODE,b.ROUTING_NAME,t.ITEMCODE,t.ITEMNAME,t.ITEMDESCRIPTION,t.MINVALUE,t.MAXVALUE,t.STANDARDVALUE,t.UNITNAME,decode(t.UNITTYPE,'N','数值','T','文字','B','判断','F','文件')UNITTYPE,t.ORDERING from qms_standard_item t "
            //    + " left join data_pline_routing b on t.plineCODE=b.ROUTING_CODE order by t.plineCODE,t.ITEMCODE";
            //DataTable dt = dc.GetTable(sql);
            List <DetectErrorItemEntity> entities = db.Fetch <DetectErrorItemEntity>("");

            ASPxGridView1.DataSource = entities;

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

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


            GridViewDataComboBoxColumn colworkUnit    = ASPxGridView1.Columns["WORKUNIT_CODE"] as GridViewDataComboBoxColumn;
            List <StationEntity>       statinEntities = StationFactory.GetAll();

            colworkUnit.PropertiesComboBox.DataSource = statinEntities;
            colworkUnit.PropertiesComboBox.ValueField = "WORKUNIT_CODE";
            colworkUnit.PropertiesComboBox.TextField  = "STATION_NAME";

            ASPxGridView1.DataBind();
        }
Esempio n. 18
0
        protected void BindGrid()
        {
            var urun = db.S_Urunler().ToList();

            if (urun.Count > 0)
            {
                GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["UrunID"] as GridViewDataComboBoxColumn;
                combo.PropertiesComboBox.ValueType  = typeof(int);
                combo.PropertiesComboBox.DataSource = urun;
            }
            var bayi = db.S_Bayi(-1).ToList();

            if (bayi.Count > 0)
            {
                GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["BayiID"] as GridViewDataComboBoxColumn;
                combo.PropertiesComboBox.ValueType  = typeof(int);
                combo.PropertiesComboBox.DataSource = bayi;
            }
            var tip = db.S_Tip(6).ToList();

            if (tip.Count > 0)
            {
                GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["Onay"] as GridViewDataComboBoxColumn;
                combo.PropertiesComboBox.ValueType  = typeof(int);
                combo.PropertiesComboBox.DataSource = tip;
            }
            var list = db.S_Siparisler(-1).ToList();

            if (list.Count > 0)
            {
                EmployeesGrid.DataSource = list;
                EmployeesGrid.DataBind();
            }
        }
Esempio n. 19
0
        /// <summary>
        /// carga solo una vez para ahorar tiempo
        /// </summary>
        private void cargarCombos()
        {
            // Cargar valores de combo para estado
            GridViewDataComboBoxColumn comboEstado = this.ASPxGridView1.Columns["estado"] as GridViewDataComboBoxColumn;

            comboEstado.PropertiesComboBox.Items.Clear();
            comboEstado.PropertiesComboBox.Items.AddRange(Enum.GetValues(typeof(Estado)));
        }
Esempio n. 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (isLoggedIn())
        {
            //check comapnyid if not publiship useer redirect to restricted version of this page
            Int32 _companyid = Page.Session["user"] != null ? (Int32)((UserClass)Page.Session["user"]).CompanyId : 0;
            if (_companyid != -1) //internal users are always companyid = -1
            {
                //new linq databinding
                //this method of using linq does not run in server mode, you MUST use a LinqServerModeDataSource
                //bind_linq_datasource();
                //running in server mode
                if (!Page.ClientScript.IsClientScriptBlockRegistered("lg_key"))
                {
                    register_client_scripts();
                }

                //bind gridview countries on page load
                GridViewDataComboBoxColumn _cbo = this.dxgrdorders.Columns["DestinationCountry"] as GridViewDataComboBoxColumn;
                if (_cbo != null)
                {
                    string _path = AppDomain.CurrentDomain.BaseDirectory;
                    _path += "xml\\country_iso.xml";

                    // pass _qryFilter to have keyword-filter RSS Feed
                    // i.e. _qryFilter = XML -> entries with XML will be returned
                    DataSet _ds = new DataSet();
                    _ds.ReadXml(_path);
                    DataView _dv = _ds.Tables[0].DefaultView;
                    //_dv.RowFilter = "ddls ='pallet'";

                    _cbo.PropertiesComboBox.DataSource = _dv;
                    _cbo.PropertiesComboBox.TextField  = "name";
                    _cbo.PropertiesComboBox.ValueField = "name";
                }

                this.dxgrdorders.DataBind();
                //show details by default?
                //this.dxgrdorders.DetailRows.ExpandAllRows();
            }
            else
            {
                if (!Page.IsCallback)
                {
                    Response.Redirect("~/publiship_advance/advance_audit.aspx", true);
                }
            }
            //using objectdatasource
            //this.LinqServerModePricer.Selecting += new EventHandler<DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs>(LinqServerModePricer_Selecting);
        }
        else
        {
            if (!Page.IsPostBack)
            {
                Response.Redirect("../user_accounts/signin.aspx?" + "rp=" + wwi_security.EncryptString("publiship_advance/advance_history", "publiship"));
            }
        }
    }
Esempio n. 21
0
        private void BindData()
        {
            List <SNBomEntity> entity = SNBomFactory.GetAll();

            if (orderCode.SelectedItem != null && !orderCode.SelectedItem.Value.ToString().Equals("All"))
            {
                entity = (from s in entity where s.ORDER_CODE.Equals(orderCode.SelectedItem.Value.ToString()) select s).ToList <SNBomEntity>();
            }
            if (planCode.SelectedItem != null && !planCode.SelectedItem.Value.ToString().Equals("All"))
            {
                entity = (from s in entity where s.PLAN_CODE.Equals(planCode.SelectedItem.Value.ToString()) select s).ToList <SNBomEntity>();
            }
            if (plineCode.SelectedItem != null && !plineCode.SelectedItem.Value.ToString().Equals("All"))
            {
                entity = (from s in entity where s.PLINE_CODE.Equals(plineCode.SelectedItem.Value.ToString()) select s).ToList <SNBomEntity>();
            }

            ASPxGridView1.DataSource = entity;

            List <string> orders = new List <string>();
            List <string> plans  = new List <string>();
            List <string> plines = new List <string>();

            foreach (var e in entity)
            {
                if ((!string.IsNullOrWhiteSpace(e.ORDER_CODE)) && (!orders.Contains(e.ORDER_CODE)))
                {
                    orders.Add(e.ORDER_CODE);
                }
                if ((!string.IsNullOrWhiteSpace(e.PLAN_CODE)) && (!plans.Contains(e.PLAN_CODE)))
                {
                    plans.Add(e.PLAN_CODE);
                }
                if ((!plines.Contains(e.PLINE_CODE)) && (!string.IsNullOrWhiteSpace(e.PLINE_CODE)))
                {
                    plines.Add(e.PLINE_CODE);
                }
            }
            GridViewDataComboBoxColumn colOrder = ASPxGridView1.Columns["ORDER_CODE"] as GridViewDataComboBoxColumn;

            colOrder.PropertiesComboBox.DataSource = orders;


            GridViewDataComboBoxColumn colPlan = ASPxGridView1.Columns["PLAN_CODE"] as GridViewDataComboBoxColumn;

            colPlan.PropertiesComboBox.DataSource = plans;

            GridViewDataComboBoxColumn colPline      = ASPxGridView1.Columns["PLINE_CODE"] as GridViewDataComboBoxColumn;
            List <ProductLineEntity>   plineEntities = ProductLineFactory.GetByIDs(plines.ToArray());

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



            ASPxGridView1.DataBind();
        }
Esempio n. 22
0
        protected void grvModunManager_DataBinding(object sender, EventArgs e)
        {
            GridViewDataComboBoxColumn column       = ((GridViewDataComboBoxColumn)(sender as ASPxGridView).Columns["Manager"]);
            SYS_UserService            _UserService = new SYS_UserService();

            column.PropertiesComboBox.DataSource = _UserService.SelectAllSYS_User_IsActive();
            column.PropertiesComboBox.TextField  = "UserName";
            column.PropertiesComboBox.ValueField = "ID";
        }
Esempio n. 23
0
        public void BindData()
        {
            string _b = cdate1.Date.ToString("yyyyMMdd") + "000000";
            string _e = cdate2.Date.ToString("yyyyMMdd") + "235959";
            List <IMESPlanProcessEntity> entity = db.Fetch <IMESPlanProcessEntity>("where SERIAL between @0 and @1 order by AUFNR", _b, _e);

            string planSO    = txtPlanSO.Text;
            string orderCode = "";

            if (!string.IsNullOrEmpty(planSO))
            {
                List <PlanEntity> plan = PlanFactory.GetByPlanSO(planSO);


                if (plan != null && plan.Count > 0)
                {
                    orderCode = plan[0].ORDER_CODE;
                }

                if (!string.IsNullOrEmpty(orderCode))
                {
                    entity = (from s in entity where s.AUFNR == orderCode select s).ToList <IMESPlanProcessEntity>();
                }
            }

            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";


            DataTable dt1 = new DataTable();

            dt1.Columns.Add("Text");
            dt1.Columns.Add("Value");
            dt1.Rows.Add("完成", "X");


            GridViewDataComboBoxColumn colPrind1 = ASPxGridView1.Columns["OPFLG"] as GridViewDataComboBoxColumn;

            colPrind1.PropertiesComboBox.DataSource = dt1;
            colPrind1.PropertiesComboBox.TextField  = "Text";
            colPrind1.PropertiesComboBox.ValueField = "Value";

            ASPxGridView1.DataBind();
        }
Esempio n. 24
0
        protected void ASPxGridView1_StartRowEditing(object sender, DevExpress.Web.Data.ASPxStartRowEditingEventArgs e)
        {
            string    sql = "select ID as TeacherID,Name as TeacherName from Std_Teacher inner join Std_TeacherCourses on TeacherID = ID where CourseID=" + e.EditingKeyValue.ToString();
            DataTable dt  = DataAccess.ExecuteSQLQuery(sql);
            GridViewDataComboBoxColumn regioncolumn = (ASPxGridView1.Columns["clTeacher"] as GridViewDataComboBoxColumn);

            regioncolumn.PropertiesComboBox.DataSource = dt;
            regioncolumn.PropertiesComboBox.ValueField = "TeacherID";
            regioncolumn.PropertiesComboBox.TextField  = "TeacherName";
        }
Esempio n. 25
0
        private void RefreshGrid(ASPxGridView gv)
        {
            GridViewDataComboBoxColumn c = (GridViewDataComboBoxColumn)gv.Columns["IdentifTecno"];

            c.PropertiesComboBox.TextField  = "Name";
            c.PropertiesComboBox.ValueField = "IdentifTecno";
            c.PropertiesComboBox.DataSource = Business.TecnologiaSoporte.ReadAll("");

            gv.DataSource = Business.MediosPublicitarios.ReadAllTipo("");
            gv.DataBind();
        }
        protected void BindGrid()
        {
            var list = db.S_Kullanici().ToList();

            if (list.Count > 0)
            {
                GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["UserID"] as GridViewDataComboBoxColumn;
                combo.PropertiesComboBox.ValueType  = typeof(Guid);
                combo.PropertiesComboBox.DataSource = list;
            }
        }
Esempio n. 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.AddClass, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/StudentAfair/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        StdClass sttclass = new StdClass();
                        sttclass.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        //txtNoOfStudent.Text=sttclass.
                        txtClassName.Text        = sttclass.Name;
                        ddlEdtYear.SelectedValue = sttclass.EdID.ToString();
                        if (sttclass.SupID != 0)
                        {
                            ddlSup.SelectedValue = sttclass.SupID.ToString();
                        }

                        ASPxGridView1.DataSource = sttclass.CoursesTeachers;
                        ASPxGridView1.DataBind();
                        string    sql = "select ID as TeacherID,Name as TeacherName from Std_Teacher ";
                        DataTable dt  = DataAccess.ExecuteSQLQuery(sql);
                        GridViewDataComboBoxColumn regioncolumn = (ASPxGridView1.Columns["clTeacher"] as GridViewDataComboBoxColumn);
                        regioncolumn.PropertiesComboBox.DataSource = dt;
                        regioncolumn.PropertiesComboBox.ValueField = "TeacherID";
                        regioncolumn.PropertiesComboBox.TextField  = "TeacherName";
                        Session["table"] = sttclass.CoursesTeachers;
                        btnSave.Visible  = false;
                        btnEdit.Visible  = true;
                    }
                    else
                    {
                        btnSave.Visible = true;
                        btnEdit.Visible = false;
                    }
                }
            }
            if (IsPostBack)
            {
                ASPxGridView1.DataSource = Session["table"];
                ASPxGridView1.DataBind();
            }
        }
        protected void BindGrid()
        {
            var tip = db.S_Tip(5).ToList();

            if (tip.Count > 0)
            {
                GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["DokumanTipi_TipID5"] as GridViewDataComboBoxColumn;
                combo.PropertiesComboBox.ValueType  = typeof(int);
                combo.PropertiesComboBox.DataSource = tip;
            }
        }
Esempio n. 29
0
        protected void gvMain_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            //get priority
            GridViewDataComboBoxColumn column = gvMain.Columns["PriorityID"] as GridViewDataComboBoxColumn;
            string priority = column.PropertiesComboBox.Items.FindByValue(e.NewValues["PriorityID"]).Text;
            //get last id
            string sql   = "SELECT MAX(ID) FROM base_ticket";
            string MAXID = DataBase.GetDT(sql).Rows[0][0].ToString();

            //update when and who created
            sql = "UPDATE base_ticket SET DateOpen = @DateOpen, OpenBy = @OpenBy WHERE (ID = @ID)";
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter()
                {
                    ParameterName = "@DateOpen", SqlDbType = SqlDbType.Date, Value = DateTime.Today.ToShortDateString()
                },
                new SqlParameter()
                {
                    ParameterName = "@OpenBy", SqlDbType = SqlDbType.NVarChar, Value = User.Identity.Name
                },
                new SqlParameter()
                {
                    ParameterName = "@ID", SqlDbType = SqlDbType.Int, Value = MAXID
                }
            };

            DataBase.UpdateDB(sp, sql);

            //send email to executive team
            gvMain.JSProperties["cpMessage"] = "Email sent to Amerinode Support at [email protected] for immediate processing.";
            Notifications.add("Q Ticket has been created", "<b>Q Ticket # " + MAXID + "</b> has just been created in Q by " + User.Identity.Name + ".<br/>"
                              + "Login into Q and change its Status to PROCEED as an authorization for IT to proceed with implementation.<br/>"
                              + "Description: " + e.NewValues["Description"].ToString() + "<br/>"
                              + "Priority: " + priority + "<br/>"
                              + "Customer Impacting: " + e.NewValues["CustomerImpacting"].ToString()
                              , "*****@*****.**", "*****@*****.**", -1);
            //re-enable columns
            gvMain.Columns["StatusID"].Visible      = true;
            gvMain.Columns["DateOpen"].Visible      = true;
            gvMain.Columns["DateClose"].Visible     = true;
            gvMain.Columns["OpenBy"].Visible        = true;
            gvMain.Columns["CloseBy"].Visible       = true;
            gvMain.Columns["ApprovedBy"].Visible    = true;
            gvMain.Columns["QVersion"].Visible      = true;
            gvMain.Columns["Resolution"].Visible    = true;
            gvMain.Columns["CloseApproved"].Visible = true;
            gvMain.Columns["Files"].Visible         = true;
            if (Session["tempDir"] != null)
            {
                changePath(MAXID);
            }
        }
Esempio n. 30
0
 /// <summary>
 /// carga solo una vez para ahorar tiempo
 /// </summary>
 private void loadComboBox()
 {
     using (var conexion = new DataModelFE())
     {
         /* TIPO DOCUMENTO */
         GridViewDataComboBoxColumn comboTipoDocumento = this.ASPxGridView1.Columns["tipoDocumento"] as GridViewDataComboBoxColumn;
         foreach (var item in conexion.TipoDocumento.Where(x => x.estado == Estado.ACTIVO.ToString()).ToList())
         {
             comboTipoDocumento.PropertiesComboBox.Items.Add(item.descripcion.Replace("FACTURA ELECTRÓNICA", "PROFORMA"), item.codigo);
         }
     }
 }
Esempio n. 31
0
        internal static GridViewDataComboBoxColumn BuildComboColumn(string caption, string fieldName, BusinessMapper.eEntities entity)
        {
            GridViewDataComboBoxColumn gvc = new GridViewDataComboBoxColumn();

            gvc.Name = fieldName;
            gvc.Caption = caption;
            gvc.FieldName = fieldName;

            var mapInfo = BusinessMapper.GetMapInfo(entity.ToString());

            gvc.PropertiesComboBox.TextField = mapInfo.EntityTextField;
            gvc.PropertiesComboBox.ValueField = mapInfo.EntityValueField;
            gvc.PropertiesComboBox.DataSource = mapInfo.DAOHandler.ReadAll("");

            return gvc;
        }
Esempio n. 32
0
        internal static GridViewDataComboBoxColumn BuildComboColumn(string caption, string fieldName, params string[] items)
        {
            GridViewDataComboBoxColumn gvc = new GridViewDataComboBoxColumn();

            gvc.Name = fieldName;
            gvc.Caption = caption;
            gvc.FieldName = fieldName;

            gvc.PropertiesComboBox.Items.Clear();
            for (int i = 0; i < items.Length; i+=2)
            {
                gvc.PropertiesComboBox.Items.Add(items[i], items[i+1]);
            }

            return gvc;
        }
Esempio n. 33
0
        internal static void BuildColumnsByEntity(BusinessMapper.eEntities entidad, ASPxGridView gv)
        {
            if (BusinessMapper.AbmConfigXmlPath == null || BusinessMapper.AbmConfigXmlPath == string.Empty)
                throw new Exception("Path del archivo AbmConfig.xml sin definir.");

            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(BusinessMapper.AbmConfigXmlPath);

            gv.Columns.Clear();

            if (xDoc.SelectSingleNode(
                "Entities/Entity[@EntityName='" + entidad.ToString() + "']") == null)
                throw new AbmConfigXMLException("No existe la configuración de mapeo para la entidad: " + entidad.ToString());

            foreach (XmlNode nodeControl in xDoc.SelectSingleNode(
                "Entities/Entity[@EntityName='" + entidad.ToString() + "']").ChildNodes)
            {

                if (nodeControl.Attributes["ControlType"].Value == "ComboBox")
                {
                    GridViewDataComboBoxColumn gvc = new GridViewDataComboBoxColumn();

                    gvc.Name = nodeControl.Attributes["FieldName"].Value;
                    gvc.Caption = nodeControl.Attributes["Title"].Value;
                    gvc.FieldName = nodeControl.Attributes["FieldName"].Value;

                    var mapInfo = BusinessMapper.GetMapInfo(nodeControl.Attributes["EntityName"].Value);

                    gvc.PropertiesComboBox.TextField = mapInfo.EntityTextField;
                    gvc.PropertiesComboBox.ValueField = mapInfo.EntityValueField;
                    gvc.PropertiesComboBox.DataSource = mapInfo.DAOHandler.ReadAll("");

                    gv.Columns.Add(gvc);
                }
                else if (nodeControl.Attributes["ControlType"].Value == "RadioButtonList")
                {
                    GridViewDataComboBoxColumn gvc = new GridViewDataComboBoxColumn();

                    gvc.Name = nodeControl.Attributes["FieldName"].Value;
                    gvc.Caption = nodeControl.Attributes["Title"].Value;
                    gvc.FieldName = nodeControl.Attributes["FieldName"].Value;

                    gvc.PropertiesComboBox.Items.Clear();
                    foreach (XmlNode item in nodeControl.ChildNodes[0].ChildNodes)
                    {
                        gvc.PropertiesComboBox.Items.Add(item.Attributes["Name"].Value, item.Attributes["Value"].Value);
                    }

                    gv.Columns.Add(gvc);
                }
                else if (nodeControl.Attributes["ControlType"].Value == "TextBox"
                    || nodeControl.Attributes["ControlType"].Value == "SpinEdit"
                    || nodeControl.Attributes["ControlType"].Value == "TimeEdit")
                {
                    GridViewDataTextColumn gvc = new GridViewDataTextColumn();

                    gvc.Name = nodeControl.Attributes["FieldName"].Value;
                    gvc.Caption = nodeControl.Attributes["Title"].Value;
                    gvc.FieldName = nodeControl.Attributes["FieldName"].Value;

                    gv.Columns.Add(gvc);
                }
                else if (nodeControl.Attributes["ControlType"].Value == "DateEdit")
                {
                    GridViewDataDateColumn gvc = new GridViewDataDateColumn();

                    gvc.Name = nodeControl.Attributes["FieldName"].Value;
                    gvc.Caption = nodeControl.Attributes["Title"].Value;
                    gvc.FieldName = nodeControl.Attributes["FieldName"].Value;

                    gv.Columns.Add(gvc);
                }
                else if (nodeControl.Attributes["ControlType"].Value == "CheckBox")
                {
                    GridViewDataCheckColumn gvc = new GridViewDataCheckColumn();

                    gvc.Name = nodeControl.Attributes["FieldName"].Value;
                    gvc.Caption = nodeControl.Attributes["Title"].Value;
                    gvc.FieldName = nodeControl.Attributes["FieldName"].Value;

                    gv.Columns.Add(gvc);
                }
            }
        }