예제 #1
0
        public ActionResult ChinhSuaCongTy(CongTiesViewModel Congty)
        {
            var model = CongTiesQueries.LayThongTinChiTietCty(Congty.MaCongTy);

            CongTiesQueries.Chinhsua_CongTy(Congty);
            return(RedirectToAction("MenuDanhSachCongTy", "CongTy"));
        }
예제 #2
0
        //thêm công ty
        public static Boolean ThemCongTy(CongTiesViewModel CT)
        {
            var entity = new QuanLyThueXeEntities();

            try
            {
                var Ct = new CongTy();
                Ct.MaCongTy    = TuTangMaCT();
                Ct.TenCongTy   = CT.TenCongTy;
                Ct.Email       = CT.Email;
                Ct.DiaChi      = CT.DiaChi;
                Ct.SDT         = CT.SDT;
                Ct.Fax         = CT.Fax;
                Ct.NguoiLienHe = CT.NguoiLienHe;
                Ct.GhiChu      = CT.GhiChu;
                Ct.Dang        = true;
                entity.CongTies.Add(Ct);
                entity.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                entity.Dispose();
                return(false);
            }
        }
예제 #3
0
        //chỉnh sửa thông tin công ty
        public static Boolean Chinhsua_CongTy(CongTiesViewModel Congty)
        {
            var entity = new QuanLyThueXeEntities();

            try
            {
                var ct = entity.CongTies.SingleOrDefault(n => n.MaCongTy == Congty.MaCongTy);
                ct.TenCongTy   = Congty.TenCongTy;
                ct.Email       = Congty.Email;
                ct.DiaChi      = Congty.DiaChi;
                ct.SDT         = Congty.SDT;
                ct.Fax         = Congty.Fax;
                ct.NguoiLienHe = Congty.NguoiLienHe;
                ct.GhiChu      = Congty.GhiChu;
                ct.Dang        = true;
                entity.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                entity.Dispose();
                return(false);
            }
        }
예제 #4
0
 public ActionResult MenuThemCongTy(CongTiesViewModel CongTy)
 {
     CongTiesQueries.ThemCongTy(CongTy);
     return(RedirectToAction("MenuDanhSachCongTy", "CongTy"));
 }