示例#1
0
 public void XuLy_ThueH(NetworkStream clientStream)
 {
     Entities.Thue lhh = (Entities.Thue)formatter.Deserialize(clientStream);
     switch (lhh.HanhDong)
     {
         case "Insert":
             {
                 int kt = new BizLogic.ThueH().InsertUpdate(lhh);
                 if (kt == 1)
                 {
                     new BizLogic.LogFile().GhiFile(new Entities.LogFile(lhh.MaNhanVien, lhh.TenDangNhap, lhh.HanhDong, DateTime.Now.ToString(), "Thêm thuế: " + lhh.MaThue));
                 }
                 formatter.Serialize(clientStream, kt);
                 break;
             }
         case "Update":
             {
                 int kt = new BizLogic.ThueH().InsertUpdate(lhh);
                 if (kt == 1)
                 {
                     new BizLogic.LogFile().GhiFile(new Entities.LogFile(lhh.MaNhanVien, lhh.TenDangNhap, lhh.HanhDong, DateTime.Now.ToString(), "Sửa thuế: " + lhh.MaThue));
                 }
                 formatter.Serialize(clientStream, kt);
                 break;
             }
         case "Delete":
             {
                 new BizLogic.ThueH().Delete(lhh);
                 bool kt = true;
                 formatter.Serialize(clientStream, kt);
                 break;
             }
         case "Select":
             {
                 Entities.Thue[] lhhang = new BizLogic.ThueH().sp_SelectThuesAll();
                 formatter.Serialize(clientStream, lhhang);
                 break;
             }
         default:
             break;
     }
 }
示例#2
0
 public string LayThue(string MaThue)
 {
     try
     {
         Entities.Thue[] nh = new BizLogic.ThueH().sp_SelectThuesAll();
         if (nh == null)
         {
             return "";
         }
         for (int i = 0; i < nh.Length; i++)
         {
             if (nh[i].MaThue == MaThue)
             {
                 return nh[i].TenThue;
             }
         }
         return "";
     }
     catch { return ""; }
 }