Esempio n. 1
0
 public static DataSet GetCardMain(int CardID)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         byte[] da = ft.GetCardMain(CardID);
         ft.Close();
         return(Byte2DS(da));
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 2
0
 public static DataSet GetDS(string Bll, string Exc, object[] par)
 {
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         byte[] da = ft.getZipData(Bll, Exc, par);
         ft.Close();
         return(Byte2DS(da));
     }
     catch (Exception ex)
     {
         DataSet ds = new DataSet();
         ds.Tables.Add();
         return(ds);
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 3
0
 public static object GetOne(string bll, string Exc, object[] par)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         return(ft.GetOne(bll, Exc, par));
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 4
0
 public static void Updata(string bll, DataTable dt)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         ft.Updata(bll, "UpdateByDt", dt);
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 5
0
 public static string AddLog(string UserName)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         return(ft.AddLog(UserName));
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 6
0
 public static DateTime GetDateTime()
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         return(ft.GetDateTime());
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 7
0
 public static object GetSingle(string SQLString)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         return(ft.GetSingle(SQLString));
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 8
0
 public static void CloseClient()
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         ft.CloseClient();
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 9
0
        public static DataSet GetDSForPrcoce(string storedProcName, object[] parameters, string tableName)
        {
            // System.ServiceModel.Dispatcher.DispatchRuntime.AutomaticInputSessionShutdown = false;

            //ChatCallBack callBack = new ChatCallBack();
            //InstanceContext instance = new InstanceContext(callBack);
            ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
            try
            {
                byte[] da = ft.GetDSForPrcoce(storedProcName, parameters, tableName);
                ft.Close();
                return(Byte2DS(da));
            }
            catch (Exception ex)
            {
                DataSet ds = new DataSet();
                ds.Tables.Add();
                return(ds);
            }
            finally
            {
                ft.Close();
            }
        }
Esempio n. 10
0
 public static void ExecSql(string bll, string Exc, object[] par)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         ft.ExecSql(bll, Exc, par);
     }
     catch
     {
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 11
0
 public static string CarID(string aa)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         return(ft.CarID(aa));
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 12
0
 public static DateTime GetLastBackupTime()
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         return(ft.GetLastBackupTime());
     }
     catch
     {
         return(Convert.ToDateTime("1900-1-1"));
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 13
0
 public static int Add(string bll, DataTable dt)
 {
     //ChatCallBack callBack = new ChatCallBack();
     //InstanceContext instance = new InstanceContext(callBack);
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         return(ft.Add(bll, "AddByDt", dt));
     }
     catch (Exception ex)
     {
         return(0);
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 14
0
 public static DataTable GetBySql(string sql)
 {
     ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
     try
     {
         byte[]    da = ft.GetBySql(sql);
         DataTable dt = ToDataTable(da);
         dt.TableName = "dt";
         return(dt);
     }
     catch (Exception ex)
     {
         return(new DataTable());
     }
     finally
     {
         ft.Close();
     }
 }
Esempio n. 15
0
        public static int UpOrAdd(string bll, DataTable dt)
        {
            ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
            try
            {
                DataRow[]     drs = dt.Select("(A>1)");
                StringBuilder ss  = new StringBuilder();

                for (int j = 0; j < drs.Length; j++)
                {
                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        //ss.Append(i);
                        //ss.Append("ю");
                        ss.Append(drs[j][i].ToString());
                        ss.Append("ж");
                    }
                    ss.Append("й");
                }

                MemoryStream ms = new MemoryStream();
                StreamWriter sw = new StreamWriter(ms);
                sw.Write(ss.ToString());
                sw.Close();
                byte[] bsrc = ms.ToArray();
                ms.Close();
                ms.Dispose();
                ms          = new MemoryStream();
                ms.Position = 0;
                // 压缩数组序列并返回压缩后的数组
                DeflateStream zipStream = new DeflateStream(ms, CompressionMode.Compress);
                zipStream.Write(bsrc, 0, bsrc.Length);
                zipStream.Close();
                zipStream.Dispose();
                return(Convert.ToInt32(ft.GetOne(bll, "UpOrAdd", new object[] { ms.ToArray() })));
            }
            finally
            {
                ft.Close();
            }
        }
Esempio n. 16
0
        public static DataSet GetDT(string Bll, string Exc, object[] par)
        {
            ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
            //try
            //{
            //    byte[] da = ft.getZipData(Bll, Exc, par);
            //    ft.Close();
            //    return Byte2DS(da);
            //}
            //catch (Exception ex)
            //{
            //    DataSet ds = new DataSet();
            //    ds.Tables.Add();
            //    return ds;
            //}
            //finally
            //{
            //    ft.Close();
            //}

            try
            {
                byte[]    da = ft.GetJson(Bll, Exc, par);
                DataTable dt = ToDataTable(da);
                DataSet   ds = new DataSet();
                ds.DataSetName = "ds";
                ds.Tables.Add(dt);
                return(ds);
            }
            catch (Exception ex)
            {
                DataSet ds = new DataSet();
                ds.Tables.Add();
                return(ds);
            }
            finally
            {
                ft.Close();
            }
        }
Esempio n. 17
0
        public static string GetStringList(string Bll, string Exc, object[] par)
        {
            ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
            string strDS = string.Empty;

            try
            {
                byte[]       da = ft.GetStringList(Bll, Exc, par);
                MemoryStream ms = new MemoryStream();
                ms.Write(da, 0, da.Length);
                ms.Position = 0;
                DeflateStream ZipStream     = new DeflateStream(ms, CompressionMode.Decompress);
                MemoryStream  UnzipStream   = new MemoryStream();
                byte[]        sDecompressed = new byte[128];
                while (true)
                {
                    int bytesRead = ZipStream.Read(sDecompressed, 0, 128);
                    if (bytesRead == 0)
                    {
                        break;
                    }
                    UnzipStream.Write(sDecompressed, 0, bytesRead);
                }
                ZipStream.Close();
                ms.Close();
                UnzipStream.Position = 0;// 解压起始位置设置为头
                StreamReader sr = new StreamReader(UnzipStream);
                strDS = sr.ReadToEnd();
            }
            catch (Exception ex)
            {
            }
            finally
            {
                ft.Close();
            }
            return(strDS);
        }