Ejemplo n.º 1
0
        protected void gvTranscriptTertiaryDetails_BeforePerformDataSelect(object sender, EventArgs e)
        {
            ASPxGridView gv         = (ASPxGridView)sender;
            int          batchId    = int.Parse(gv.GetMasterRowFieldValues("BatchId").ToString());
            string       studuserId = gv.GetMasterRowFieldValues("StuduserId").ToString();
            int          gradesysId = int.Parse(gv.GetMasterRowFieldValues("xGsId").ToString());

            gv.DataSource = new StudentLessonsRegistrationService().GetStudentExamsResults(batchId, studuserId, gradesysId, new SessionManager().GetUserId(this.Session));
        }
    protected void detail_DataBinding(object sender, EventArgs e)
    {
        ASPxGridView grid = (ASPxGridView)sender;

        // Determine components of a composite key
        string firstNameKey = grid.GetMasterRowFieldValues("FirstName").ToString();
        string lastNameKey  = grid.GetMasterRowFieldValues("LastName").ToString();

        grid.DataSource = DataProvider.CreateDetailData(firstNameKey, lastNameKey);
    }
Ejemplo n.º 3
0
        //显示分配流水
        protected void ASPxGridView3_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView grid      = (ASPxGridView)sender;
            string       planCode  = grid.GetMasterRowFieldValues("PLAN_CODE").ToString();
            string       plineCode = grid.GetMasterRowFieldValues("PLINE_CODE").ToString();

            string    sql    = "SELECT * FROM DATA_PLAN_SN WHERE PLAN_CODE = '" + planCode + "' AND PLINE_CODE = '" + plineCode + "'";
            DataTable snDist = dc.GetTable(sql);

            grid.DataSource = snDist;
            //grid.DataBind();
        }
Ejemplo n.º 4
0
        protected void ASPxGridView2_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView grid      = (ASPxGridView)sender;
            string       planCode  = grid.GetMasterRowFieldValues("JHDM").ToString();
            string       plineCode = grid.GetMasterRowFieldValues("GZDD").ToString();

            string sql = "SELECT * FROM vw_data_plan_standard_bom_log WHERE PLAN_CODE = '" + planCode + "' AND PLINE_CODE = '" + plineCode + "' "
                         + " and (process_code is null or item_code is null or item_name is null or  process_code is null or station_code is null) ORDER BY location_code,process_code,item_code  ";

            DataTable planBom = dc.GetTable(sql);

            grid.DataSource = planBom;
        }
Ejemplo n.º 5
0
    } //end shipment size data select

    /// <summary>
    /// detail grid for costing 1 (pre-palletised)
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void costing1_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxGridView _detail = (ASPxGridView)sender;

        //11/11/2010 can't use the ordernumber as keyfield on grid cause it might not be unique
        //have to get row value
        //Int32 _ordernumber = (Int32)_detail.GetMasterRowKeyValue();  //(sender as ASPxGridView).GetMasterRowKeyValue();
        String[] _keys    = { "quote_Id" };
        Int32    _quoteid = (Int32)_detail.GetMasterRowFieldValues(_keys);

        if (_quoteid > 0)
        {
            //var _nquery = new linq_pricerDataContext().costing_summaries.Where(c => c.quote_Id == _quoteid && c.summary_type == "pre-palletised");
            //var _nquery = from c in new linq_pricerDataContext().costing_summaries
            //              where c.quote_Id == _quoteid && c.summary_type == "pre-palletised"
            //              select c;
            ////int _count = _nquery.Count();
            //_detail.DataSource = _nquery;

            //datareader is faster?
            SubSonic.SqlQuery _query = DAL.Pricer.DB.Select().From(DAL.Pricer.Tables.CostingSummary).WhereExpression("quote_id").IsEqualTo(_quoteid).And("summary_type").IsEqualTo("pre-palletised");
            IDataReader       _rd    = _query.ExecuteReader();
            DataTable         _dt    = new DataTable();
            _dt.Load(_rd);
            _detail.DataSource = _dt;
            _rd.Close();
        }
    } //end costing1 data select
