Пример #1
0
 private void getID(string table)
 {
     try
     {
         Entities.LayID top = new Entities.LayID();
         cl             = new Server_Client.Client();
         this.tcpClient = cl.Connect(Luu.IP, Luu.Ports);
         top            = new Entities.LayID("Select", table);
         networkStream  = cl.SerializeObj(this.tcpClient, "LayID", top);
         Entities.LayID ddh = new Entities.LayID();
         ddh = (Entities.LayID)cl.DeserializeHepper(networkStream, ddh);
         tcpClient.Close();
         networkStream.Close();
         if (ddh.ID != null)
         {
             string           chuoi = ddh.ID.ToString();
             Common.Utilities com   = new Common.Utilities();
             makiemtra = com.ProcessID(chuoi);
         }
         else
         {
             makiemtra     = "MK_0001";
             txtMaKho.Text = "";
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message.ToString();
         if (txtMaKho.Text == "")
         {
             makiemtra     = "MK_0001";
             txtMaKho.Text = "";
         }
     }
 }
Пример #2
0
        public string LayID(string tenBang)
        {
            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();
            clientstream = cl.SerializeObj(this.client1, "LayID", lid1);
            // đổ mảng đối tượng vào datagripview
            lid = (Entities.LayID)cl.DeserializeHepper(clientstream, lid1);
            if (lid != null)
            {
                Common.Utilities a = new Common.Utilities();
                idnew = a.ProcessID(lid.ID);
            }
            else
            {
                if (lid == null)
                {
                    idnew = "PB_0001";
                }
            }
            return(idnew);
        }
 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 "";
     }
 }
Пример #4
0
 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(""); }
 }
Пример #5
0
 /// <summary>
 /// Lấy giá trị id cuối cùng
 /// </summary>
 /// <param name="tenBang"></param>
 /// <returns></returns>
 public string ProID(string tenBang)
 {
     try
     {
         string idnew;
         Server_Client.Client cl = new Server_Client.Client();
         // gán TCPclient
         this.tcpClient = 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 = cl.SerializeObj(this.tcpClient, "LayID", lid1);
         // đổ mảng đối tượng vào datagripview
         lid = (Entities.LayID)cl.DeserializeHepper(networkStream, lhh);
         if (lid == null)
         {
             return("LH_0001");
         }
         Common.Utilities a = new Common.Utilities();
         idnew = a.ProcessID(lid.ID);
         return(idnew);
     }
     finally
     { }
 }
Пример #6
0
 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("SDSQ_0001");
         }
         Common.Utilities a = new Common.Utilities();
         idnew = a.ProcessID(lid.ID);
         return(idnew);
     }
     catch (Exception ex)
     {
         return("");
     }
 }
Пример #7
0
        public string LayID(string tenBang)
        {
            string idnew = "";

            Entities.LayID lid = new Entities.LayID();

            lid = (Entities.LayID) new BizLogic.Lay_ID().Select(lid);
            if (lid != null)
            {
                Common.Utilities a = new Common.Utilities();
                idnew = a.ProcessID(lid.ID);
            }
            else
            {
                if (lid == null)
                {
                    idnew = "SDK_0001";
                }
            }
            return(idnew);
        }
Пример #8
0
 /// <summary>
 /// tu tang ID
 /// </summary>
 private void getID(string table)
 {
     try
     {
         Entities.LayID top = new Entities.LayID();
         cl          = new Server_Client.Client();
         this.client = cl.Connect(Luu.IP, Luu.Ports);
         top         = new Entities.LayID("Select", table);
         clientstrem = cl.SerializeObj(this.client, "LayID", top);
         Entities.LayID ddh = new Entities.LayID();
         ddh = (Entities.LayID)cl.DeserializeHepper(clientstrem, ddh);
         string           chuoi = ddh.ID.ToString();
         Common.Utilities com   = new Common.Utilities();
         txtSodonhang.Text = com.ProcessID(chuoi);
     }
     catch (Exception ex)
     {
         string s = ex.Message;
     }
     client.Close();
     clientstrem.Close();
 }
