本文整理汇总了C#中Server_Client.Client.SerializeObj方法的典型用法代码示例。如果您正苦于以下问题:C# Server_Client.Client.SerializeObj方法的具体用法?C# Server_Client.Client.SerializeObj怎么用?C# Server_Client.Client.SerializeObj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server_Client.Client
的用法示例。
在下文中一共展示了Server_Client.Client.SerializeObj方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProID
public string ProID(string tenBang)
{
try
{
string idnew;
cl = new Server_Client.Client();
// gán TCPclient
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
// khởi tạo biến truyền vào với hàm khởi tạo
Entities.LayID lid1 = new Entities.LayID("Select", tenBang);
// khởi tạo mảng đối tượng để hứng giá trị
Entities.LayID lid = new Entities.LayID();
clientstrem = cl.SerializeObj(this.client1, "LayID", lid1);
// đổ mảng đối tượng vào datagripview
lid = (Entities.LayID)cl.DeserializeHepper(clientstrem, hienthi);
if (lid == null)
return "SDCN_0001";
Common.Utilities a = new Common.Utilities();
idnew = a.ProcessID(lid.ID);
return idnew;
}
catch (Exception ex)
{
return "";
}
}
示例2: SelectData1
public Entities.BaoCaoNhapHangTheoNhomHang[] SelectData1()
{
Entities.BaoCaoNhapHangTheoNhomHang[] nkh1 = new Entities.BaoCaoNhapHangTheoNhomHang[1];
try
{
cl = new Server_Client.Client();
// gán TCPclient
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
// khởi tạo biến truyền vào với hàm khởi tạo
Entities.BaoCaoNhapHangTheoNhomHang nkh = new Entities.BaoCaoNhapHangTheoNhomHang();
// truyền HanhDong
Entities.TruyenGiaTri truyen = new Entities.TruyenGiaTri("Select");
// khởi tạo mảng đối tượng để hứng giá trị
clientstrem = cl.SerializeObj(this.client1, "BaoCaoNhapHangTheoNhomHang", truyen);
// đổ mảng đối tượng vào datagripview
nkh1 = (Entities.BaoCaoNhapHangTheoNhomHang[])cl.DeserializeHepper1(clientstrem, nkh1);
Entities.BaoCaoNhapHangTheoNhomHang[] nkh3 = new Entities.BaoCaoNhapHangTheoNhomHang[nkh1.Length];
Common.Utilities a = new Common.Utilities();
}
catch (Exception ex)
{
MessageBox.Show("Không kết nối được với server - thử lại sau");
}
return nkh1;
}
示例3: checkConflict
public void checkConflict()
{
Server_Client.Client client= new Server_Client.Client();
this.tcpClient = client.Connect(Luu.IP, Luu.Ports);
Entities.KhoHang kh = new Entities.KhoHang("Select");
Entities.KhoHang[] kh1 = new Entities.KhoHang[1];
networkStream = client.SerializeObj(this.tcpClient, "KhoHang", kh);
kh1 = (Entities.KhoHang[])client.DeserializeHepper1(networkStream, kh1);
if (kh1 != null)
{
for (int j = 0; j < kh1.Length; j++)
{
if (kh1[j].MaKho == txtMaKho.Text)
{
MessageBox.Show("Thất bại");
chck = "No";
txtMaKho.Text = new Common.Utilities().ProcessID(txtMaKho.Text);
break;
}
else
chck = "Yes";
}
}
}
示例4: checkConflict
public void checkConflict()
{
Server_Client.Client client = new Server_Client.Client();
this.tcpClient = client.Connect(Luu.IP, Luu.Ports);
Entities.LoaiHangHoa lhh = new Entities.LoaiHangHoa("Select");
Entities.LoaiHangHoa[] lhh1 = new Entities.LoaiHangHoa[1];
networkStream = client.SerializeObj(this.tcpClient, "NhanVien", lhh);
lhh1 = (Entities.LoaiHangHoa[])client.DeserializeHepper1(networkStream, lhh1);
if (lhh1 != null)
{
for (int j = 0; j < lhh1.Length; j++)
{
if (lhh1[j].MaLoaiHang == txtTenLoaiHang.Text)
{
MessageBox.Show("Thất bại");
chck = "No";
txtTenLoaiHang.Text = new Common.Utilities().ProcessID(txtTenLoaiHang.Text);
break;
}
else
chck = "Yes";
}
}
}
示例5: ProID
public string ProID(string tenBang)
{
try
{
string idnew;
Server_Client.Client cl = new Server_Client.Client();
// gán TCPclient
TcpClient client1 = cl.Connect(Luu.IP, Luu.Ports);
// khởi tạo biến truyền vào với hàm khởi tạo
Entities.LayID lid1 = new Entities.LayID("Select", tenBang);
// khởi tạo mảng đối tượng để hứng giá trị
Entities.LayID lid = new Entities.LayID();
NetworkStream clientstrem = cl.SerializeObj(client1, "LayID", lid1);
// đổ mảng đối tượng vào datagripview
lid = (Entities.LayID)cl.DeserializeHepper(clientstrem, lid);
if (lid == null)
{
if (tenBang.Equals("TyLeTinh"))
{
return "TLT_0001";
}
else if (tenBang.Equals("DiemThuongKhachHang"))
{
return "DTKH_0001";
}
}
Common.Utilities a = new Common.Utilities();
idnew = a.ProcessID(lid.ID);
return idnew;
}
catch
{ return ""; }
}
示例6: HienThi
public void HienThi()
{
try
{
bool kt = false;
cl = new Server_Client.Client();
this.client = cl.Connect(Luu.IP, Luu.Ports);
clientstrem = cl.SerializeObj(this.client, "SoDuKho", new Entities.SoDuKho("Select"));
ddh = new Entities.SoDuKho[1];
ddh = (Entities.SoDuKho[])cl.DeserializeHepper(clientstrem, ddh);
if (ddh == null)
{
toolStrip1.Enabled = true;
dgvsodukhohang.DataSource = new Entities.SoDuKho[0];
FixDatagridview();
return;
}
Entities.KhoHang kh = (Entities.KhoHang)cbbkhohang.SelectedItem;
List<Entities.SoDuKho> L = new List<Entities.SoDuKho>();
DateTime SoSanh = new DateTime(int.Parse(cbbnam.Text), int.Parse(cbbthang.Text), 1);
foreach (Entities.SoDuKho item in ddh)
{
if ((item.TrangThai && !kt) || (!kt && (item.NgayKetChuyen.Month == SoSanh.Month - 1) && (item.NgayKetChuyen.Year == SoSanh.Year) && (item.MaKho.ToUpper().Equals(kh.MaKho.ToUpper()))))
{
kt = item.TrangThai;
}
if ((item.NgayKetChuyen.Month == SoSanh.Month) && (item.NgayKetChuyen.Year == SoSanh.Year) && (item.MaKho.ToUpper().Equals(kh.MaKho.ToUpper())))
{
L.Add(item);
}
}
if (L.Count == 0)
{
lbltrangthai.Text = "";
toolStrip1.Enabled = true;
dgvsodukhohang.DataSource = new Entities.SoDuKho[0];
FixDatagridview();
return;
}
if (L[0].TrangThai)
{
lbltrangthai.ForeColor = Color.Red;
lbltrangthai.Text = "Kỳ Đã Khóa";
toolStrip1.Enabled = false;
}
else
{
lbltrangthai.ForeColor = Color.Green;
lbltrangthai.Text = "Kỳ Chưa Khóa";
toolStrip1.Enabled = true;
}
dgvsodukhohang.DataSource = L.ToArray();
FixDatagridview();
if (kt)
{
toolStrip1.Enabled = false;
}
}
catch { }
}
示例7: LayDL
void LayDL()
{
try
{
cl = new Server_Client.Client();
// gán TCPclient
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
//truyền giá trị lên server
clientstrem = cl.SerializeObj(this.client1, "LayBackUp", null);
// đổ mảng đối tượng vào datagripview
slht = (Entities.SaoLuuHeThong[])cl.DeserializeHepper1(clientstrem, null);
if (slht != null)
{
if (slht.Length > 0)
{
dgvHienThi.DataSource = slht;
}
}
else
{
slht = new Entities.SaoLuuHeThong[0];
dgvHienThi.DataSource = slht;
}
fix();
}
catch
{
dgvHienThi.DataSource = new Entities.SaoLuuHeThong[0];
fix();
}
dgvHienThi.Refresh();
}
示例8: SelectData
/// <summary>
/// select dữ liệu từ server
/// </summary>
public void SelectData()
{
try
{
Server_Client.Client cl = new Server_Client.Client();
// gán TCPclient
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
// khởi tạo biến truyền vào với hàm khởi tạo
Entities.NhanVien ncc = new Entities.NhanVien("Select");
// khởi tạo mảng đối tượng để hứng giá trị
Entities.NhanVien[] ncc1 = new Entities.NhanVien[1];
clientstrem = cl.SerializeObj(this.client1, "NhanVien", ncc);
// đổ mảng đối tượng vào datagripview
ncc1 = (Entities.NhanVien[])cl.DeserializeHepper1(clientstrem, ncc1);
if (ncc1 == null)
{
hienthi = new Entities.NhanVien[0];
dtgvncc.DataSource = new Entities.NhanVien[0];
return;
}
Entities.NhanVien[] ncc2 = new Entities.NhanVien[ncc1.Length];
int sotang = 0;
for (int j = 0; j < ncc1.Length; j++)
{
if (ncc1[j].Deleted == false)
{
ncc2[sotang] = ncc1[j];
sotang++;
}
}
hienthi = new Entities.NhanVien[sotang];
if (sotang != 0)
{
for (int j = 0; j < sotang; j++)
{
hienthi[j] = ncc2[j];
}
}
else
{
hienthi = new Entities.NhanVien[0];
dtgvncc.DataSource = new Entities.NhanVien[0];
return;
}
dtgvncc.DataSource = hienthi;
dtgvncc.Rows[0].Selected = true;
}
catch (Exception ex)
{
}
finally
{
fix();
}
}
示例9: Select
public void Select()
{
try
{
dtgvHienThi.RowHeadersVisible = false;
Server_Client.Client cl = new Server_Client.Client();
cl = new Server_Client.Client();
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
Entities.CheckRefer ctxh = new Entities.CheckRefer("NH");
clientstrem = cl.SerializeObj(this.client1, "Select", ctxh);
Entities.NhomHang[] kh1 = new Entities.NhomHang[0];
kh1 = (Entities.NhomHang[])cl.DeserializeHepper1(clientstrem, kh1);
if (kh1 == null)
{
hienthi = new Entities.NhomHang[0];
dtgvHienThi.DataSource = new Entities.NhomHang[0];
return;
}
Entities.NhomHang[] ncc2 = new Entities.NhomHang[kh1.Length];
int sotang = 0;
for (int j = 0; j < kh1.Length; j++)
{
if (kh1[j].Deleted == false)
{
ncc2[sotang] = kh1[j];
sotang++;
}
}
hienthi = new Entities.NhomHang[sotang];
if (sotang != 0)
{
for (int j = 0; j < sotang; j++)
{
hienthi[j] = ncc2[j];
}
}
else
{
hienthi = new Entities.NhomHang[0];
dtgvHienThi.DataSource = new Entities.NhomHang[0];
return;
}
dtgvHienThi.DataSource = hienthi;
dtgvHienThi.Rows[0].Selected = true;
}
catch (Exception ex)
{
}
finally
{
fix();
}
}
示例10: SelectData
/// <summary>
/// select dữ liệu từ server
/// </summary>
public void SelectData()
{
try
{
dtgvKH.RowHeadersVisible = false;
Server_Client.Client cl = new Server_Client.Client();
// gán TCPclient
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
// khởi tạo biến truyền vào với hàm khởi tạo
Entities.DonDatHang kh = new Entities.DonDatHang("SelectDDH");
// khởi tạo mảng đối tượng để hứng giá trị
Entities.DonDatHang[] kh1 = new Entities.DonDatHang[1];
clientstrem = cl.SerializeObj(this.client1, "DonDatHang", kh);
// đổ mảng đối tượng vào datagripview
kh1 = (Entities.DonDatHang[])cl.DeserializeHepper1(clientstrem, kh1);
if (kh1 == null)
{
hienthi = new Entities.DonDatHang[0];
dtgvKH.DataSource = hienthi;
return;
}
Entities.DonDatHang[] kh2 = new Entities.DonDatHang[kh1.Length];
int sotang = 0;
for (int j = 0; j < kh1.Length; j++)
{
if (kh1[j].Makhachhang == str1)
{
kh2[sotang] = kh1[j];
sotang++;
}
}
hienthi = new Entities.DonDatHang[sotang];
if (sotang != 0)
{
for (int j = 0; j < sotang; j++)
{
hienthi[j] = kh2[j];
}
}
else
{
hienthi = new Entities.DonDatHang[0];
dtgvKH.DataSource = new Entities.DonDatHang[0];
return;
}
dtgvKH.DataSource = hienthi;
dtgvKH.Rows[0].Selected = true;
}
catch (Exception ex)
{
}
finally
{
fix();
}
}
示例11: Date
public static DateTime Date()
{
Server_Client.Client cl = new Server_Client.Client();
client1 = cl.Connect(Luu.IP, Luu.Ports);
Entities.CheckRefer pt = new Entities.CheckRefer();
clientstrem = cl.SerializeObj(client1, "Datetime", pt);
DateTime dt = new DateTime();
dt = (DateTime)cl.DeserializeHepper(clientstrem, dt);
return dt;
}
示例12: BaoCaoKhoHang
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private Entities.BaoCaoXuatHangTheoKho[] BaoCaoKhoHang(string makho, string ngay)
{
Entities.BaoCaoXuatHangTheoKho[] tralai = null;
Entities.TruyenGiaTri truyen = new Entities.TruyenGiaTri("Select", makho, ngay);
cl = new Server_Client.Client();
this.client = cl.Connect(Luu.IP, Luu.Ports);
clientstrem = cl.SerializeObj(this.client, "BaoCaoXuatHangTheoKho", truyen);
tralai = (Entities.BaoCaoXuatHangTheoKho[])cl.DeserializeHepper(clientstrem, tralai);
return tralai;
}
示例13: CheckDataGridCongSL
public void CheckDataGridCongSL(DataGridView dgv, string maKho)
{
if (dgv.RowCount != 0)
{
try
{
Server_Client.Client cl = new Server_Client.Client();
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
Entities.ChiTietKhoHangTheoHoaHonNhap nv = new Entities.ChiTietKhoHangTheoHoaHonNhap("Select");
clientstrem = cl.SerializeObj(this.client1, "ChiTietKho", nv);
Entities.ChiTietKhoHangTheoHoaHonNhap[] kh1 = new Entities.ChiTietKhoHangTheoHoaHonNhap[1];
kh1 = (Entities.ChiTietKhoHangTheoHoaHonNhap[])cl.DeserializeHepper1(clientstrem, kh1);
List<Entities.ChiTietKhoHangTheoHoaHonNhap> ctList = new List<Entities.ChiTietKhoHangTheoHoaHonNhap>();
for (int i = 0; i < dgv.RowCount; i++)
{
bool retVal = false;
foreach (Entities.ChiTietKhoHangTheoHoaHonNhap item in kh1)
{
if (dgv["MaHangHoa", i].Value.ToString().ToUpper().Equals(item.Mahanghoa.ToUpper()) && maKho.Equals(item.Makho))
{
retVal = true;
break;
}
}
if (!retVal)
{
Entities.ChiTietKhoHangTheoHoaHonNhap ct = new Entities.ChiTietKhoHangTheoHoaHonNhap();
ct.Hanhdong = "Insert";
ct.Mahanghoa = dgv["MaHangHoa", i].Value.ToString();
ct.Makho = maKho;
ct.Ngaynhap = DateServer.Date();
DateTime ngayHetHan = DateTime.Now;
if (dgv["NgayHetHan", i] != null)
ngayHetHan = (DateTime)dgv["NgayHetHan", i].Value;
ct.Ngayhethan = ngayHetHan;
ct.Soluong = int.Parse(dgv["SoLuong", i].Value.ToString());
ct.Ghichu = "";
ctList.Add(ct);
}
}
Server_Client.Client cl1 = new Server_Client.Client();
this.client1 = cl1.Connect(Luu.IP, Luu.Ports);
clientstrem = cl1.SerializeObj(this.client1, "ThemChiTietKhoHang", ctList.ToArray());
}
catch (Exception)
{
}
}
}
示例14: SelectGoiHang
public void SelectGoiHang()
{
try
{
cl = new Server_Client.Client();
this.client = cl.Connect(Luu.IP, Luu.Ports);
Entities.GoiHang goi = new Entities.GoiHang("Select");
clientstrem = cl.SerializeObj(this.client, "GoiHang", goi);
Entities.GoiHang[] GoiHang = new Entities.GoiHang[1];
GoiHang = (Entities.GoiHang[])cl.DeserializeHepper1(clientstrem, GoiHang);
try
{
for (int j = 0; j < GoiHang.Length; j++)
{
if (GoiHang[j].Deleted == false)
{
Entities.ThongTinMaVach row = new Entities.ThongTinMaVach();
row.MaHangHoa = GoiHang[j].MaGoiHang;
row.TenHangHoa = GoiHang[j].TenGoiHang;
list.Add(row);
}
}
}
catch { }
try
{
for (int i = 0; i < this.search.Length; i++)
{
list.Add(this.search[i]);
}
}
catch { }
int k = list.Count;
if (k <= 0)
{
this.search = null;
}
else
{
this.search = new Entities.ThongTinMaVach[k];
for (int i = 0; i < k; i++)
{
this.search[i] = (Entities.ThongTinMaVach)list[i];
}
}
}
catch { }
}
示例15: Restore
public bool Restore(Entities.SaoLuuHeThong slht1)
{
try
{
cl = new Server_Client.Client();
// gán TCPclient
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
//truyền giá trị lên server
clientstrem = cl.SerializeObj(this.client1, "Restore", slht1);
//lấy giá trị về
bool tv = (bool)cl.DeserializeHepper(clientstrem, null);
return tv;
}
catch { return false; }
}