コード例 #1
0
 public static void DepartmanGuncelle(int departmanId, string departmanAdi, int personelId)
 {
     using (var context = new DataContext2())
     {
         context.sp_DepartmanGuncelle(departmanId, departmanAdi, personelId);
     }
 }
コード例 #2
0
 public UnitOfWork(DataContext1 dataContext1, DataContext2 dataContext2)
 {
     _dataContext1     = dataContext1;
     _dataContext2     = dataContext2;
     UserRepository    = new UserRepository(dataContext1);
     ProductRepository = new ProductRepository(dataContext2);
 }
コード例 #3
0
 public static void Edit(Claim model)
 {
     using (DataContext2 db = new DataContext2())
     {
         Claims Claims = new Claims
         {
             kClaimId          = model.kClaimId,
             kInsuranceId      = model.kInsuranceId,
             kProductId        = model.kProductId,
             kStaffId          = model.kStaffId ?? Guid.Empty,
             kOwnerId          = model.kOwnerId ?? Guid.Empty,
             sClaimNo          = model.sClaimNo,
             sRepairNo         = model.sRepairNo,
             sSerial           = model.sSerial,
             dtInsuranceExpire = model.dtInsuranceExpire,
             dtDateAdd         = model.dtDateAdd,
             dtDateUpdate      = model.dtDateUpdate,
             IsComplete        = model.IsComplete,
             IsRecieved        = model.IsRecieved,
             IsNoCredit        = model.IsNoCredit
         };
         db.Entry(Claims).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #4
0
 public static void DemirbasGuncelle(int demirbasNo, int sirketId, int departmanId, int demirbasAdedi, string demirbasOzellikler)
 {
     using (var context = new DataContext2())
     {
         context.sp_DemirbasDuzenle(demirbasNo, sirketId, departmanId, demirbasAdedi, demirbasOzellikler);
     }
 }
コード例 #5
0
 public static void UrunDuzenle(Urunler urun, int stok)
 {
     using (var context = new DataContext2())
     {
         context.sp_UrunGuncelle(urun.UrunId, urun.UrunAdi, urun.UrunBirimFiyati, stok, urun.SatinAlinmaTarihi, urun.UrunToptanFiyati, urun.SatinAlinilanKurum);
     }
 }
コード例 #6
0
 public static void DepartmanaDemirbasEkle(int demirbasId, int departmanId, int adet)
 {
     using (var context = new DataContext2())
     {
         context.sp_DepartmanaDemirbasEkle(demirbasId, departmanId, adet);
     }
 }
コード例 #7
0
 public static Demirbaslar DemirbasGetir(int demirbasNo)
 {
     using (var context = new DataContext2())
     {
         var result = context.Demirbaslars.FirstOrDefault(x => x.DemirbasNo == demirbasNo);
         return(result);
     }
 }
コード例 #8
0
 public static void DemirbasEkle(DemirbasView demirbas)
 {
     using (var context = new DataContext2())
     {
         context.sp_DemirbasEkle(demirbas.Departman.DepartmanId, demirbas.Sirket.SirketId, demirbas.Urun.UrunId, demirbas.Demirbas.DemirbasAdedi, demirbas.Demirbas.DemirbasOzellikleri);
         context.SaveChanges();
     }
 }
コード例 #9
0
 public static IEnumerable <object> DepartmanDemirbaslariList(int departmanId)
 {
     using (var context = new DataContext2())
     {
         var result = context.sp_Departmandaki_Demirbaslar02(departmanId);
         return(result.ToList());
     }
 }
コード例 #10
0
 public static List <Personeller> KullanicilariListele()
 {
     using (var context = new DataContext2())
     {
         var result = context.Personellers;
         return(result.ToList());
     }
 }
コード例 #11
0
 public static List <Sirketler> SirkerleriListele()
 {
     using (var context = new DataContext2())
     {
         var result = context.Sirketlers.ToList();
         return(result.ToList());
     }
 }
コード例 #12
0
 public static List <Demirbaslar> DemirbaslariListele()
 {
     using (var context = new DataContext2())
     {
         var result = context.Demirbaslars.ToList();
         return(result);
     }
 }
コード例 #13
0
 public static void DemirbasSil(int demirbasNo)
 {
     using (var context = new DataContext2())
     {
         var result = context.Demirbaslars.FirstOrDefault(x => x.DemirbasNo == demirbasNo);
         context.Entry(result).State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
コード例 #14
0
 public static void DepartmanSil(int departmanId)
 {
     using (var context = new DataContext2())
     {
         var result = context.Departmanlars.FirstOrDefault(x => x.DepartmanId == departmanId);
         context.Entry(result).State = System.Data.Entity.EntityState.Deleted;
         context.SaveChanges();
     }
 }
コード例 #15
0
 public static void departmanDemirbasSil(int demirbasDepartmanId)
 {
     using (var context = new DataContext2())
     {
         var result = context.DemirbasDepartmen.FirstOrDefault(x => x.DemirbasDepartmanId == demirbasDepartmanId);
         context.Entry(result).State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
コード例 #16
0
 public static void UrunSil(int urunId)
 {
     using (var context = new DataContext2())
     {
         var result = context.Urunlers.FirstOrDefault(x => x.UrunId == urunId);
         context.Entry(result).State = EntityState.Deleted;
         //context.SaveChanges();
     }
 }
コード例 #17
0
 public UnitOfWork(DataContext1 dataContext1, DataContext2 dataContext2, DataContext3 dataContext3)
 {
     _dataContext1      = dataContext1;
     _dataContext2      = dataContext2;
     _dataContext3      = dataContext3;
     UserRepository     = new UserRepository(dataContext1);
     UserLogRepository  = new UserLogRepository(dataContext2);
     CategoryRepository = new CategoryRepository(dataContext3);
     ProductRepository  = new ProductRepository(dataContext3);
 }
コード例 #18
0
 public static void PersonelEkle(Kullanicilar personel)
 {
     /*if ((string.IsNullOrEmpty(personeller.Personeller.Ad) == null)|| (string.IsNullOrEmpty(personeller.Personeller.Soyad) == null))
      * {
      *  throw new ValidationException("Hata");
      * }*/
     using (var context = new DataContext2())
     {
         context.sp_PersonelEkle(personel.Personeller.Soyad);
     }
 }
コード例 #19
0
 public static void UrunEkle(Urunler urun, int stok)
 {
     if (urun == null || stok == 0)
     {
         throw new ValidationException("Hata");
     }
     using (var context = new DataContext2())
     {
         context.sp_UrunEkle(urun.UrunAdi, urun.UrunBirimFiyati, stok, urun.SatinAlinmaTarihi, urun.UrunToptanFiyati, urun.SatinAlinilanKurum);
     }
 }
コード例 #20
0
 public static void DepartmanYetkilendir(int personelId, int departmanId)
 {
     using (var context = new DataContext2())
     {
         Zimmetler z = new Zimmetler();
         z.PersonelId  = personelId;
         z.DepartmanId = departmanId;
         context.Zimmetlers.Add(z);
         context.SaveChanges();
     }
 }
コード例 #21
0
 private static void UserLoginDate(Kullanicilar modelUser)
 {
     using (var context = new DataContext2())
     {
         var result = context.Kullanicilars.FirstOrDefault(x => x.KullaniciId == modelUser.KullaniciId);
         if (result != null)
         {
             result.SonGirisTarihi       = DateTime.Now;
             context.Entry(result).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
         }
     }
 }
コード例 #22
0
 public static List <StokUrunView> SilinenleriGetir()
 {
     using (var context = new DataContext2())
     {
         var result = from urun in context.Urunlers
                      join stok in context.Urun_Stok
                      on urun.UrunId equals stok.UrunId
                      select new StokUrunView
         {
             UrunStok = stok,
             Urun     = urun
         };
         return(result.Where(x => x.Urun.Silindi == Convert.ToBoolean(EDeleted.silindi)).ToList());
     }
 }
コード例 #23
0
        public static List <DepartmanView> TumDepartmanlariGetir()
        {
            using (var context = new DataContext2())
            {
                var result = from Sirket in context.Sirketlers
                             join departman in context.Departmanlars on Sirket.SirketId equals departman.DepartmanId


                             select new DepartmanView
                {
                    Departman = departman
                };
                return(result.ToList());
            }
        }
コード例 #24
0
 public static List <DepartmanPersonelView> DepartmanSorumlulariListele()
 {
     using (var context = new DataContext2())
     {
         var result = from p in context.Personellers
                      join z in context.Zimmetlers on p.PersonelId equals z.PersonelId
                      join o in context.Departmanlars on z.DepartmanId equals o.DepartmanId
                      select new DepartmanPersonelView
         {
             Personel  = p,
             Departman = o,
             Zimmet    = z
         };
         return(result.ToList());
     }
 }
コード例 #25
0
        public static StokUrunView UrunGetir(int urunId)
        {
            using (var context = new DataContext2())
            {
                var result = from urunStok in context.Urun_Stok
                             join urun in context.Urunlers
                             on urunStok.UrunId equals urun.UrunId
                             select new StokUrunView
                {
                    Urun     = urun,
                    UrunStok = urunStok
                };

                return(result.FirstOrDefault(x => x.Urun.UrunId == urunId));
            }
        }
コード例 #26
0
 public static List <DepartmanPersonelView> KullaniciSorumluDepartmanlar(int personelId)
 {
     using (var context = new DataContext2())
     {
         var result = from departman in context.Departmanlars
                      join zim in context.Zimmetlers on departman.DepartmanId equals zim.DepartmanId
                      join p in context.Personellers on zim.PersonelId equals p.PersonelId
                      select new DepartmanPersonelView
         {
             Personel  = p,
             Departman = departman,
             Zimmet    = zim,
         };
         return(result.Where(x => x.Personel.PersonelId == personelId).ToList());
     }
 }
コード例 #27
0
        public static void DepartmanEkle(string departmanAdi, int sirketId)
        {
            if (string.IsNullOrEmpty(departmanAdi) || sirketId == 0)
            {
                throw new ValidationException("Departman adı ve departman ıd Boş Geçilemez !");
            }
            var result = TumDepartmanlariGetir().FirstOrDefault(x => x.Departman.DepartmanAdi == departmanAdi);

            if (result != null)
            {
                throw new Exception("Bu isimdeki departman mevcuttur!");
            }
            using (var context = new DataContext2())
            {
                context.sp_DepartmanEkle(departmanAdi, sirketId);
            }
        }
コード例 #28
0
 public static List <DepartmanPersonelView> KullaniciZimmetleri(int personelId)
 {
     using (var context = new DataContext2())
     {
         var result = from departman in context.Departmanlars
                      join zim in context.Zimmetlers on departman.DepartmanId equals zim.DepartmanId
                      join demirbasDepartman in context.DemirbasDepartmen on zim.ZimmetId equals demirbasDepartman.ZimmetId
                      join db in context.Demirbaslars on demirbasDepartman.DemirbasId equals db.DemirbasNo
                      join p in context.Personellers on zim.PersonelId equals p.PersonelId
                      select new DepartmanPersonelView
         {
             Personel  = p,
             Departman = departman,
             Zimmet    = zim,
             Demirbas  = db
         };
         return(result.Where(x => x.Personel.PersonelId == personelId).ToList());
     }
 }
コード例 #29
0
 public static PersonelKullaniciView PersonelGetir(int personelId)
 {
     if (personelId == 0)
     {
         throw new TargetParameterCountException("Kullanici Getirilemedi !");
     }
     using (var context = new DataContext2())
     {
         var result = from personel in context.Personellers
                      join kullanici in context.Kullanicilars on personel.PersonelId equals kullanici.KullaniciId
                      join kullaniciRol in context.KullaniciRols on kullanici.KullaniciId equals kullaniciRol.KullaniciId
                      join rol in context.Rollers on kullaniciRol.RolId equals rol.RolId
                      select new PersonelKullaniciView
         {
             Personel  = personel,
             Kullanici = kullanici,
             Rol       = rol
         };
         return(result.FirstOrDefault(x => x.Personel.PersonelId == personelId));
     }
 }
コード例 #30
0
 public static void Edit(Repair model)
 {
     using (DataContext2 db = new DataContext2())
     {
         Repairs Repairs = new Repairs
         {
             kRepairId           = model.kRepairId,
             kCustomerId         = model.kCustomerId,
             kProductId          = model.kProductId,
             kBookingId          = model.kBookingId ?? Guid.Empty,
             kOwnerId            = model.kOwnerId ?? Guid.Empty,
             kStaffId            = model.kStaffId ?? Guid.Empty,
             kQCId               = model.kQCId ?? Guid.Empty,
             sRepairNo           = model.sRepairNo,
             sColor              = model.sColor,
             sSerial             = model.sSerial,
             dtInsuranceExpire   = model.dtInsuranceExpire,
             sNote               = model.sNote,
             sProductAccessories = model.sProductAccessories,
             iDayWarranty        = model.iDayWarranty,
             dtEndWarranty       = model.dtEndWarranty,
             dtDueDate           = model.dtDueDate,
             dtDateAdd           = model.dtDateAdd,
             dtDateUpdate        = model.dtDateUpdate,
             IsComplete          = model.IsComplete,
             IsCustomerRecieved  = model.IsCustomerRecieved,
             iRemind             = model.iRemind,
             kCloseStatusId      = model.kCloseStatusId ?? Guid.Empty,
             IsNormal            = model.IsNormal,
             IsNoCredit          = model.IsNoCredit,
             IsQCPass            = model.IsQCPass,
             IsBack              = model.IsBack,
             IsInsurance         = model.IsInsurance,
             IsCancle            = model.IsCancle,
             IsFree              = model.IsFree
         };
         db.Entry(Repairs).State = EntityState.Modified;
         db.SaveChanges();
     }
 }