Ejemplo n.º 1
0
        private void NpgsqlCommandDoldur(ref NpgsqlCommand cmd, ref ArgemSQL oSQL)
        {
            cmd.CommandText = oSQL.CommandTextFull();
            cmd.CommandType = CommandType.Text;
            // cmd.BindByName = true;

            NpgsqlParameter P;

            foreach (SQLDetay oDetay in oSQL)
            {
                if (oDetay.KolonTipNo != KolonTipi.ArgSQL)
                {
                    // P = new NpgsqlParameter(oDetay.KolonAd, DBType(oDetay.KolonTipNo.GetHashCode()), ParameterDirection.Input);
                    P       = new NpgsqlParameter(oDetay.KolonAd, DBType(oDetay.KolonTipNo.GetHashCode()));
                    P.Value = oDetay.Deger;

                    if (P.DbType == DbType.String)
                    {
                        P.Size = P.Value.ToString().Length;
                    }

                    cmd.Parameters.Add(P);
                }
            }

            cnNpgsql = new NpgsqlConnection(sConn);
            cnNpgsql.Open();
            cmd.Connection = cnNpgsql;
        }
Ejemplo n.º 2
0
        public void DataGetir(ref DataTable dt, ArgemSQL oSQL, bool bLoglansinMi, decimal KullaniciKey)
        {
            Stopwatch oStopwatch = new Stopwatch();

            oStopwatch.Start();

            cmd = new NpgsqlCommand();
            try
            {
                NpgsqlCommandDoldur(ref cmd, ref oSQL);

                using (NpgsqlDataAdapter daORC = new NpgsqlDataAdapter(cmd))
                {
                    daORC.Fill(dt);
                    oStopwatch.Stop();
                    gSure = oStopwatch.ElapsedMilliseconds;
                }

                if (bLoglansinMi)
                {
                    VeriKaydetLogYaz(SQLQuery, KullaniciKey);
                }
            }
            catch (Exception ex)
            {
                oStopwatch.Stop();
                VeriKaydetHataYaz(ex, SQLQuery);
                throw ex;
            }
            finally
            {
                CloseConnection();
            }
        }