Ejemplo n.º 6
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";
        }
Ejemplo n.º 7
0
        //显示物料清单
        protected void ASPxGridView2_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView grid      = (ASPxGridView)sender;
            string       planCode  = grid.GetMasterRowFieldValues("PLAN_CODE").ToString();
            string       plineCode = grid.GetMasterRowFieldValues("PLINE_CODE").ToString();

            string sql = "SELECT * FROM DATA_PLAN_STANDARD_BOM WHERE PLAN_CODE = '" + planCode + "' AND PLINE_CODE = '" + plineCode + "'";
            //string sql = "SELECT A.RMES_ID,A.COMPANY_CODE,A.PLAN_CODE,A.PLINE_CODE,"
            //    +"(SELECT B.LOCATION_NAME FROM CODE_LOCATION B WHERE B.LOCATION_CODE = (SELECT A.LOCATION_CODE FROM DATA_PLAN_STANDARD_BOM A"
            //    + " WHERE A.PLAN_CODE = '" + planCode + "' AND A.PLINE_CODE = '" + plineCode + "')) AS LOCATION_NAME,A.PROCESS_CODE,A.PROCESS_SEQ,A.ITEM_CODE,"
            //    + "A.ITEM_NAME,A.ITEM_QTY,A.ITEM_CLASS,A.ITEM_TYPE,A.VENDOR_CODE,A.CREATE_TIME,A.CREATE_USERID FROM DATA_PLAN_STANDARD_BOM A"
            //    + " WHERE A.PLAN_CODE = '" + planCode + "' AND A.PLINE_CODE = '" + plineCode + "'";
            DataTable planBom = dc.GetTable(sql);

            grid.DataSource = planBom;
            //grid.DataBind();
        }
Ejemplo n.º 8
0
        //显示detailrow
        //根据GHTM从dp_rckwcb取数据
        protected void fpSpDetail_detail_BeforePerformDataSelect(object sender, EventArgs e)
        {
            ASPxGridView gridDetail     = (ASPxGridView)sender;
            string       GV_CurrentGhtm = gridDetail.GetMasterRowFieldValues("GHTM").ToString();
            string       detailSql      = "select ghtm,so,ygmc,rklx,rkdate,gzrq,gzdd,rc,SourcePlace,Destination,BatchId,Ch from dp_rckwcb"
                                          + " where GHTM='" + GV_CurrentGhtm + "' order by gzrq,rkdate";

            DataTable detailDT = dc.GetTable(detailSql);

            gridDetail.DataSource = detailDT;
        }
Ejemplo n.º 9
0
        protected void gvUsersInRole_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsDataSecurity.AllowInsert    = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsDataSecurity.AllowEdit      = false;
            gridview.SettingsDataSecurity.AllowDelete    = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsEditing.EditFormColumnCount = 2;
            gridview.SettingsText.Title      = $"USERS IN ROLE ({gridview.GetMasterRowFieldValues("rolename").ToString()})";
            gridview.SettingsExport.FileName = $"UserInRole_{DateTime.Now.ToString("yyyyMMdd")}";
            GridViewUtils.GridViewToolbarInit(sender, e);
        }
