Esempio n. 1
0
 public void Xoa(int?CoQuanId, int CanBoXoaId)
 {
     if (CoQuanId.HasValue)
     {
         CoQuanService _coQuan = new CoQuanService();
         CoQuan        coQuan  = _coQuan.FindByKey(CoQuanId);
         if (coQuan != null)
         {
             coQuan.DaXoa      = true;
             coQuan.CanBoXoaId = CanBoXoaId;
             _coQuan.Update(coQuan);
         }
     }
 }
Esempio n. 2
0
        public CoQuan ThemMoi(int?CoQuanId
                              , string MaCoQuan
                              , string TenCoQuan
                              , int?ThuocCoQuanId
                              , string DienThoai
                              , string Email
                              , string DiaChi
                              , string QuyetDinhThanhLap
                              , string GhiChu
                              , string ThuTuUuTien
                              , bool ConHoatDong
                              , string NgayBatDau
                              , string NgayKetThuc
                              , bool LaCoQuanPhatSinh
                              , int CanBoTaoId)
        {
            CoQuanService _coQuan = new CoQuanService();
            CoQuan        coQuan  = new CoQuan();

            if (CoQuanId.HasValue && CoQuanId > 0)
            {
                coQuan = _coQuan.FindByKey(CoQuanId);
            }
            coQuan.MaCoQuan          = MaCoQuan;
            coQuan.TenCoQuan         = TenCoQuan;
            coQuan.ThuocCoQuanId     = ThuocCoQuanId;
            coQuan.DienThoai         = DienThoai;
            coQuan.Email             = Email;
            coQuan.DiaChi            = DiaChi;
            coQuan.QuyetDinhThanhLap = QuyetDinhThanhLap;
            coQuan.GhiChu            = GhiChu;
            coQuan.ThuTuUuTien       = TypeHelper.ToInt32(ThuTuUuTien);
            coQuan.ConHoatDong       = ConHoatDong;
            coQuan.LaCoQuanPhatSinh  = LaCoQuanPhatSinh;
            if (LaCoQuanPhatSinh == true)
            {
                if (!string.IsNullOrEmpty(NgayBatDau))
                {
                    coQuan.NgayBatDau = TypeHelper.ToDate(NgayBatDau);
                }
                if (!string.IsNullOrEmpty(NgayKetThuc))
                {
                    coQuan.NgayKetThuc = TypeHelper.ToDate(NgayKetThuc);
                }
            }
            else
            {
                coQuan.NgayBatDau  = null;
                coQuan.NgayKetThuc = null;
            }

            coQuan.CanBoTaoId = CanBoTaoId;
            if (CoQuanId.HasValue && CoQuanId > 0)
            {
                _coQuan.Update(coQuan);
            }
            else
            {
                coQuan.DaXoa   = false;
                coQuan.NgayTao = DateTime.Now;
                _coQuan.Insert(coQuan);
            }
            return(coQuan);
        }