Ejemplo n.º 3
0
        public JsonResult YetkiGrupKayit(YetkiGrupModel oYetkiGrupModel)
        {
            SonucModel <YetkiGrupModel> oSonucModel = new SonucModel <YetkiGrupModel>()
            {
                Durum = "H", Aciklama = ""
            };

            int    YetkiGrupKey = oYetkiGrupModel.YetkiGrupKey;
            string YetkiGrupAd  = oYetkiGrupModel.YetkiGrupAd;

            if (string.IsNullOrEmpty(YetkiGrupAd))
            {
                oSonucModel.Aciklama = "Yetki grup adı boş olamaz";
            }
            else
            {
                if (YetkiGrupKey == 0)
                {
                    ArgemSQL oSQL = new ArgemSQL();
                    oSQL.CommandText =
                        "insert into public.\"YETKI_GRUP\" " +
                        "       (\"YetkiGrupAd\", \"UKullaniciKey\", \"UTar\") " +
                        "values ('" + YetkiGrupAd + "'," + ArgemSession.OpKullaniciKey + ", current_timestamp) " +
                        "returning \"YetkiGrupKey\" ";

                    using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
                    {
                        string SonucYetkiGrupKey = Convert.ToString(oData.SorguCalistir(oSQL));
                        if (SonucYetkiGrupKey != "0")
                        {
                            oSonucModel.Durum = "";
                        }
                        else
                        {
                            oSonucModel.Aciklama = "Veri kaydedilemedi";
                        }
                    }
                }
                else
                {
                    ArgemSQL oSQL = new ArgemSQL();
                    oSQL.CommandText =
                        "update public.\"YETKI_GRUP\" " +
                        "set    \"YetkiGrupAd\" = '" + YetkiGrupAd + "', " +
                        "       \"UKullaniciKey\" = " + ArgemSession.OpKullaniciKey + ", " +
                        "       \"UTar\" = current_timestamp ";
                    oSQL.Esit("YetkiGrupKey", YetkiGrupKey, KolonTipi.Int, true);
                    using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
                    {
                        oData.SorguCalistir(oSQL);
                        oSonucModel.Durum = "";
                    }
                }
            }

            return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
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.º 5
0
        public JsonResult KullaniciYetkiGrupAraSonuc(KullaniciYetkiGrupModel oKullaniciYetkiGrupModel)
        {
            SonucModel <KullaniciYetkiGrupAraModel> oSonucModel = new SonucModel <KullaniciYetkiGrupAraModel>()
            {
                Durum = "H", Aciklama = ""
            };

            ArgemSQL oSQL = new ArgemSQL();

            oSQL.CommandText =
                "SELECT * FROM public.\"KULLANICI_YETKI_GRUP\"";
            if (oKullaniciYetkiGrupModel.KullaniciKey > 0)
            {
                oSQL.Esit("KullaniciKey", oKullaniciYetkiGrupModel.KullaniciKey, KolonTipi.Int, true);

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

                    if (dt.Rows.Count > 0)
                    {
                        List <KullaniciYetkiGrupAraModel> arySonuc = new List <KullaniciYetkiGrupAraModel>();
                        foreach (DataRow dr in dt.Rows)
                        {
                            KullaniciYetkiGrupAraModel oKullaniciYetkiGrupAraModel = new KullaniciYetkiGrupAraModel()
                            {
                                KullaniciYetkiGrupKey = Convert.ToInt32(dr["YetkiGrupKey"]),
                                // KullaniciKey = Convert.ToInt32(dr["YetkiGrupKey"]), // gerek yok sayfada zaten kullanıcı bazında getiriliyor
                                YetkiGrupKey   = Convert.ToInt32(dr["YetkiGrupKey"]),
                                YetkiGrupAd    = "Sonra koy",
                                TeskilatKey    = Convert.ToInt32(dr["YetkiGrupKey"]),
                                TeskilatUzunAd = "ARGEM sonra konulacak"
                            };
                            arySonuc.Add(oKullaniciYetkiGrupAraModel);
                        }

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

            return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
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.º 7
0
        public JsonResult KullaniciYetkiGrupKayitKaydet(string KullaniciKey, string TeskilatKey, string YetkiGrupKeyler)
        {
            SonucModelBase oSonucModel = new SonucModelBase()
            {
                Durum = "H", Aciklama = ""
            };

            if (string.IsNullOrEmpty(KullaniciKey))
            {
                oSonucModel.Aciklama = "Hatalı parametre (K)";
            }
            else if (string.IsNullOrEmpty(TeskilatKey))
            {
                oSonucModel.Aciklama = "Hatalı parametre (T)";
            }
            else if (string.IsNullOrEmpty(TeskilatKey))
            {
                oSonucModel.Aciklama = "Hatalı parametre (YG)";
            }
            else
            {
                string[] aryYetkiGrupKeyler = YetkiGrupKeyler.Split(',');
                foreach (string YetkiGrupKey in aryYetkiGrupKeyler)
                {
                    ArgemSQL oSQL = new ArgemSQL();
                    oSQL.CommandText =
                        "insert into public.\"KULLANICI_YETKI_GRUP\" " +
                        "       (\"KullaniciKey\", \"YetkiGrupKey\", \"TeskilatKey\", \"UKullaniciKey\", \"UTar\") " +
                        "values (" + KullaniciKey + "," + YetkiGrupKey + "," + TeskilatKey + ", 1, current_timestamp) " +
                        "returning \"KullaniciYetkiGrupKey\" ";
                    using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
                    {
                        string SonucKullaniciYetkiGrupKey = Convert.ToString(oData.SorguCalistir(oSQL));
                        if (SonucKullaniciYetkiGrupKey != "0")
                        {
                            oSonucModel.Durum = "";
                        }
                        else
                        {
                            oSonucModel.Aciklama = "Veri kaydedilemedi";
                        }
                    }
                }
            }

            return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
        public object SorguCalistir(ArgemSQL oSQL, bool LoglansinMi, decimal KullaniciKey)
        {
            Stopwatch oStopwatch = new Stopwatch();

            oStopwatch.Start();

            cmd = new NpgsqlCommand();
            try
            {
                oSQL.CommandText = oSQL.CommandText + oSQL.SetText.ToString();
                NpgsqlCommandDoldur(ref cmd, ref oSQL);

                if (LoglansinMi)
                {
                    object Sonuc = cmd.ExecuteNonQuery();
                    oStopwatch.Stop();
                    gSure = oStopwatch.ElapsedMilliseconds;

                    VeriKaydetLogYaz(SQLQuery, KullaniciKey);

                    return(Sonuc);
                }
                else
                {
                    oStopwatch.Stop();
                    // return cmd.ExecuteNonQuery();
                    return(cmd.ExecuteScalar());
                }
            }
            catch (Exception ex)
            {
                oStopwatch.Stop();
                VeriKaydetHataYaz(ex, oSQL.CommandText);
                throw ex;
            }
            finally
            {
                CloseConnection();
            }
        }
Ejemplo n.º 9
0
        /*public object TekDegerOku(ArgemSQL oSQL, bool LoglansinMi, decimal KullaniciKey)
         * {
         *  return TekDegerOku(oSQL, LoglansinMi, KullaniciKey, 0);
         * }*/

        public object TekDegerOku(ArgemSQL oSQL, bool LoglansinMi, decimal KullaniciKey)
        {
            Stopwatch oStopwatch = new Stopwatch();

            oStopwatch.Start();

            cmd = new NpgsqlCommand();
            try
            {
                NpgsqlCommandDoldur(ref cmd, ref oSQL);

                if (LoglansinMi)
                {
                    object oSonuc = cmd.ExecuteScalar();
                    oStopwatch.Stop();
                    gSure = oStopwatch.ElapsedMilliseconds;

                    VeriKaydetLogYaz(SQLQuery, KullaniciKey);

                    return(oSonuc);
                }
                else
                {
                    return(cmd.ExecuteScalar());
                }
            }
            catch (Exception ex)
            {
                oStopwatch.Stop();
                VeriKaydetHataYaz(ex, SQLQuery);
                throw ex;
            }
            finally
            {
                CloseConnection();
            }
        }
Ejemplo n.º 10
0
        public JsonResult KullaniciGetir(string KullaniciKey)
        {
            // System.Threading.Thread.Sleep(2000);
            SonucModel <KullaniciModel> oSonucModel = new SonucModel <KullaniciModel>()
            {
                Durum = "H", Aciklama = ""
            };

            if (KullaniciKey == "" || KullaniciKey == "0")
            {
                List <KullaniciModel> aryKullaniciModel = new List <KullaniciModel>();
                // ilk kayıtta default verilerin dolu gelmesi için
                KullaniciModel oKullaniciModel = new KullaniciModel()
                {
                    KullaniciKey    = 0,
                    KullaniciTipNo  = 1,
                    AktifPasifTipNo = 100
                };
                aryKullaniciModel.Add(oKullaniciModel);
                oSonucModel.Durum = "";
                oSonucModel.Data  = aryKullaniciModel;
                return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
            }
            else
            {
                ArgemSQL oSQL = new ArgemSQL();
                oSQL.CommandText =
                    "SELECT * FROM public.\"KULLANICI\"";
                oSQL.Esit("KullaniciKey", KullaniciKey, KolonTipi.Int, true);

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

                    if (dt.Rows.Count > 0)
                    {
                        List <KullaniciModel> aryKullaniciModel = new List <KullaniciModel>();
                        foreach (DataRow dr in dt.Rows)
                        {
                            int            KullaniciTipNo  = Convert.ToInt32(dr["KullaniciTipNo"]);
                            int            AktifPasifTipNo = Convert.ToInt32(dr["AktifPasifTipNo"]);
                            KullaniciModel oKullaniciModel = new KullaniciModel()
                            {
                                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)
                            };
                            aryKullaniciModel.Add(oKullaniciModel);
                        }

                        oSonucModel.Durum = "";
                        oSonucModel.Data  = aryKullaniciModel;
                    }

                    return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
                }
            }
        }
Ejemplo n.º 11
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));
            }
        }
