public override string GetName()
 {
     Conection.DeskOpen();
     command.CommandText = "SELECT nom_cl1 from cadastrosclientesfornecedoresrepresentadastransportadoras where id__cl1 = " + id_vip;
     command.Connection  = Conection.DeskConection;
     try
     {
         name = command.ExecuteScalar().ToString();
         return(name);
     }
     catch (Exception e)
     {
         Service1.LogWriteLine("ERROR GETNAME() FROM CUSTOMER CLASS AT LINE 78 ERROR->" + e.Message);
         return("");
     }
 }
Пример #2
0
        /// <summary>
        /// Upload unfinished of file, getting your informations, and deleting it after the process finish
        /// </summary>
        /// <returns></returns>
        public static List <InformationOS> Load()
        {
            List <InformationOS> send = new List <InformationOS>();

            if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\datawait"))
            {
                Service1.LogWriteLine("Getting storaged informations");
                int    codOS, codcli, osstate, cod_fun;
                string nomfun;
                using (StreamReader getdata = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + @"\datawait"))
                {
                    string line;
                    while ((line = getdata.ReadLine()) != null)
                    {
                        if (line == "startof")
                        {
                            string[] split = getdata.ReadLine().Split('=');
                            codcli  = Convert.ToInt32(split[1]);
                            split   = getdata.ReadLine().Split('=');
                            codOS   = Convert.ToInt32(split[1]);
                            split   = getdata.ReadLine().Split('=');
                            cod_fun = Convert.ToInt32(split[1]);
                            split   = getdata.ReadLine().Split('=');
                            nomfun  = split[1];
                            split   = getdata.ReadLine().Split('=');
                            osstate = Convert.ToInt32(split[1]);
                            send.Add(new InformationOS(codOS, nomfun, codcli, osstate, cod_fun));
                        }
                    }
                    getdata.Close();
                }
                try
                {
                    File.Delete(AppDomain.CurrentDomain.BaseDirectory + @"\datawait");
                }
                catch (Exception e)
                {
                    Service1.LogWriteLine("FAIL TO DELETE PROVISORY FILE OF O.S STATEMENTS. ERROR:" + e.ToString());
                }
            }
            return(send);
        }