Пример #9
0
 /// <summary>
 /// tu tang ID
 /// </summary>
 private void getID(string table)
 {
     try
     {
         Entities.LayID top = new Entities.LayID();
         cl = new Server_Client.Client();
         this.client = cl.Connect(Luu.IP, Luu.Ports);
         top = new Entities.LayID("Select", table);
         clientstrem = cl.SerializeObj(this.client, "LayID", top);
         Entities.LayID ddh = new Entities.LayID();
         ddh = (Entities.LayID)cl.DeserializeHepper(clientstrem, ddh);
         string chuoi = ddh.ID.ToString();
         Common.Utilities com = new Common.Utilities();
         txtSodonhang.Text = com.ProcessID(chuoi);
     }
     catch (Exception ex)
     {
         string s = ex.Message;
     }
     client.Close();
     clientstrem.Close();
 }
Пример #10
0
 private void getID(string table)
 {
     try
     {
         Entities.LayID top = new Entities.LayID();
         cl = new Server_Client.Client();
         this.client = cl.Connect(Luu.IP, Luu.Ports);
         top = new Entities.LayID("Select", table);
         clientstrem = cl.SerializeObj(this.client, "LayID", top);
         Entities.LayID ddh = new Entities.LayID();
         ddh = (Entities.LayID)cl.DeserializeHepper(clientstrem, ddh);
         client.Close();
         clientstrem.Close();
         if (ddh.ID.Length > 0)
         {
             Common.Utilities com = new Common.Utilities();
             makiemke = com.ProcessID(ddh.ID.ToString());
         }
         else
         { makiemke = "KK_0001"; }
     }
     catch (Exception ex)
     {
         string s = ex.Message;
         makiemke = "KK_0001";
     }
 }
 /// <summary>
 /// Lấy giá trị id cuối cùng
 /// </summary>
 /// <param name="tenBang"></param>
 /// <returns></returns>
 public string ProID(string tenBang)
 {
     try
     {
         string idnew;
         Server_Client.Client cl = new Server_Client.Client();
         // gán TCPclient
         this.tcpClient = 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 = cl.SerializeObj(this.tcpClient, "LayID", lid1);
         // đổ mảng đối tượng vào datagripview
         lid = (Entities.LayID)cl.DeserializeHepper(networkStream, lhh);
         if (lid == null)
         {
             return "QDDVT_0001";
         }
         Common.Utilities a = new Common.Utilities();
         idnew = a.ProcessID(lid.ID);
         return idnew;
     }
     finally
     { }
 }
Пример #12
0
 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 ""; }
 }
Пример #13
0
 /// <summary>
 /// Lấy giá trị id cuối cùng
 /// </summary>
 /// <param name="tenBang"></param>
 /// <returns></returns>
 public string ProID(string tenBang)
 {
     try
     {
         string idnew;
         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.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, lid);
         if (lid == null)
         {
             return "NCC_0001";
         }
         Common.Utilities a = new Common.Utilities();
         idnew = a.ProcessID(lid.ID);
         //idnew =(Convert.ToInt32( lid.ID)+1).ToString();
         return idnew;
     }
     finally
     { }
 }