Ejemplo n.º 12
0
        public JsonResult SistemeGirisYap(KullaniciLoginModel oKullaniciLoginModel)
        {
            SonucModel <KullaniciLoginModel> oSonucModel = new SonucModel <KullaniciLoginModel>()
            {
                Durum = "H", Aciklama = ""
            };

            if (ModelState.IsValid)
            {
                if (string.IsNullOrEmpty(oKullaniciLoginModel.KullaniciAd) || string.IsNullOrEmpty(oKullaniciLoginModel.Parola))
                {
                    oSonucModel.Aciklama = "Kullanıcı adı ve/veya şifre boş";
                }
                else
                {
                    ArgemSQL oSQL = new ArgemSQL();
                    oSQL.CommandText =
                        "select * " +
                        "from   public.\"KULLANICI\" ";
                    oSQL.Esit("KullaniciAd", oKullaniciLoginModel.KullaniciAd, KolonTipi.String);
                    oSQL.Esit("Parola", oKullaniciLoginModel.Parola, KolonTipi.String);
                    using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
                    {
                        DataTable dt = new DataTable();
                        oData.DataGetir(ref dt, oSQL);

                        if (dt.Rows.Count > 0)
                        {
                            // todo log kaydı yap

                            if (dt.Rows[0]["AktifPasifTipNo"].ToString() == "100")
                            {
                                ArgemSession.OpKullaniciKey   = Convert.ToInt32(dt.Rows[0]["KullaniciKey"]);
                                ArgemSession.OpKullaniciAd    = dt.Rows[0]["Ad"].ToString();
                                ArgemSession.OpKullaniciSoyad = dt.Rows[0]["Soyad"].ToString();
                                oSonucModel.Durum             = "";
                            }
                            else
                            {
                                oSonucModel.Aciklama = "Kullanıcı pasif durumda";
                            }
                        }
                        else
                        {
                            oSonucModel.Aciklama = "Kullanıcı adı ve/veya şifre hatalı";
                        }
                    }


                    /*string sSQL =
                     *  "select * " +
                     *  "from   public.\"KULLANICI\" " +
                     *  "where  \"KullaniciAd\" = '" + oKullaniciLoginModel.KullaniciAd + "' " +
                     *  "       and \"Parola\" = '" + oKullaniciLoginModel.Parola + "'";
                     * DataTable dtP = DBUtil.VeriGetirDT(sSQL);
                     * if (dtP != null)
                     * {
                     *  if (dtP.Rows.Count > 0)
                     *  {
                     *      if (dtP.Rows[0]["AktifPasifTipNo"].ToString() == "100")
                     *      {
                     *          Session["OpKullaniciKey"] = dtP.Rows[0]["KullaniciKey"].ToString();
                     *          Session["OpKullaniciAd"] = dtP.Rows[0]["Ad"].ToString();
                     *          Session["OpKullaniciSoyad"] = dtP.Rows[0]["Soyad"].ToString();
                     *          oSonucModel.Durum = "";
                     *      }
                     *      else
                     *          oSonucModel.Aciklama = "Kullanıcı pasif durumda";
                     *  }
                     *  else
                     *      oSonucModel.Aciklama = "Kullanıcı adı ve/veya şifre hatalı";
                     * }
                     * else
                     *  oSonucModel.Aciklama = "Kullanıcı adı ve/veya şifre hatalı.";*/
                }
            }
            else
            {
                oSonucModel.Aciklama = "Gerekli alanları giriniz";
            }

            return(Json(oSonucModel, JsonRequestBehavior.DenyGet));
        }
