Ejemplo n.º 1
0
        public JsonResult KullaniciGetirDDLText(string AramaKriter)
        {
            // System.Threading.Thread.Sleep(2000);
            SonucModel <DDlTextModel> oSonucModel = new SonucModel <DDlTextModel>()
            {
                Durum = "H", Aciklama = ""
            };

            ArgemSQL oSQL = new ArgemSQL();

            oSQL.CommandText =
                "SELECT * FROM public.\"KULLANICI\"";

            if (!string.IsNullOrEmpty(AramaKriter))
            {
                oSQL.Gecen("Ad", AramaKriter);
                oSQL.OR();
                oSQL.Gecen("Soyad", AramaKriter);
                oSQL.OrderByAsc("Ad,Soyad");

                using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
                {
                    DataTable dt = new DataTable();
                    oData.DataGetir(ref dt, oSQL);

                    if (dt.Rows.Count > 0)
                    {
                        List <DDlTextModel> aryDDlTextModel = new List <DDlTextModel>();
                        foreach (DataRow dr in dt.Rows)
                        {
                            DDlTextModel oDDlTextModel = new DDlTextModel()
                            {
                                Key  = Convert.ToInt32(dr["KullaniciKey"]),
                                Text = dr["Ad"].ToString() + " " + dr["Soyad"].ToString()
                            };
                            aryDDlTextModel.Add(oDDlTextModel);
                        }

                        oSonucModel.Durum = "";
                        oSonucModel.Data  = aryDDlTextModel;
                    }
                    else
                    {
                        oSonucModel.Aciklama = "Aradığınız kritere uygun kullanıcı kaydı bulunamadı";
                    }
                }
            }
            else
            {
                oSonucModel.Aciklama = "Kritere uygun kayıt bulunamadı";
            }

            return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public JsonResult YetkiGrupAraSonuc(YetkiGrupModel oYetkiGrupModel)
        {
            SonucModel <YetkiGrupModel> oSonucModel = new SonucModel <YetkiGrupModel>()
            {
                Durum = "H", Aciklama = ""
            };

            ArgemSQL oSQL = new ArgemSQL();

            oSQL.CommandText =
                "SELECT * FROM public.\"YETKI_GRUP\"";
            if (oYetkiGrupModel.YetkiGrupKey != 0)
            {
                oSQL.Esit("YetkiGrupKey", oYetkiGrupModel.YetkiGrupKey, KolonTipi.Int, true);
            }
            else if (!string.IsNullOrEmpty(oYetkiGrupModel.YetkiGrupAd))
            {
                oSQL.Gecen("YetkiGrupAd", oYetkiGrupModel.YetkiGrupAd);
            }
            oSQL.OrderByAsc("YetkiGrupAd");

            using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
            {
                DataTable dt = new DataTable();
                oData.DataGetir(ref dt, oSQL);

                if (dt.Rows.Count > 0)
                {
                    List <YetkiGrupModel> aryYetkiGrupModel = new List <YetkiGrupModel>();
                    foreach (DataRow dr in dt.Rows)
                    {
                        oYetkiGrupModel = new YetkiGrupModel()
                        {
                            YetkiGrupKey = Convert.ToInt32(dr["YetkiGrupKey"]),
                            YetkiGrupAd  = dr["YetkiGrupAd"].ToString(),
                            S            = 0
                        };
                        aryYetkiGrupModel.Add(oYetkiGrupModel);
                    }

                    oSonucModel.Durum = "";
                    oSonucModel.Data  = aryYetkiGrupModel;
                }
                else
                {
                    oSonucModel.Aciklama = "Aradığınız kritere uygun kayıt bulunamadı";
                }

                return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 3
0
        public JsonResult KullaniciAraSonuc(int SayfaKayitAdet, int AktifSayfaNo, int SiraTip, string SiraAlan, KullaniciModel oKullaniciModel)
        {
            // System.Threading.Thread.Sleep(2000);
            SonucModel <KullaniciAraModel> oSonucModel = new SonucModel <KullaniciAraModel>()
            {
                Durum = "H", Aciklama = ""
            };
            int ToplamKayitAdet = 0;

            ArgemSQL oSQL = new ArgemSQL();

            oSQL.CommandText =
                "select *, count(*) OVER() as \"Adet\" " +
                "from   public.\"KULLANICI\"";

            // string s = "ddsdf";
            // int i = Convert.ToInt32(s);

            if (!string.IsNullOrEmpty(oKullaniciModel.KullaniciAd))
            {
                oSQL.Gecen("KullaniciAd", oKullaniciModel.KullaniciAd);
            }
            else if (!string.IsNullOrEmpty(oKullaniciModel.Ad))
            {
                oSQL.Gecen("Ad", oKullaniciModel.Ad);
            }
            else if (!string.IsNullOrEmpty(oKullaniciModel.Soyad))
            {
                oSQL.Gecen("Soyad", oKullaniciModel.Soyad);
            }

            oSQL.Esit("KullaniciTipNo", oKullaniciModel.KullaniciTipNo, KolonTipi.Int, false);
            oSQL.Esit("AktifPasifTipNo", oKullaniciModel.AktifPasifTipNo, KolonTipi.Int, false);

            if (SiraAlan == "")
            {
                oSQL.OrderByAsc("Ad,Soyad");
            }
            else if (SiraTip == 1)
            {
                oSQL.OrderByAsc(SiraAlan);
            }
            else
            {
                oSQL.OrderByDesc(SiraAlan);
            }

            if (SayfaKayitAdet != 0 && AktifSayfaNo != 0)
            {
                oSQL.KayitSayisiLimit(SayfaKayitAdet, AktifSayfaNo);
            }

            using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
            {
                DataTable dt = new DataTable();
                oData.DataGetir(ref dt, oSQL);

                if (dt.Rows.Count > 0)
                {
                    ToplamKayitAdet = Convert.ToInt32(dt.Rows[0]["Adet"].ToString());

                    List <KullaniciAraModel> aryKullaniciAraModel = new List <KullaniciAraModel>();
                    foreach (DataRow dr in dt.Rows)
                    {
                        int KullaniciTipNo  = Convert.ToInt32(dr["KullaniciTipNo"]);
                        int AktifPasifTipNo = Convert.ToInt32(dr["AktifPasifTipNo"]);
                        KullaniciAraModel oKullaniciAraModel = new KullaniciAraModel()
                        {
                            KullaniciKey          = Convert.ToInt32(dr["KullaniciKey"]),
                            KullaniciAd           = dr["KullaniciAd"].ToString(),
                            Ad                    = dr["Ad"].ToString(),
                            Soyad                 = dr["Soyad"].ToString(),
                            KullaniciTipNo        = KullaniciTipNo,
                            KullaniciTipNoUzunAd  = CacheHelper.LookUzunAdGetir(CacheHelper.DatabaseTipNo.Yetki, KullaniciTipNo),
                            AktifPasifTipNo       = AktifPasifTipNo,
                            AktifPasifTipNoUzunAd = CacheHelper.LookUzunAdGetir(CacheHelper.DatabaseTipNo.Yetki, AktifPasifTipNo)
                        };
                        aryKullaniciAraModel.Add(oKullaniciAraModel);
                    }

                    oSonucModel.Durum = "";
                    oSonucModel.Data  = aryKullaniciAraModel;
                }
                else
                {
                    oSonucModel.Aciklama = "Aradığınız kritere uygun kullanıcı kaydı bulunamadı";
                }

                oSonucModel.ToplamKayitAdet = ToplamKayitAdet;

                Stopwatch _stopwatch = (Stopwatch)TempData["ServerCalismaSure"];
                _stopwatch.Stop();
                oSonucModel.SCS = _stopwatch.ElapsedMilliseconds.ToString();

                return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
            }
        }