Пример #14
0
 private void getID(string table)
 {
     try
     {
         Entities.LayID top = new Entities.LayID();
         cl = new Server_Client.Client();
         this.tcpClient = cl.Connect(Luu.IP, Luu.Ports);
         top = new Entities.LayID("Select", table);
         networkStream = cl.SerializeObj(this.tcpClient, "LayID", top);
         Entities.LayID ddh = new Entities.LayID();
         ddh = (Entities.LayID)cl.DeserializeHepper(networkStream, ddh);
         tcpClient.Close();
         networkStream.Close();
         if (ddh.ID != null)
         {
             string chuoi = ddh.ID.ToString();
             Common.Utilities com = new Common.Utilities();
             makiemtra = com.ProcessID(chuoi);
         }
         else
         {
             makiemtra = "MK_0001";
             txtMaKho.Text = "";
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message.ToString();
         if (txtMaKho.Text == "")
         {
             makiemtra = "MK_0001";
             txtMaKho.Text = "";
         }
     }
 }
 public string LayID(string tenBang)
 {
     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, lid1);
     if (lid != null)
     {
         Common.Utilities a = new Common.Utilities();
         idnew = a.ProcessID(lid.ID);
     }
     else
     {
         if (lid == null)
         {
             idnew = "PDCK_0001";
         }
     }
     return idnew;
 }
Пример #16
0
 public string ProIddtkh(string tenBang)
 {
     try
     {
         cl = new Server_Client.Client();
         // gán 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
         LayID lid1 = new LayID("Select", tenBang);
         // khởi tạo mảng đối tượng để hứng giá trị
         LayID lid = new LayID();
         Clientstrem = cl.SerializeObj(Client1, "LayID", lid1);
         // đổ mảng đối tượng vào datagripview
         lid = (LayID)cl.DeserializeHepper(Clientstrem, lid);
         if (lid == null)
             return "DTKH_0001";
         Common.Utilities a = new Common.Utilities();
         string idnew = a.ProcessID(lid.ID);
         return idnew;
     }
     catch { return ""; }
 }
Пример #17
0
 private void getID(string table)
 {
     try
     {
         Entities.LayID top = new Entities.LayID();
         cl = new Server_Client.Client();
         this.client = cl.Connect(Luu.IP, Luu.Ports);
         top = new Entities.LayID("Select", table);
         clientstrem = cl.SerializeObj(this.client, "LayID", top);
         Entities.LayID ddh = new Entities.LayID();
         ddh = (Entities.LayID)cl.DeserializeHepper(clientstrem, ddh);
         client.Close();
         clientstrem.Close();
         if (ddh != null)
         {
             string chuoi = ddh.ID.ToString();
             Common.Utilities com = new Common.Utilities();
             makiemtra = com.ProcessID(chuoi);
         }
         else
         {
             if (hanhDong == "Them_KhachHangTraLai")
             {
                 makiemtra = "KHTL_0001";
             }
             if (hanhDong == "Them_TraLaiNhaCungCap")
             {
                 makiemtra = "TLNCC_0001";
             }
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message;
         txtSodonhang.Text = "";
         if (hanhDong == "Them_KhachHangTraLai")
         {
             makiemtra = "KHTL_0001";
         }
         if (hanhDong == "Them_TraLaiNhaCungCap")
         {
             makiemtra = "TLNCC_0001";
         }
     }
 }
Пример #18
0
        public string LayID(string tenBang)
        {
            string idnew = "";
            Entities.LayID lid = new Entities.LayID();

            lid = (Entities.LayID)new BizLogic.Lay_ID().Select(lid);
            if (lid != null)
            {
                Common.Utilities a = new Common.Utilities();
                idnew = a.ProcessID(lid.ID);
            }
            else
            {
                if (lid == null)
                {
                    idnew = "SDK_0001";
                }
            }
            return idnew;
        }
Пример #19
0
        public string LayID(string tenBang)
        {
            string idnew = "";
            Server_Client.Client client = new Server_Client.Client();
            this.tcpClient = client.Connect(Luu.IP, Luu.Ports);
            Entities.LayID lid1 = new Entities.LayID("Select", tenBang);
            Entities.LayID lid = new Entities.LayID();
            networkStream = client.SerializeObj(this.tcpClient, "LayID", lid1);
            lid = (Entities.LayID)client.DeserializeHepper(networkStream, lid);

            if (lid == null)
            {
                idnew = "CNG_0001";
            }
            else
            {
                Common.Utilities a = new Common.Utilities();
                idnew = a.ProcessID(lid.ID);
            }
            return idnew;
        }