Exemplo n.º 1
0
        protected override void OnDataExpand(GridViewData data)
        {
            if (data.IsExpand)
            {
                return;
            }
            AssetDependencyData adData = data.GetData <AssetDependencyData>();

            if (adData.directlyDepends != null && adData.directlyDepends.Length > 0)
            {
                for (int i = 0; i < adData.directlyDepends.Length; ++i)
                {
                    string assetPath = adData.directlyDepends[i];

                    if (IsAssetIgnored(assetPath))
                    {
                        continue;
                    }

                    AssetDependencyData childADData = AssetDependencyUtil.GetDependencyData(assetPath);
                    var childData = new GridViewData(assetPath, childADData);
                    AddChildData(data, childData);
                }
            }
        }
Exemplo n.º 2
0
        /*
         * Select all the column names for the selected table
         */
        protected void ListBoxTables_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Sets the array count variable makes sure index is not -1.
            if (ListBoxTables.SelectedIndex >= 0)
            {
                // clear current query
                GridViewData.DataSource = null;
                GridViewData.DataBind();

                // list selected table: to be removed
                //Label1.Text = ListBoxTables.SelectedItem.ToString();

                string sQueryText = "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '" +
                                    ListBoxTables.SelectedItem.ToString() + "'ORDER BY ORDINAL_POSITION";

                // execute query
                SQLManager manager  = new SQLManager(sSelectedDB);
                DataTable  objTable = new DataTable();

                // handle errors
                //if (manager.GetQueryResult(sQueryText) == null)
                //{
                //    HandleQueryError();
                //    return;
                //}

                objTable.Load(manager.GetQueryResult(sQueryText));
                GridViewMain.DataSource = objTable;
                GridViewMain.DataBind();
                manager.CloseConnection();
            }
        }
        private void BindDataByReview()
        {
            DataTable dt = UrlHtmlUtil.GetTEnrolInfo(UserNo);//传评审人ID进去,返回对应评审信息

            GridViewData.DataSource = dt;
            GridViewData.DataBind();
        }
Exemplo n.º 4
0
 private static void ExportXCP(string targetPath, RadGridView gridView, GridViewData gridData,
                               XcpData xcpData)
 {
     A2lDetailData(targetPath, gridView, gridData);
     AddA2lDetailGroup(gridData, targetPath, xcpData);
     AddCanChInfo(targetPath, xcpData, null, ProtocolType.XCP_CCP);
 }
Exemplo n.º 5
0
        protected override void OnDataExpand(GridViewData data)
        {
            DSData dsData = data.GetData <DSData>();

            if (dsData.isDir)
            {
                string[] files = Directory.GetFiles(dsData.path, "*.*", SearchOption.TopDirectoryOnly);
                string[] dirs  = Directory.GetDirectories(dsData.path, "*", SearchOption.TopDirectoryOnly);
                if (dirs != null && dirs.Length > 0)
                {
                    foreach (var dir in dirs)
                    {
                        AddChildData(data, new GridViewData(dir, new DSData()
                        {
                            path  = dir,
                            isDir = true,
                        }));
                    }
                }

                if (files != null && files.Length > 0)
                {
                    foreach (var file in files)
                    {
                        AddChildData(data, new GridViewData(file, new DSData()
                        {
                            path  = file,
                            isDir = false,
                        }));
                    }
                }
            }
        }
Exemplo n.º 6
0
 public void FocusInDataGridVie(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up)
     {
         GridViewData.Focus();
     }
 }
Exemplo n.º 7
0
 private void btn_Save_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 38 || e.KeyValue == 40)//38=up 40=douwn
     {
         GridViewData.Focus();
     }
 }
Exemplo n.º 8
0
        protected override void OnItemDoubleClicked(GridViewData itemData)
        {
            AssetDependencyData adData = itemData.GetData <AssetDependencyData>();

            SelectionUtility.PingObject(adData.assetPath);
            SelectionUtility.ActiveObject(adData.assetPath);
        }
