当前位置: 首页>>代码示例>>C#>>正文


C# Server_Client.Client类代码示例

本文整理汇总了C#中Server_Client.Client的典型用法代码示例。如果您正苦于以下问题:C# Server_Client.Client类的具体用法?C# Server_Client.Client怎么用?C# Server_Client.Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Server_Client.Client类属于命名空间,在下文中一共展示了Server_Client.Client类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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 { }
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:60,代码来源:frmSoDuKhoHang.cs

示例2: 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";
                }
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:26,代码来源:frmThemloaihanghoa.cs

示例3: LogIn

        /// <summary>
        /// hàm đăng nhập
        /// </summary>
        /// <param name="ttk"></param>
        /// <param name="mk"></param>
        /// <returns></returns>
        public bool LogIn(string ttk,string mk)
        {
            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.TaiKhoan tk = new Entities.TaiKhoan();
                tk = new Entities.TaiKhoan(ttk, mk);
                // khởi tạo mảng đối tượng để hứng giá trị
                tk1 = new Entities.TaiKhoan[1];
                clientstrem = cl.SerializeObj(this.client1, "LogIn", tk);
                // đổ mảng đối tượng vào datagripview
                tk1 = (Entities.TaiKhoan[])cl.DeserializeHepper1(clientstrem, tk1);
                if (tk1.Length > 0)
                {
                    if (!tk1[0].KhoaTaiKhoan)
                    {
                        Common.Utilities.User = User = tk1[0];
                        Common.Utilities.CTQ = CTQ = LayChiTietQuyen(User.TenNhomQuyen);

                        return true;
                    }
                    return false;
                }
                else
                    return false;
            }
            catch (Exception w)
            {
                string str=w.Message;
                return false;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:41,代码来源:frmDangNhap.cs

示例4: 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 ""; }
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:33,代码来源:frmTinhDiemThuong.cs

示例5: 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;
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:27,代码来源:frmBaoCaoNhapHangThepNhomHang.cs

示例6: 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();
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:33,代码来源:frmQuanLySaoLuuHeThong.cs

示例7: 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 "";
     }
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:26,代码来源:frmKetChuyenSoDuCongNo.cs

示例8: 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";
                 }
             }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:26,代码来源:frmSuaKhoHang.cs

示例9: 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();

            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:62,代码来源:frmTimNhanVien.cs

示例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.HDBanHang kh = new Entities.HDBanHang("Select");
                // khởi tạo mảng đối tượng để hứng giá trị
                Entities.HDBanHang[] kh1 = new Entities.HDBanHang[1];
                clientstrem = cl.SerializeObj(this.client1, "HDBanHang", kh);
                // đổ mảng đối tượng vào datagripview
                kh1 = (Entities.HDBanHang[])cl.DeserializeHepper1(clientstrem, kh1);
                if (kh1 == null)
                {
                    hienthi = new Entities.HDBanHang[0];
                    dtgvKH.DataSource = new Entities.HDBanHang[0];
                    return;
                }
                Entities.HDBanHang[] kh2 = new Entities.HDBanHang[kh1.Length];
                int sotang = 0;
                for (int j = 0; j < kh1.Length; j++)
                {
                    if (kh1[j].MaKhachHang == str1 && kh1[j].Deleted == false && kh1[j].LoaiHoaDon == false && !kh1[j].TongTienThanhToan.Equals(kh1[j].ThanhToanNgay) && !kh1[j].TongTienThanhToan.Equals(kh1[j].ThanhToanKhiLapPhieu))
                    {
                        kh2[sotang] = kh1[j];
                        sotang++;
                    }
                }
                hienthi = new Entities.HDBanHang[sotang];
                if (sotang != 0)
                {
                    for (int j = 0; j < sotang; j++)
                    {
                        hienthi[j] = kh2[j];
                    }
                }
                else
                {
                    hienthi = new Entities.HDBanHang[0];
                    dtgvKH.DataSource = new Entities.HDBanHang[0];
                    return;
                }
                dtgvKH.DataSource = hienthi;
                dtgvKH.Rows[0].Selected = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Không kết nối được với server - thử lại sau");
            }
            finally
            {

                fix();

            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:62,代码来源:frmTimHDBanHang.cs

示例11: 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();

            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:58,代码来源:frmTimNhomHang.cs

示例12: 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();
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:60,代码来源:frmTimDonDatHang.cs

示例13: 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;
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:15,代码来源:frmBaoCaoXuatHang.cs

示例14: 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;
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:10,代码来源:Check.cs

示例15: 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)
                {

                }
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:51,代码来源:frmHienThi_XacNhanDieuChuyenKho.cs


注:本文中的Server_Client.Client类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。