Esempio n. 1
0
        public static string[] getCustomerFileList(string name)
        {
            string s = JsonClass.JSONSerialize <DatabaseFunctions.data>(new DatabaseFunctions.data
            {
                df_text1 = name
            });
            HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://174.114.166.80/getCusFolders.php");

            httpWebRequest.Method = "POST";
            byte[] bytes = Encoding.UTF8.GetBytes(s);
            httpWebRequest.ContentType   = "application/x-www-form-urlencoded";
            httpWebRequest.ContentLength = (long)bytes.Length;
            Stream requestStream = httpWebRequest.GetRequestStream();

            requestStream.Write(bytes, 0, bytes.Length);
            WebResponse  response       = httpWebRequest.GetResponse();
            Stream       responseStream = response.GetResponseStream();
            StreamReader streamReader   = new StreamReader(responseStream);

            string[] result = FormatFunctions.SplitToPairs(streamReader.ReadToEnd());
            httpWebRequest.Abort();
            streamReader.Close();
            responseStream.Close();
            response.Close();
            requestStream.Close();
            return(result);
        }
Esempio n. 2
0
 public void response(string result)
 {
     string[] input = FormatFunctions.SplitToPairs(result);
     dict      = FormatFunctions.createValuePairs(input);
     Responded = true;
     if (dict.Count > 1)
     {
         ClientData.AgentIDK = int.Parse(dict["IDKey"][0]);
         string       sql  = "SELECT PermissionGranted FROM agentpermissions WHERE AgentID='" + AgentIDK + "'";
         TaskCallback call = loadSecurityKeys;
         DatabaseFunctions.SendToPhp(false, sql, call);
         string       sql2  = "SELECT AgentRole FROM agentroles WHERE AgentID='" + AgentIDK + "'";
         TaskCallback call2 = loadRoles;
         DatabaseFunctions.SendToPhp(false, sql2, call2);
     }
 }
Esempio n. 3
0
        public void loadRoles(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            Roles = new List <string>();
            if (dictionary.Count > 0)
            {
                Roles = dictionary["AgentRole"];
            }
        }
Esempio n. 4
0
        public void loadSecurityKeys(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            SecurityKeys = new List <string>();
            if (dictionary.Count > 0)
            {
                SecurityKeys = dictionary["PermissionGranted"];
            }
        }
Esempio n. 5
0
 public static void boolSetter(string result)
 {
     string[] input = FormatFunctions.SplitToPairs(result);
     dict      = FormatFunctions.createValuePairs(input);
     Responded = true;
 }
Esempio n. 6
0
        public void populateGrid(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                string   filepath         = dictionary["Value"][0] + " - " + dictionary["Name"][0];
                string[] customerFileList = DatabaseFunctions.getCustomerFileList(filepath);
                filepath.Replace(" ", "%20");
                foreach (string text in customerFileList)
                {
                    if ((text != "." || text != "..") && customerFileList.Length > 1)
                    {
                        SecurityButton dataButton = new SecurityButton(text, new string[] { "Sales" })
                        {
                            Text     = text,
                            String2  = filepath,
                            FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
                        };
                        dataButton.Clicked += onFileButton;
                        List <View> list = new List <View>()
                        {
                            dataButton
                        };
                        GridFiller.rapidFillPremadeObjects(list, this, new bool[] { false });
                    }
                }
            }
        }