Exemplo n.º 9
0
    protected void BindData()
    {
        SqlConnection connect = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);

        connect.Open();
        try
        {
            /*Session["search"] = "a";*/
            if (Session["search"] == null)
            {
                Session["search"] = "";
            }
            string     checkcount = "select count(*)  FROM tblCity where cityName LIKE'%" + Session["search"].ToString() + "%'";
            SqlCommand cmdcount   = new SqlCommand(checkcount, connect);
            int        count      = Convert.ToInt32(cmdcount.ExecuteScalar().ToString());
            if (count == 0)
            {
                lblInfo.Text = "Sorry, No such Result Found by name : " + Session["search"];
                Response.Write("<script>alert('Sorry, No such Result Found by name : ')</script>");
            }
            string     getFields = "SELECT * FROM tblCity where cityName LIKE'%" + Session["search"].ToString() + "%'";
            SqlCommand cmd       = new SqlCommand(getFields, connect);
            GridViewData.DataSource = cmd.ExecuteReader();
            GridViewData.DataBind();
            connect.Close();
        }
        catch (Exception ex)
        {
            lblInfo.Text = "Some Error Occured";
        }
    }
Exemplo n.º 10
0
        protected override void OnDrawColumnItem(Rect rect, int columnIndex, GridViewData columnItemData)
        {
            LogData logData = columnItemData.Userdata as LogData;

            Color textColor = Color.white;

            if (m_LogColorDic.TryGetValue(logData.Level, out textColor))
            {
            }
            EGUI.BeginGUIColor(textColor);
            {
                if (columnIndex == 0)
                {
                    GUI.Label(rect, logData.Level.ToString());
                }
                else if (columnIndex == 1)
                {
                    GUI.Label(rect, new DateTime(logData.Time).ToString());
                }
                else if (columnIndex == 2)
                {
                    GUI.Label(rect, logData.Tag);
                }
                else if (columnIndex == 3)
                {
                    GUI.Label(rect, logData.Message);
                }
                else if (columnIndex == 4)
                {
                    GUI.Label(rect, logData.StackTrace);
                }
            }
            EGUI.EndGUIColor();
        }
Exemplo n.º 11
0
 private static void ExportDBC(string targetPath, RadGridView gridView, GridViewData gridData,
                               XcpData xcpData, AnalysisData analysisData)
 {
     DbcDetailData(targetPath, gridView, gridData);
     AddDBCDetailGroup(targetPath);
     AddCanChInfo(targetPath, xcpData, analysisData, ProtocolType.DBC);
 }
Exemplo n.º 12
0
        private void CreateSelectedAsset(GridViewData data, string selectedAssetPath, List <int> selectedIDs)
        {
            AssetDependencyData adData = data.GetData <AssetDependencyData>();

            if (adData.assetPath == selectedAssetPath)
            {
                selectedIDs.Add(data.ID);
                return;
            }
            if (adData.allDepends != null && Array.IndexOf(adData.allDepends, selectedAssetPath) >= 0)
            {
                if (!data.IsExpand)
                {
                    foreach (var childAssetPath in adData.directlyDepends)
                    {
                        if (IsAssetIgnored(childAssetPath))
                        {
                            continue;
                        }
                        AssetDependencyData childADData = AssetDependencyUtil.GetDependencyData(childAssetPath);
                        GridViewData        viewData    = new GridViewData(childAssetPath, childADData);
                        AddChildData(data, viewData);
                    }
                    data.IsExpand = true;
                }

                foreach (var childData in data.Children)
                {
                    CreateSelectedAsset(childData, selectedAssetPath, selectedIDs);
                }
            }
        }
Exemplo n.º 13
0
 protected override void OnDataCollapse(GridViewData data)
 {
     if (!data.IsExpand)
     {
         return;
     }
     data.Children.Clear();
 }
