private void frmTvAccesos_Load(object sender, EventArgs e) { vSQL = "SELECT Nombres+' '+Ape_Paterno+' '+Ape_Materno Descripcion,Id_Us+'*'+DBO.Cryptgr(Type,0,2) IdUbigeo " + "FROM sysaccusers S INNER JOIN Personal P " + "ON S.Id_Per = P.Id_Personal " + "INNER JOIN ( SELECT Id_Tipo, Descripcion " + " FROM TablaTipo "+ " WHERE Id_Tabla In (SELECT Id_Tipo "+ " FROM TablaTipo "+ " WHERE Descripcion = 'ESTADO_REGISTRO')) E "+ " ON S.State = E.Id_Tipo " + "WHERE E.Descripcion = 'ACTIVADO' " + "ORDER BY 1"; General.LlenaComboBox(cmbUsuario, "SQL", vSQL); vSQL = "SELECT Pad_Prompt Descripcion, Pad_Popup IdUbigeo FROM Padmenu ORDER BY Pad_Prompt"; General.LlenaComboBox(cmbPadMenu, "SQL", vSQL); TV1.CollapseAll(); TV1.Enabled = false; selectedNodeU = null; TV2.CollapseAll(); TV2.Enabled = false; selectedNodeG = null; }
public void Question5() { TV1 tV1 = new TV1(); tV1.price = "$7000.00"; tV1.size = "75 Inch"; tV1.ports = 5; tV1.isMountable = true; Console.WriteLine("The price of the HDTV is {0} ", tV1.price); Console.WriteLine("The size of the HDTV is {0} ", tV1.size); Console.WriteLine("The number of ports of the HDTV is {0} ", tV1.ports); Console.WriteLine("Is the TV Mountable {0}", tV1.isMountable); }
public void LoadFileNames() { TV1.BeginUpdate(); TV1.Nodes.Clear(); TV1.Sort(); // add pcc list of main directory currentPCC = ""; string[] files = Directory.GetFiles(pathCooked, "*.pcc"); TreeNode t = new TreeNode(mainPCCFolder); t.ImageIndex = 1; for (int i = 0; i < files.Length; i++) { TreeNode t2 = new TreeNode(Path.GetFileName(files[i])); t2.ImageIndex = 1; t.Nodes.Add(t2); } TV1.Nodes.Add(t); // add pcc list of every dlc found /*string[] dlcs = Directory.GetDirectories(ME3Directory.DLCPath, "DLC_*"); * foreach (string dlcPath in dlcs) * { * // build path of current dlc * string dlcName = Path.GetFileName(dlcPath); * string dlcFullPath = ME3Directory.DLCFilePath(dlcName); * * // build root node of current dlc * TreeNode dlcNode = new TreeNode(dlcName); * dlcNode.ImageIndex = 1; * TV1.Nodes.Add(dlcNode); * * // load list of pcc stored in current dlc and add nodes to root node * AmaroK86.MassEffect3.DLCBase dlcBase = new AmaroK86.MassEffect3.DLCBase(dlcFullPath); * List<string> dlcPccList = dlcBase.fileNameList.Where(fileName => Path.GetExtension(fileName) == ".pcc").ToList(); * foreach (string path in dlcPccList) * { * // pcc are selectable inside treeView throught their full name (ex. "/BIOGame/DLC/DLC_HEN_PR/CookedPCConsole/BioA_Cat001.pcc") * TreeNode dlcPccNode = dlcNode.Nodes.Add(path, Path.GetFileName(path)); * dlcPccNode.ImageIndex = 1; * } * }*/ //TV1.Nodes[0].Expand(); TV1.EndUpdate(); listView1.Clear(); }
public void GeneratePccTree() { TV1.BeginUpdate(); TV1.Nodes.Clear(); TreeNode root = TV1.Nodes.Add(pcc.pccFileName, pcc.pccFileName); root.ImageIndex = 1; foreach (KFreonLib.PCCObjects.ME3ExportEntry exportEntry in pcc.Exports) { string[] pathChunks = (exportEntry.PackageFullName).Split('.'); string recombinedPath = ""; foreach (string chunk in pathChunks) { if (recombinedPath == "") { recombinedPath += chunk; } else { recombinedPath += "." + chunk; } if (root.Nodes.ContainsKey(recombinedPath)) { root = root.Nodes[recombinedPath]; } else { root = root.Nodes.Add(recombinedPath, chunk); } root.ImageIndex = 1; } root = TV1.Nodes[pcc.pccFileName]; } root.Expand(); TV1.Sort(); TV1.EndUpdate(); }
private void CargaMenuUsuario(string optUsuario) { string vCant = ""; TV1.Nodes.Clear(); vSQL = "SELECT COUNT(*) " + "FROM Padmenu " + "WHERE Pad_Popup IN " + "(SELECT DISTINCT Pad_Popup " + " FROM Accesos A INNER JOIN Barmenu B " + " ON A.Mnu_Pop = B.Bar_Popup " + " AND A.Mnu_Bar = B.Bar_Number INNER JOIN Padmenu P " + " ON A.Mnu_Pop = P.Pad_Popup INNER JOIN sysaccusers S " + " ON A.Us_Up = S.Id_Us " + " WHERE Mnu_Us = '" + optUsuario.Trim() + "')"; vCant = General.TomaValor(vSQL); if (Convert.ToInt32(vCant) == 0) { cmdDelAll.Enabled = false; return; } vSQL = "SELECT COUNT(*) " + "FROM Barmenu B " + "WHERE EXISTS " + "(SELECT 1 " + " FROM Accesos A, Padmenu P, sysaccusers S " + " WHERE A.Mnu_Pop = B.Bar_Popup " + " AND A.Mnu_Bar = B.Bar_Number " + " AND A.Mnu_Pop = P.Pad_Popup " + " AND A.Us_Up = S.Id_Us " + " AND A.Mnu_Us = '" + optUsuario.Trim() + "')"; vCant = General.TomaValor(vSQL); if (Convert.ToInt32(vCant) == 0) { cmdDelAll.Enabled = false; return; } //selecciona los menus principales vSQL = "SELECT Pad_Popup,Pad_Prompt,Pad_Name,Pad_Order " + "FROM Padmenu " + "WHERE Pad_Popup IN " + "(SELECT DISTINCT Pad_Popup " + " FROM Accesos A INNER JOIN Barmenu B " + " ON A.Mnu_Pop = B.Bar_Popup " + " AND A.Mnu_Bar = B.Bar_Number INNER JOIN Padmenu P " + " ON A.Mnu_Pop = P.Pad_Popup INNER JOIN sysaccusers S " + " ON A.Us_Up = S.Id_Us " + " WHERE Mnu_Us = '" + optUsuario.Trim() + "') " + "ORDER BY Pad_Popup"; SqlDataAdapter dNodos = new SqlDataAdapter(vSQL, Conexion.CNN); //selecciona los items de cada menu principal vSQL = "SELECT B.Bar_Popup,B.Bar_Prompt,B.Bar_Number,B.Bar_Order " + "FROM Barmenu B " + "WHERE EXISTS " + "(SELECT 1 " + " FROM Accesos A, Padmenu P, sysaccusers S " + " WHERE A.Mnu_Pop = B.Bar_Popup " + " AND A.Mnu_Bar = B.Bar_Number " + " AND A.Mnu_Pop = P.Pad_Popup " + " AND A.Us_Up = S.Id_Us " + " AND A.Mnu_Us = '" + optUsuario.Trim() + "') " + "ORDER BY B.Bar_Popup,B.Bar_Order"; SqlDataAdapter dHijos = new SqlDataAdapter(vSQL, Conexion.CNN); //metodo que relaciona tabla cabecera con tabla detalle DataSet ds = new DataSet(); dNodos.Fill(ds, "Padmenu"); dHijos.Fill(ds, "Barmenu"); ds.Relations.Add("PadBarMenu", ds.Tables["Padmenu"].Columns["Pad_Popup"], ds.Tables["Barmenu"].Columns["Bar_Popup"]); TV1.ImageIndex = 1; foreach (DataRow dr in ds.Tables["Padmenu"].Rows) { //llena nodos principales con tabla cabecera TreeNode tnPadre = new TreeNode(); tnPadre.Name = dr["Pad_Name"].ToString(); tnPadre.Text = dr["Pad_Prompt"].ToString(); tnPadre.Tag = dr["Pad_Popup"].ToString() + "*" + dr["Pad_Name"].ToString() + "*" + dr["Pad_Order"].ToString(); tnPadre.ImageIndex = 0; tnPadre.SelectedImageIndex = 0; foreach (DataRow drChild in dr.GetChildRows("PadBarMenu")) { //llena nodos secundarios con tabla detalle TreeNode tnHijo = new TreeNode(); tnHijo.Name = drChild["Bar_Number"].ToString(); tnHijo.Text = drChild["Bar_Prompt"].ToString(); tnHijo.Tag = drChild["Bar_Popup"].ToString() + "*" + drChild["Bar_Number"].ToString() + "*" + drChild["Bar_Order"].ToString(); tnHijo.ImageIndex = 1; tnHijo.SelectedImageIndex = 1; tnPadre.Nodes.Add(tnHijo); } TV1.Nodes.Add(tnPadre); } TV1.ExpandAll(); TV1.SelectedNode = TV1.Nodes[0]; selectedNodeU = TV1.Nodes[0]; }