private static Dictionary <string, string> getLabelersList_byGroup(string GroupPath) { DataTable dt = new GetMysql().FilledTable(@"SELECT D.name,D.ip_addr FROM device D, device_has_group Dh, devicemodel DM, `group` G WHERE Dh.Device_ID=D.Device_ID AND D.devicemodel_iddevicemodel=DM.iddevicemodel AND DM.`Type`='Labeler' AND Dh.Group_id=G.id AND G.`id`=pathtoid('" + GroupPath + "');"); Dictionary <string, string> dict = new Dictionary <string, string>(); foreach (DataRow dr in dt.Rows) { dict.Add(dr["name"].ToString(), dr["ip_addr"].ToString()); } return(dict); }
/// <summary> /// Queries a List of printers in the PathDirectory MySQL Schema for a SoftName /// </summary> /// <param name="printerName">ex: C42</param> /// <returns></returns> public string GetSoftNameByAddress(string IPAddress) { string ip = new GetMysql().ScalarValue(@"SELECT name FROM device WHERE D.`ip_addr`='" + IPAddress + "';"); return(ip); }
/// <summary> /// Queries a List of printers in the PathDirectory MySQL Schema for an IpAddress /// </summary> /// <param name="printerName">ex: C42</param> /// <returns></returns> public string GetAddressBySoftName(string printerName) { string ip = new GetMysql().ScalarValue(@"SELECT ip_addr FROM device WHERE `name`='" + printerName + "';"); return(ip); }