/// <summary> /// Kullanici icin girilen bilgiye göre entity sorgulanır /// Elde edilen sonuca göre LoginEnums döner. /// </summary> /// <param name="kullanici"></param> /// <returns></returns> public int KullaniciGiris(KullaniciDto kullanici) { int result = -1; DynamicTryCatch.TryCatchLogla(() => { if (!string.IsNullOrEmpty(kullanici.KullaniciAdi) && !string.IsNullOrEmpty(kullanici.Sifre)) { result = dalKullanici.KullaniciGiris(kullanici); } }, ""); return(result); }
/// <summary> /// DepoDto tipinde entity alır ve veritabanında deaktive eder. /// Hata alması durumunda CudEnums döner. /// </summary> /// <param name="depo"></param> /// <returns></returns> public CudEnums DepoSil(DepoDto depo) { CudEnums enums = CudEnums.VeritabaniHatasi; DynamicTryCatch.TryCatchLogla(() => { depo.AktifMi = false; int result = dalDepo.DepoDuzenle(depo); if (result > 0) { enums = CudEnums.IslemBasarili; } }, MethodBase.GetCurrentMethod().Name); return(enums); }
/// <summary> /// StokHareketleriDto tipinde entity alır ve StokHareketDal nesnesine göndererek datayı deaktif eder. /// İşlem durumuna göre enum döner. /// </summary> /// <param name="stokHareketleri"></param> /// <returns></returns> public CudEnums StokHareketiSil(StokHareketleriDto stokHareketleri) { CudEnums enums = CudEnums.VeritabaniHatasi; DynamicTryCatch.TryCatchLogla(() => { stokHareketleri.AktifMi = false; int result = dalStokHareket.StokHareketiSil(stokHareketleri); if (result > 0) { enums = CudEnums.IslemBasarili; } }, MethodBase.GetCurrentMethod().Name); return(enums); }
/// <summary> /// Girilen şifreyi decode ederek kontrol eder. Giriş başarılı ise kullanıcı ID'si döner. /// Hata alması ya da değer bulamaması durumunda -1 döner. /// </summary> /// <param name="kullanici"></param> /// <returns></returns> public int KullaniciGiris(KullaniciDto kullanici) { int kullaniciId = -1; KullaniciDto kullaniciDto = new KullaniciDto(); DynamicTryCatch.TryCatchLogla(() => { PasswordHash passwordHash = new PasswordHash(); string password = passwordHash.Hash(kullanici.Sifre); kullaniciDto = _uow.GenericRepository <KullaniciDto>().FirstOrDefault(x => x.KullaniciAdi == kullanici.KullaniciAdi && x.Sifre == password); kullaniciId = kullaniciDto.KullaniciId; }, "StokTakibi.DAL.Operations.Kullanici.KullaniciGiris"); return(kullaniciId); }
private void InitilizeStokKarti() { txtStokKodu.Text = dtoStokKarti.StokKodu; txtStokAdi.Text = dtoStokKarti.StokAdi; cmbKdv.Text = dtoStokKarti.Kdv.ToString(); txtFiyat.Text = dtoStokKarti.Fiyat.ToString(); lookUpDepo.EditValue = dtoStokKarti.DepoId; txtAciklama.Text = dtoStokKarti.Aciklama; dtpKayitTarihi.DateTime = dtoStokKarti.KayitTarihi; DynamicTryCatch.TryCatchLogla(() => { MemoryStream ms = new MemoryStream(dtoStokKarti.Resim, 0, dtoStokKarti.Resim.Length); ms.Write(dtoStokKarti.Resim, 0, dtoStokKarti.Resim.Length); pictureBox1.Image = Image.FromStream(ms, true); }, MethodBase.GetCurrentMethod().Name); }
/// <summary> /// StokHareketTipiDto olarak aldığı entityi procedure ile veritabanına ekler /// Hata alması durumunda -1 döner /// </summary> /// <param name="stokHareketleri"></param> /// <returns></returns> public int StokHareketTipiEkle(StokHareketTipiDto stokHareketleri) { int result = -1; DynamicTryCatch.TryCatchLogla(() => { result = _uow.GenericRepository <StokHareketTipiDto>().InsertWithProcedure("" + "exec Insert_Stok_Hareket_Tipi @StokHareketTipi,@AktifMi", new SqlParameter("@StokHareketTipi", SqlDbType.NVarChar) { Value = stokHareketleri.HareketTipi }, new SqlParameter("@AktifMi", SqlDbType.Bit) { Value = stokHareketleri.AktifMi } ); }, MethodBase.GetCurrentMethod().Name); return(result); }
/// <summary> /// Depo tipinde entity alır ve DepoDAL nesnesine gönderir. /// Hata alması durumunda CudEnums döner. /// </summary> /// <param name="depo"></param> /// <returns></returns> public CudEnums DepoEkle(DepoDto depo) { CudEnums enums = CudEnums.EksikParametreHatasi; DynamicTryCatch.TryCatchLogla(() => { if (!string.IsNullOrEmpty(depo.DepoAdi) && !string.IsNullOrEmpty(depo.DepoKodu)) { int result = dalDepo.DepoEkle(depo); if (result > 0) { enums = CudEnums.IslemBasarili; } else { enums = CudEnums.VeritabaniHatasi; } } }, MethodBase.GetCurrentMethod().Name); return(enums); }
/// <summary> /// StokHareketleriDto tipinde entity alır ve procedure ile veritabanına gönderir. /// Hata alması durumunda -1 başarılı olması durumunda 1 geri döner. /// </summary> /// <param name="stokHareketleri"></param> /// <returns></returns> public int StokHareketiEkle(StokHareketleriDto stokHareketleri) { int result = -1; DynamicTryCatch.TryCatchLogla(() => { result = _uow.GenericRepository <StokHareketleriDto>().InsertWithProcedure( "Insert_StokHareketleri @FisNo,@Miktar,@HareketDurumId,@StokKartId,@KayitTarihi,@KullaniciId,@AktifMi", new SqlParameter("@FisNo", SqlDbType.NVarChar) { Value = stokHareketleri.FisNo }, new SqlParameter("@Miktar", SqlDbType.Int) { Value = stokHareketleri.Miktar }, new SqlParameter("@HareketDurumId", SqlDbType.Int) { Value = stokHareketleri.HareketDurumId }, new SqlParameter("@StokKartId", SqlDbType.Int) { Value = stokHareketleri.StokKartId }, new SqlParameter("@KayitTarihi", SqlDbType.DateTime) { Value = stokHareketleri.KayitTarihi }, new SqlParameter("@KullaniciId", SqlDbType.Int) { Value = stokHareketleri.KullaniciId }, new SqlParameter("@AktifMi", SqlDbType.Bit) { Value = stokHareketleri.AktifMi }); }, MethodBase.GetCurrentMethod().Name); return(result); }