Ejemplo n.º 10
0
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView gvDetail = (ASPxGridView)sender;

            gvDetail.DataSource = CRUDHelper.ReadAll(string.Format("IdentifFrecuencia = '{0}'", gvDetail.GetMasterRowFieldValues("IdentifFrecuencia")), BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.FrecuenciaDet));

            gvDetail.Columns["IdentifFrecuencia"].Visible = false;

            string semMes = Convert.ToString(gvDetail.GetMasterRowFieldValues("SemMes"));

            gvDetail.Columns["DiaSemana"].Visible = (semMes.Trim().ToLower() == "semana");
            gvDetail.Columns["Dia"].Visible       = (semMes.Trim().ToLower() != "semana");
        }
    //end bind target combos

    protected void grdHistory_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxGridView _history = (ASPxGridView)sender;

        //11/11/2010 can't use the ordernumber as keyfield on grid cause it might not be unique
        //have to get row value
        //Int32 _ordernumber = (Int32)_detail.GetMasterRowKeyValue();  //(sender as ASPxGridView).GetMasterRowKeyValue();
        String[] _keys     = { "TargetID" };
        Int32    _targetid = (Int32)_history.GetMasterRowFieldValues(_keys);

        if (_targetid > 0)
        {
            this.objdsTargetHistory.SelectParameters["TargetID"].DefaultValue = _targetid.ToString();
        }
    }
    //end current cartons databind


    protected void grdcartons_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxGridView _cartons = (ASPxGridView)sender;

        //11/11/2010 can't use the ordernumber as keyfield on grid cause it might not be unique
        //have to get row value
        //Int32 _ordernumber = (Int32)_detail.GetMasterRowKeyValue();  //(sender as ASPxGridView).GetMasterRowKeyValue();
        String[] _keys    = { "PATitleID" };
        Int32    _titleid = (Int32)_cartons.GetMasterRowFieldValues(_keys);

        if (_titleid > 0)
        {
            objdsCartons.SelectParameters["PATitleID"].DefaultValue = _titleid.ToString();
        }
    }
Ejemplo n.º 13
0
        protected void gvUsersInRole_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView gridview    = sender as ASPxGridView;
            var          newRoleName = gridview.GetMasterRowFieldValues("rolename").ToString().ToLower();
            var          newUsername = Utils.ConvertToTrimmedString(e.NewValues["username"]);

            if (newRoleName == null ||
                newUsername == null)
            {
                throw new Exception("Complete all fields!");
            }

            newRoleName = newRoleName.ToLower();
            newUsername = newUsername.ToLower();

            UserManagement.UserAddRole(newUsername, newRoleName);
        }
Ejemplo n.º 14
0
    //end bind data grid
    /// <summary>
    /// databiding for child grid showing pallet identifiers
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgridPalletIds_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxGridView _detail = (ASPxGridView)sender;

        //11/11/2010 can't use the ordernumber as keyfield on grid cause it might not be unique
        //have to get row value
        //Int32 _ordernumber = (Int32)_detail.GetMasterRowKeyValue();  //(sender as ASPxGridView).GetMasterRowKeyValue();
        String[] _keys   = { "item_id" };
        int      _itemid = (int)_detail.GetMasterRowFieldValues(_keys);

        if (_itemid > 0)
        {
            //datareader much faster than bulding a strongly typed collection
            string[]  _cols = { "pallet_id", "sscc", "pallet_type" };
            DataTable _dt   = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.DespatchNotePalletId).
                              Where(DAL.Logistics.DespatchNotePalletId.DespatchItemIdColumn).IsEqualTo(_itemid).ExecuteDataSet().Tables[0];

            _detail.DataSource = _dt; //_sb.DefaultView;
            //_detail.DataBind(); //don't call this or details view will not work
        }
    }
Ejemplo n.º 15
0
    //end remove pod
    /// <summary>
    /// detail grid for shipment size
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void shipment_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxGridView _detail = (ASPxGridView)sender;

        //11/11/2010 can't use the ordernumber as keyfield on grid cause it might not be unique
        //have to get row value
        //Int32 _ordernumber = (Int32)_detail.GetMasterRowKeyValue();  //(sender as ASPxGridView).GetMasterRowKeyValue();
        String[] _keys    = { "quote_Id" };
        Int32    _quoteid = (Int32)_detail.GetMasterRowFieldValues(_keys);

        if (_quoteid > 0)
        {
            //var _nquery = new linq_pricerDataContext().shipment_sizes.Where(c => c.quote_id == _quoteid);
            //_detail.DataSource = _nquery;
            SubSonic.SqlQuery _query = DAL.Pricer.DB.Select().From(DAL.Pricer.Tables.ShipmentSize).WhereExpression("quote_id").IsEqualTo(_quoteid);
            IDataReader       _rd    = _query.ExecuteReader();
            DataTable         _dt    = new DataTable();
            _dt.Load(_rd);
            _detail.DataSource = _dt;
            _rd.Close();
        }
    } //end shipment size data select