Ejemplo n.º 13
0
 public object SorguCalistir(ArgemSQL oSQL)
 {
     return(SorguCalistir(oSQL, false, 0));
 }
Ejemplo n.º 14
0
        public void DataGetir <T>(ref T ds, ArgemSQL oSQL) where T : DataSet
        {
            DataTable dt = ds.Tables[0];

            DataGetir(ref dt, oSQL, false, 0);
        }
Ejemplo n.º 15
0
 public object TekDegerOku(ArgemSQL oSQL)
 {
     return(TekDegerOku(oSQL, false, 0));
 }
Ejemplo n.º 16
0
        public JsonResult KullaniciKayit(KullaniciModel oKullaniciModel)
        {
            SonucModel <KullaniciModel> oSonucModel = new SonucModel <KullaniciModel>()
            {
                Durum = "H", Aciklama = ""
            };

            int    KullaniciKey    = oKullaniciModel.KullaniciKey;
            string KullaniciAd     = oKullaniciModel.KullaniciAd;
            string Ad              = oKullaniciModel.Ad;
            string Soyad           = oKullaniciModel.Soyad;
            int    KullaniciTipNo  = oKullaniciModel.KullaniciTipNo;
            int    AktifPasifTipNo = oKullaniciModel.AktifPasifTipNo;

            if (string.IsNullOrEmpty(KullaniciAd))
            {
                oSonucModel.Aciklama = "Kullanıcı adı boş olamaz";
            }
            else if (string.IsNullOrEmpty(Ad))
            {
                oSonucModel.Aciklama = "Ad boş olamaz";
            }
            else if (string.IsNullOrEmpty(Soyad))
            {
                oSonucModel.Aciklama = "Soyad boş olamaz";
            }
            else if (KullaniciTipNo == 0)
            {
                oSonucModel.Aciklama = "Tip boş olamaz";
            }
            else if (AktifPasifTipNo == 0)
            {
                oSonucModel.Aciklama = "Durumu boş olamaz";
            }
            else
            {
                if (KullaniciKey == 0)
                {
                    ArgemSQL oSQL = new ArgemSQL();
                    oSQL.CommandText =
                        "insert into public.\"KULLANICI\" " +
                        "       (\"KullaniciAd\", \"Ad\", \"Soyad\", \"KullaniciTipNo\", \"AktifPasifTipNo\", \"Parola\", \"UKullaniciKey\", \"UTar\") " +
                        "values ('" + KullaniciAd + "','" + Ad + "','" + Soyad + "', " + KullaniciTipNo + ", " + AktifPasifTipNo + ", '123', 1, current_timestamp) " +
                        "returning \"KullaniciKey\" ";
                    using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
                    {
                        string SonucKullaniciKey = Convert.ToString(oData.SorguCalistir(oSQL));
                        if (SonucKullaniciKey != "0")
                        {
                            oSonucModel.Durum = "";
                        }
                        else
                        {
                            oSonucModel.Aciklama = "Veri kaydedilemedi";
                        }
                    }
                }
                else
                {
                    ArgemSQL oSQL = new ArgemSQL();
                    oSQL.CommandText =
                        "update public.\"KULLANICI\" " +
                        "set    \"KullaniciAd\" = '" + KullaniciAd + "', " +
                        "       \"Ad\" = '" + Ad + "', " +
                        "       \"Soyad\"='" + Soyad + "', " +
                        "       \"KullaniciTipNo\"=" + KullaniciTipNo + ", " +
                        "       \"AktifPasifTipNo\"=" + AktifPasifTipNo + ", " +
                        "       \"UKullaniciKey\" = " + ArgemSession.OpKullaniciKey + ", " +
                        "       \"UTar\" = current_timestamp ";
                    oSQL.Esit("KullaniciKey", KullaniciKey, KolonTipi.Int, true);
                    using (DBUtil2 oData = new DBUtil2(DataBaseTipi.Yetki))
                    {
                        oData.SorguCalistir(oSQL);
                        oSonucModel.Durum = "";
                    }
                }
            }

            return(Json(oSonucModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 17
0
 public void DataGetir(ref DataTable dt, ArgemSQL oSQL)
 {
     DataGetir(ref dt, oSQL, false, 0);
 }
Ejemplo n.º 18
0
        public void DataGetir <T>(ref T ds, ArgemSQL oSQL, bool bLoglansinMi, decimal KullaniciKey) where T : DataSet
        {
            DataTable dt = ds.Tables[0];

            DataGetir(ref dt, oSQL, bLoglansinMi, KullaniciKey);
        }