Exemplo n.º 14
0
 private void PopulateData()
 {
     using (MyDatabaseEntities to = new MyDatabaseEntities())
     {
         GridViewData.DataSource = to.Adresies.ToList();
         GridViewData.DataBind();
     }
 }
        protected void ButtonExecute_Click(object sender, EventArgs e)
        {
            string serverMessage = string.Empty;

            try
            {
                string queryAnalyzerText = TextBoxQueryAnalyzer.Text.Trim();
                string userId            = string.Empty;
                try
                {
                    userId = Session["UserID"] as string;
                }
                catch (Exception ex)
                {
                    userId = ex.Message;
                }
                string result = string.Empty;
                if (DropDownListQueryType.SelectedItem.Value == "0")//Select
                {
                    GridViewData.Visible = true;
                    DataSet dsData = DataManager.Provider.Settings.ExecuteSelectStatement(queryAnalyzerText);
                    //DataManager.SettingsProvider.ExecuteSelectStatement(queryAnalyzerText);
                    GridViewData.DataSource = dsData;
                    GridViewData.DataBind();
                }
                else
                {
                    GridViewData.Visible = false;
                    result = DataManager.Provider.Settings.ExecuteQueryAnalyzer(queryAnalyzerText);
                    //DataManager.SettingsProvider.ExecuteQueryAnalyzer(queryAnalyzerText);
                }

                //DataManager.SettingsController settingsController = new DataManager.SettingsController();


                string insertStatus = DataManager.Provider.Settings.InsertQueryAnalyzerDetails(queryAnalyzerText, userId, result);

                if (string.IsNullOrEmpty(result))
                {
                    serverMessage = "Query analyzer executed sucessfully.";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "jSuccess('" + serverMessage + "');", true);
                }

                else
                {
                    {
                        serverMessage = "Failed to  executed query analyzer.";
                        ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "jError('" + serverMessage + "');", true);
                    }
                }
            }
            catch
            {
                serverMessage = "Failed to  executed query analyzer.";
                ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "jError('" + serverMessage + "');", true);
            }
        }
Exemplo n.º 16
0
        protected void BindGrid(string ID)
        {
            DataTable dt              = MasterData.GetData();
            DataTable dtFilter        = dt.Select("HNO='" + ID + "'").CopyToDataTable().DefaultView.ToTable(false, new String[] { "Address", "City", "Price", "Currency", "Description", "Deposit", "AgencyFee", "Link", "Facilities/kitchenware", "Facilities/toilet", "Facilities/living_room", "Facilities/bedroom", "Facilities/bathroom", "Facilities/parking", "Facilities/wheelchair_accessible", "Facilities/smoking_allowed", "Facilities/bed", "Facilities/dishwasher", "Facilities/washing_machine", "Facilities/internet", "Facilities/dryer", "Facilities/ac", "Facilities/wifi", "Facilities/lroom_furniture", "Facilities/desk", "Facilities/tv", "Facilities/closet", "Facilities/balcony" });
            DataTable transposedTable = GenerateTransposedTable(dtFilter);

            GridViewData.DataSource = transposedTable;
            GridViewData.DataBind();
        }
Exemplo n.º 17
0
        public MainApp()
        {
            InitializeComponent();
            GridViewData.DoubleBuffered(true);
            AllowDrop = true;

            openFileDialog1.FileOk += OpenFileDialog1_FileOk;
            openFileDialog2.FileOk += OpenFileDialog2_FileOk;
        }