Ejemplo n.º 16
0
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView gvDetail = (ASPxGridView)sender;

            gvDetail.DataSource = Business.PiezasArte.ReadAllProductos((string)gvDetail.GetMasterRowFieldValues("IdentifPieza"));
        }
Ejemplo n.º 17
0
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView gvDetail = (ASPxGridView)sender;

            if (gvDetail.ID.ToUpper() == "detailGridFrecuencia".ToUpper() || gvDetail.ID.ToUpper() == "detailGridFrecuenciaVer".ToUpper())
            {
                gvDetail.Columns.Clear();

                gvDetail.Columns.Add(new GridViewDataColumn("Dia", "Día"));
                gvDetail.Columns.Add(new GridViewDataComboBoxColumn()
                {
                    Caption = "Día Semana", FieldName = "DiaSemana"
                });
                gvDetail.Columns.Add(new GridViewDataTimeEditColumn()
                {
                    Caption = "Hora Desde", FieldName = "HoraDesde"
                });
                gvDetail.Columns.Add(new GridViewDataTimeEditColumn()
                {
                    Caption = "Hora Hasta", FieldName = "HoraHasta"
                });
                gvDetail.Columns.Add(new GridViewDataColumn("Costo", "Costo"));

                FormsHelper.FillDias((gvDetail.Columns["DiaSemana"] as GridViewDataComboBoxColumn).PropertiesComboBox.Items);

                if (gvDetail.ID.ToUpper() == "detailGridFrecuencia".ToUpper())
                {
                    gvDetail.DataSource = Business.Costos.ReadAllFrecuencia((string)gvDetail.GetMasterRowFieldValues("IdentifEspacio"),
                                                                            (DateTime)gvDetail.GetMasterRowFieldValues("VigDesde"),
                                                                            (DateTime)gvDetail.GetMasterRowFieldValues("VigHasta"));
                }
                else
                {
                    gvDetail.DataSource = Business.Costos.ReadAllFrecuenciaVersiones((string)gvDetail.GetMasterRowFieldValues("IdentifEspacio"),
                                                                                     (DateTime)gvDetail.GetMasterRowFieldValues("VigDesde"),
                                                                                     (DateTime)gvDetail.GetMasterRowFieldValues("VigHasta"),
                                                                                     (decimal)gvDetail.GetMasterRowFieldValues("Version"));
                }
            }

            if (gvDetail.ID.ToUpper() == "detailGridProveedor".ToUpper() || gvDetail.ID.ToUpper() == "detailGridProveedorVer".ToUpper())
            {
                gvDetail.Columns.Clear();

                gvDetail.Columns.Add(FormsHelper.BuildComboColumn("Proveedor", "IdentifProv", BusinessMapper.eEntities.Proveedor));
                gvDetail.Columns.Add(FormsHelper.BuildComboColumn("Categoría de Costo", "Categoria", "Directo", "DIRECTO", "Indirecto", "INDIRECTO"));
                gvDetail.Columns.Add(new GridViewDataCheckColumn()
                {
                    Caption = "Incluido en Orden Publicidad", FieldName = "IncluidoOP"
                });
                gvDetail.Columns.Add(new GridViewDataCheckColumn()
                {
                    Caption = "Estimado", FieldName = "Estimado"
                });
                gvDetail.Columns.Add(FormsHelper.BuildComboColumn("Tipo de Costo", "TipoCosto", "Fijo Mensual", "FIJO_MENSUAL", "Segundo Fijo", "SEGUNDO_FIJO", "Unidad Pautada", "UNIDAD_PAUTADA"));
                gvDetail.Columns.Add(FormsHelper.BuildComboColumn("Moneda", "IdentifMon", BusinessMapper.eEntities.Monedas));
                gvDetail.Columns.Add(new GridViewDataColumn("GrossingUp", "Grossing Up"));
                gvDetail.Columns.Add(new GridViewDataColumn("Costo", "Costo"));

                if (gvDetail.ID.ToUpper() == "detailGridProveedor".ToUpper())
                {
                    gvDetail.DataSource = Business.Costos.ReadAllProveedor((string)gvDetail.GetMasterRowFieldValues("IdentifEspacio"), (DateTime)gvDetail.GetMasterRowFieldValues("VigDesde"), (DateTime)gvDetail.GetMasterRowFieldValues("VigHasta"));
                }

                else
                {
                    gvDetail.DataSource = Business.Costos.ReadAllProveedorVersiones((string)gvDetail.GetMasterRowFieldValues("IdentifEspacio"), (DateTime)gvDetail.GetMasterRowFieldValues("VigDesde"), (DateTime)gvDetail.GetMasterRowFieldValues("VigHasta"), (decimal)gvDetail.GetMasterRowFieldValues("Version"));
                }
            }
        }