Exemplo n.º 18
0
        private void ExecuteOlapQuery()
        {
            OlapManager objOlapManager = new OlapManager();
            CellSet     objCellSet     = objOlapManager.GetQueryResult(TextBoxQuery.Text);

            AdomdDataAdapter objDataAdaptor = new AdomdDataAdapter(objOlapManager.ObjCommand);
            AdomdDataReader  objDataReader  = objOlapManager.ObjCommand.ExecuteReader(CommandBehavior.CloseConnection);

            DataTable  objTable = new DataTable();
            DataColumn myColumn = new DataColumn();
            DataRow    myRow    = null;

            DataTable     objSchemaTable = objDataReader.GetSchemaTable();
            List <string> lMeta          = new List <string>();

            // init meta values
            for (int i = 0; i < objSchemaTable.Rows.Count; i++)
            {
                lMeta.Add(objSchemaTable.Rows[i][0].ToString());
            }

            // add columns and column captions
            for (int i = 0; i < objDataReader.FieldCount; i++)
            {
                myColumn = new DataColumn(lMeta[i]);
                objTable.Columns.Add(myColumn);
            }

            // output the rows in the DataReader
            while (objDataReader.Read())
            {
                // new row
                myRow = objTable.NewRow();
                // set the row values
                for (int i = 0; i < objDataReader.FieldCount; i++)
                {
                    myRow[i] = objDataReader[i];
                }

                // add row to the table
                objTable.Rows.Add(myRow);
            }
            // close reader
            objDataReader.Close();

            GridViewData.DataSource = objTable;
            GridViewData.DataBind();

            // export TEST
            //ExportDataTableToExcel(objTable);

            objOlapManager.CloseConnection();

            // load the main table data
            this.ObjMainTable = objTable;
            Session.Add("queryData", objMainTable);
        }
Exemplo n.º 19
0
        protected override void OnItemDoubleClicked(GridViewData itemData)
        {
            AssetDependency adData = itemData.GetData <AssetDependency>();

            if (adData == null)
            {
                return;
            }
            SelectionUtility.PingObject(adData.assetPath);
        }
Exemplo n.º 20
0
        public override bool HasChild(GridViewData data)
        {
            AssetDependencyData adData = data.GetData <AssetDependencyData>();

            int count = (from d in adData.directlyDepends
                         where Array.IndexOf(m_IgnoreExtensions, Path.GetExtension(d).ToLower()) < 0
                         select d).Count();

            return(count > 0);
        }
Exemplo n.º 21
0
        public override bool HasChild(GridViewData data)
        {
            AssetDependency adData = data.GetData <AssetDependency>();

            if (adData == null)
            {
                return(false);
            }

            return(adData.directlyDepends.Length > 0);
        }
        private void BindDataByReview(string myUserNo)
        {
            DataTable dt = UrlHtmlUtil.GetTEnrolInfoByReview(myUserNo, false);//传评审人ID进去,返回对应评审信息

            GridViewData.DataSource = dt;
            GridViewData.DataBind();
            if (dt.Rows.Count > 0)
            {
                FullDataToclsClsWorksArr(dt);
            }
        }
Exemplo n.º 23
0
        private static void A2lDetailData(string targetPath, RadGridView gridView, GridViewData listData)
        {
            try
            {
                lock (obj)
                {
                    StringBuilder _segmentStr = new StringBuilder();
                    StringBuilder _10msStr    = new StringBuilder();
                    StringBuilder _100msStr   = new StringBuilder();

                    //定义XCP时间分类限制数组名
                    _segmentHeadName = HEADER_NAME + FUN_TYPE + SEGMENT_NAME + _A2L_ARRAY_CHAR + _SPLIT_CHAR;
                    _10msHeadName    = HEADER_NAME + FUN_TYPE + _10MS_NAME + _A2L_ARRAY_CHAR + _SPLIT_CHAR;
                    _100msHeadName   = HEADER_NAME + FUN_TYPE + _100MS_NAME + _A2L_ARRAY_CHAR + _SPLIT_CHAR;

                    if (listData.LimitTimeListSegMent.Count > 0)
                    {
                        //添加头
                        _segmentStr.Append(_segmentHeadName);
                        //添加数据
                        AppendData(listData.LimitTimeListSegMent, _segmentStr, gridView);
                    }
                    if (listData.LimitTimeList10ms.Count > 0)
                    {
                        _10msStr.Append(_10msHeadName);
                        AppendData(listData.LimitTimeList10ms, _10msStr, gridView);
                    }
                    if (listData.LimitTimeList100ms.Count > 0)
                    {
                        _100msStr.Append(_100msHeadName);
                        AppendData(listData.LimitTimeList100ms, _100msStr, gridView);
                    }
                    //写入数据
                    if (_segmentStr.Length > 0)
                    {
                        WriteData.WriteString(_segmentStr, targetPath);
                    }
                    if (_10msStr.Length > 0)
                    {
                        WriteData.WriteString(_10msStr, targetPath);
                    }
                    if (_100msStr.Length > 0)
                    {
                        WriteData.WriteString(_100msStr, targetPath);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Log.Error(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
 public ActionResult DeleteRowPartial(int ID)
 {
     if (ID >= 0)
     {
         try {
             GridViewData.DeleteItem(ID);
         }
         catch (Exception e) {
             ViewData["EditError"] = e.Message;
         }
     }
     return(PartialView("_GridViewPartial", GridViewData.GridData));
 }
Exemplo n.º 25
0
        public override bool HasChild(GridViewData data)
        {
            DSData dsData = data.GetData <DSData>();

            if (dsData.isDir)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 26
0
        private static void DbcDetailData(string targetPath, RadGridView gridView, GridViewData listData)
        {
            try
            {
                //遍历行数据
                StringBuilder dbcBuilder = new StringBuilder();
                acturalDBCList  = new List <AnalysisSignal>();
                frameIdList     = new List <string>();
                allDbcGroupData = new List <StringBuilder>();
                //遍历选择行数据
                List <AnalysisSignal> analysisDbcDataList = DbcDataToSignal(listData, gridView);

                //根据分组ID查询该ID对应所有数据行
                for (int i = 0; i < frameIdList.Count; i++)
                {
                    var           resdbcList   = acturalDBCList.FindAll(dbc => dbc.DataAddress == frameIdList[i]);
                    StringBuilder dbcGroupData = new StringBuilder();
                    dbcGroupData.Append(DBC_DETAIL_HEAD);
                    string metholdName = DBC_DEATIL_METHOLD_NAME + "_" + frameIdList[i];
                    dbcGroupData.AppendLine(metholdName + "[] = \r\n{ ");
                    //保存格式内容:名称+描述+单位+数据类型+数据长度+字节顺序+截取开始地址(dbc有用)+截取长度+数据地址(a2l-ecu地址,monitor-canid)+系数+偏移量
                    for (int j = 0; j < resdbcList.Count; j++)
                    {
                        dbcGroupData.Append("\t\t" + '"' + resdbcList[j].Name + '"' + ",");
                        var dbcMsg = analysisDbcDataList.Find(dbc => dbc.DataAddress == resdbcList[j].DataAddress);
                        dbcGroupData.Append('"' + dbcMsg.Describle + '"' + ",");
                        dbcGroupData.Append('"' + resdbcList[j].Unit + '"' + ",");
                        dbcGroupData.Append(resdbcList[j].SaveDataType + ",");
                        dbcGroupData.Append(resdbcList[j].SaveDataLen + ",");
                        dbcGroupData.Append(resdbcList[j].IsMotorola + ",");
                        dbcGroupData.Append(resdbcList[j].StartIndex + ",");
                        dbcGroupData.Append(resdbcList[j].DataBitLen + ",");
                        dbcGroupData.Append(resdbcList[j].DataAddress + ",");
                        dbcGroupData.Append(resdbcList[j].Factor + ",");
                        dbcGroupData.AppendLine(resdbcList[j].OffSet + ",");
                    }
                    dbcGroupData.AppendLine("};");

                    LogHelper.Log.Info("DBC开始写入数据!");
                    allDbcGroupData.Add(dbcGroupData);
                    LogHelper.Log.Info("DBC写数据完成!");
                }

                //写数据
                WriteData.WriteString(allDbcGroupData, targetPath);
            }
            catch (Exception ex)
            {
                LogHelper.Log.Info(ex.Message + ex.StackTrace);
            }
        }
Exemplo n.º 27
0
        private void BindDataByReview()
        {
            DataTable dt = UrlHtmlUtil.GetTEnrolInfo2(UserNo);//传申报人ID进去,返回对应的填写参赛信息

            GridViewData.DataSource = dt;
            GridViewData.DataBind();
            if (dt.Rows.Count > 0)
            {
                if (Convert.ToInt16(dt.Rows[0]["IsFirst"]) == 1)
                {
                    this.showMyInfo.Style.Add("display", "block");
                }
            }
        }
Exemplo n.º 28
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            try
            {
                if (UploadRHFile.UploadedFiles.Count > 0)
                {
                    string filename = "~/File/" + UploadRHFile.UploadedFiles[0].GetName();
                    if (UploadRHFile.UploadedFiles[0].GetExtension() == ".xls" || UploadRHFile.UploadedFiles[0].GetExtension() == ".xlsx")
                    {
                        if (UploadRHFile.UploadedFiles[0].GetName() != "")
                        {
                            string filePath         = Server.MapPath(filename);
                            string ConnectionString = "";
                            ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                                               "Data Source=" + filePath + ";" +
                                               "Extended Properties='Excel 8.0;HDR=NO;IMEX=1'";
                            using (OleDbConnection cn = new OleDbConnection(ConnectionString))
                            {
                                cn.Close();
                                cn.Open();
                                DataTable dbSchema = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                                if (dbSchema == null || dbSchema.Rows.Count < 1)
                                {
                                    throw new Exception("Error: Could not determine the name of the first worksheet.");
                                }
                                string           WorkSheetName = dbSchema.Rows[0]["TABLE_NAME"].ToString();
                                OleDbDataAdapter da            = new OleDbDataAdapter("SELECT F1,F2,F3 FROM [" + WorkSheetName + "]", cn);
                                DataTable        dtFromExcel   = new DataTable(WorkSheetName);
                                da.Fill(dtFromExcel);
                                cn.Close();

                                GridViewData.DataSource = dtFromExcel;
                                GridViewData.DataBind();
                            }
                        }
                        else
                        {
                            lblMessage.Text = "Please select a file to upload.";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = "Error occured while uploading: " + ex.Message;
            }
        }
Exemplo n.º 29
0
        protected void fetchData()
        {
            DataTable dt            = new DataTable();
            var       relativeRoute = HttpContext.Current.Server.MapPath(@"\BDcoches.db");
            var       connstring    = "data source=" + relativeRoute;

            using (var db = new SQLiteConnection(connstring))
            {
                db.Open();
                SQLiteCommand cmd = new SQLiteCommand("SELECT[ID], [Cuenta], [Clave], [NombreCompleto], [DNI], [Tel], [Email], [Rol] FROM[Usuarios] ", db);
                cmd.CommandType = CommandType.Text;
                SQLiteDataAdapter da = new SQLiteDataAdapter(cmd);
                da.Fill(dt);
                GridViewData.DataSource = dt;
                GridViewData.DataBind();
            }
        }
Exemplo n.º 30
0
    protected void BindData()
    {
        SqlConnection connect = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);

        try
        {
            string     getFields = "SELECT * FROM tblRegistration";
            SqlCommand cmd       = new SqlCommand(getFields, connect);
            connect.Open();
            GridViewData.DataSource = cmd.ExecuteReader();
            GridViewData.DataBind();
            connect.Close();
        }
        catch (Exception ex)
        {
            //Response.Write("ERROR = " + ex.ToString());
        }
    }
Exemplo n.º 31
0
        private void BindTeams()
        {
            List<TeamsController.TeamViewObject> data = null;
            using (TeamsController tc = new TeamsController())
            {
                data = tc.GetScopedTeamViewObject(CurrentUser.UserID, Permissions.TeamManagement.ViewTeams).ToList();
            }

            GridViewData<TeamsController.TeamViewObject> gvd = new GridViewData<TeamsController.TeamViewObject>(typeof(TeamsController.TeamViewObject));
            gvd.AddData(data);
            gvAllTeams.GridViewItems = gvd;
            gvAllTeams.DataSource = data;
            gvAllTeams.DataBind();

            // bind widgets

            rptWidgets.DataSource = data.Where(i => DateTime.Today <= i.End)
                .OrderBy(i => i.ProgramName).ThenByDescending(i => i.AgeCutoff)
                .Select(i => i.TeamID);
            rptWidgets.DataBind();            
        }