Ejemplo n.º 18
0
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView gvDetail = (ASPxGridView)sender;

            gvDetail.DataSource = Business.Avisos.ReadAllAtencion((string)gvDetail.GetMasterRowFieldValues("IdentifAviso"));
        }
Ejemplo n.º 19
0
    protected void grd_CostDet_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxGridView grd = sender as ASPxGridView;

        dsCostDet.FilterExpression = "ParentId='" + SafeValue.SafeString(grd.GetMasterRowFieldValues("SequenceId")) + "'";
    }
Ejemplo n.º 20
0
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView gvDetail = (ASPxGridView)sender;

            gvDetail.DataSource = Business.Monedas.ReadAllTiposCambio((string)gvDetail.GetMasterRowFieldValues("IdentifMon"));
        }
Ejemplo n.º 21
0
    protected void dxgrid_OnRowInserting(object sender, ASPxDataInsertingEventArgs e)
    {
        ASPxGridView gv = (ASPxGridView)sender;

        e.NewValues.Add("HouseholdID", Request.QueryString["hhID"]);
        e.NewValues.Add("studyID", Master.Master_studyID.ToString());

        int       newgroupID = -1;
        int       staffID    = -1;
        int       labID      = -1;
        SQL_utils sql        = new SQL_utils("backend");

        if (gv.ClientInstanceName == "grid_tblgroup")
        {
            newgroupID             = sql.IntScalar_from_SQLstring("select max(groupID) + 1 from tblGroup");
            staffID                = sql.IntScalar_from_SQLstring("select sec.systemuser_staffID()");
            labID                  = sql.IntScalar_from_SQLstring("select labID from tblStudy where studyID=" + Master.Master_studyID.ToString());
            e.NewValues["groupID"] = newgroupID;
        }

        if (gv.ClientInstanceName == "grid_tblSSD")
        {
            int ssID = Convert.ToInt32(gv.GetMasterRowFieldValues("ssID").ToString());
            if (ssID > 0)
            {
                e.NewValues["ssID"] = ssID;
            }
        }


        DxDbOps.BuildInsertSqlCode(e, GridnameToTable(gv.ClientInstanceName), "backend");


        if (gv.ClientInstanceName == "grid_tblgroup")
        {
            if (newgroupID > 0 & staffID > 0 & labID > 0)
            {
                // Add the group to this lab
                string sqlcode = String.Format("insert into tbllabgroup(groupID, labID, labgroup_enabled) values({0},{1},{2})"
                                               , newgroupID.ToString(), labID, "1");
                sql.NonQuery_from_SQLstring(sqlcode);

                int labgroupID = sql.IntScalar_from_SQLstring(String.Format("select labgroupID from tbllabgroup where groupID={0} and labID={1}", newgroupID, labID));

                if (labgroupID > 0)
                {
                    // Add the group to this staff
                    string sqlcode2 = String.Format("insert into tbllabgroup_staff(StaffID, LabGroupID , DBroleID) values({0}, {1}, {2})"
                                                    , staffID, labgroupID, "1");
                    sql.NonQuery_from_SQLstring(sqlcode2);
                }
            }
        }


        ((ASPxGridView)sender).JSProperties["cpIsUpdated"] = gv.ClientInstanceName.ToString();
        gv.CancelEdit();
        e.Cancel = true;

        RefreshGrids();
    }