示例#1
0
        public static int MusteriEkle(EntityMusteri musteriDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceMusteri.InsertMusteriSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceMusteri.Parameter1, musteriDeger.MusteriAd);
            command.Parameters.AddWithValue(ResourceMusteri.Parameter2, musteriDeger.MusteriSoyad);
            return(command.ExecuteNonQuery());
        }
 public static int BLLMusteriEkle(EntityMusteri musteri)
 {
     if (musteri.MusteriSoyad != null && musteri.MusteriSoyad != " " && musteri.MusteriAd != "")
     {
         return(DALMusteri.MusteriEkle(musteri));
     }
     return(-1);
 }
        protected void kaydet_Click(object sender, EventArgs e)
        {
            EntityMusteri ekle = new EntityMusteri();

            ekle.MusteriAd    = TextBox1.Text;
            ekle.MusteriSoyad = TextBox2.Text;
            BLLMusteri.BLLMusteriEkle(ekle);
        }
 public static bool MusteriGuncelle(EntityMusteri musteri)
 {
     if (musteri.MusteriAd != " " && musteri.MusteriSoyad != " ")
     {
         return(DALMusteri.MusteriGuncelle(musteri));
     }
     return(false);
 }
示例#5
0
 public static bool BLLMusteriGuncelle(EntityMusteri p)
 {
     if (p.Musteriad != "" && p.Musterisoyad != "")
     {
         return(DALMusteri.MusteriGuncelle(p));
     }
     return(false);
 }
示例#6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            EntityMusteri ent = new EntityMusteri();

            ent.Musteriad    = TextBox1.Text;
            ent.Musterisoyad = TextBox2.Text;
            BLLMusteri.BLLMusteriEkle(ent);
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int           x   = Convert.ToInt32(Request.QueryString["MUSTERIID"]);
            EntityMusteri ent = new EntityMusteri();

            ent.Musteriid = x;
            BLLMusteri.MusteriSil(ent.Musteriid);
            Response.Redirect("Musteriler.aspx");
        }
        public static bool MuseriSil(EntityMusteri musterisil)
        {
            if (musterisil.MusteriId != 0)
            {
                return(DALMusteri.MusteriSil(musterisil));
            }

            return(false);
        }
示例#9
0
        public static int BLLMusteriGuncelle(EntityMusteri entityMusteri)
        {
            if (entityMusteri.MusteriAd != "" && entityMusteri.MusteriSoyad != "")
            {
                return(DALMusteri.MusteriGuncelle(entityMusteri));
            }

            return(-1);
        }
示例#10
0
        public static int MusteriGuncelle(EntityMusteri musteriDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceMusteri.UpdateMusteriSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceMusteri.AdParam, musteriDeger.MusteriAd);
            command.Parameters.AddWithValue(ResourceMusteri.SoyadParam, musteriDeger.MusteriSoyad);
            command.Parameters.AddWithValue(ResourceDepartman.IdParameter, musteriDeger.MusteriId);

            return(command.ExecuteNonQuery());
        }
示例#11
0
        protected void btnKaydet_Click(object sender, EventArgs e)
        {
            EntityMusteri entityMusteri = new EntityMusteri();

            entityMusteri.MusteriAd    = txtMusteriAd.Text;
            entityMusteri.MusteriSoyad = txtMusteriSoyad.Text;
            int sonuc = BLLMusteri.BLLMusteriEkle(entityMusteri);

            MyPresentationExtensions.ShowErrorMessageOrRedirect(sonuc, ResourceMusteri.MusterilerSayfasi, ResourceMusteri.MusteriEkleError);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            EntityMusteri ent = new EntityMusteri();

            ent.Musteriad    = TextBox1.Text;
            ent.Musterisoyad = TextBox2.Text;
            ent.Musteriid    = Convert.ToInt32(TextBox3.Text);
            BLLMusteri.BLLMusteriGuncelle(ent);
            Response.Redirect("Musteriler.aspx");
        }
        protected void kaydet_Click(object sender, EventArgs e)
        {
            EntityMusteri guncelle = new EntityMusteri();

            guncelle.MusteriAd    = TextBox1.Text;
            guncelle.MusteriSoyad = TextBox2.Text;
            guncelle.MusteriId    = Convert.ToInt32(TextBox3.Text);
            BLLMusteri.MusteriGuncelle(guncelle);
            Response.Redirect("Musteriler.aspx");
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EntityMusteri entityMusteri = BLLMusteri.BLLMusteriGetirById(Convert.ToByte(Request.QueryString["id"]));

            if (Page.IsPostBack == false)
            {
                txtMusteriId.Text    = entityMusteri.MusteriId.ToString();
                txtMusteriAd.Text    = entityMusteri.MusteriAd;
                txtMusteriSoyad.Text = entityMusteri.MusteriSoyad;
            }
        }
示例#15
0
 public static int BLLMusteriEkle(EntityMusteri p)
 {
     if (p.Musteriad != "" && p.Musterisoyad != "" && p.Musteriad.Length <= 15)
     {
         return(DALMusteri.MusteriEkle(p));
     }
     else
     {
         return(-1);
     }
 }
        public static bool MusteriSil(EntityMusteri musterisil)
        {
            SqlCommand sil = new SqlCommand("Delete from TBLMUSTERI where MUSTERIID=@p1", Baglanti.baglanti);

            if (sil.Connection.State != ConnectionState.Open)
            {
                sil.Connection.Open();
            }
            sil.Parameters.AddWithValue("@p1", musterisil.MusteriId);
            return(sil.ExecuteNonQuery() > 0);
        }
示例#17
0
 public static int BLLMusteriEkle(EntityMusteri m)
 {
     if (m.Musteriad != "" && m.Musterisoyad != "" & m.Musteriad.Length <= 50 & m.Musterisoyad.Length <= 50)
     {
         return(DALMusteri.MusteriEkle(m));
     }
     else
     {
         return(-1);
     }
 }
示例#18
0
        public static int MusteriEkle(EntityMusteri p)
        {
            SqlCommand komut2 = new SqlCommand("insert into TBLMUSTERI(MUSTERIAD,MUSTERISOYAD) values (@P1,@P2)", Baglanti.bgl);

            if (komut2.Connection.State != ConnectionState.Open)
            {
                komut2.Connection.Open();
            }
            komut2.Parameters.AddWithValue("@P1", p.Musteriad);
            komut2.Parameters.AddWithValue("@P2", p.Musterisoyad);
            return(komut2.ExecuteNonQuery());
        }
        public static int MusteriEkle(EntityMusteri musteri)
        {
            SqlCommand ekle = new SqlCommand("insert into TBLMUSTERI (MUSTERIAD,MUSTERISOYAD) values (@MUSTERIAD,@MUSTERISOYAD)", Baglanti.baglanti);

            if (ekle.Connection.State != ConnectionState.Open)
            {
                ekle.Connection.Open();
            }
            ekle.Parameters.AddWithValue("@MUSTERIAD", musteri.MusteriAd);
            ekle.Parameters.AddWithValue("@MUSTERISOYAD", musteri.MusteriSoyad);

            return(ekle.ExecuteNonQuery());
        }
示例#20
0
        public static bool MusteriGuncelle(EntityMusteri p)
        {
            SqlCommand komut5 = new SqlCommand("UPDATE TBLMUSTERI SET MUSTERIAD = @P1, MUSTERISOYAD = @P2 WHERE MUSTERIID = @P3", Baglanti.bgl);

            if (komut5.Connection.State != ConnectionState.Open)
            {
                komut5.Connection.Open();
            }
            komut5.Parameters.AddWithValue("@P1", p.Musteriad);
            komut5.Parameters.AddWithValue("@P2", p.Musterisoyad);
            komut5.Parameters.AddWithValue("@P3", p.Musteriid);
            return(komut5.ExecuteNonQuery() > 0);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int x = Convert.ToInt32(Request.QueryString["MUSTERIID"]);

            TextBox3.Text = x.ToString();
            EntityMusteri ent = new EntityMusteri();

            if (Page.IsPostBack == false)
            {
                List <EntityMusteri> MusList = BLLMusteri.BLLMusteriGetir(x);
                TextBox1.Text = MusList[0].Musteriad.ToString();
                TextBox2.Text = MusList[0].Musterisoyad.ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int x = Convert.ToInt32(Request.QueryString["MUSTERIID"]);

            TextBox3.Text = x.ToString();
            EntityMusteri ent = new EntityMusteri();

            if (Page.IsPostBack == false)
            {
                List <EntityMusteri> musterilistesi = BLLMusteri.GuncellemeSayfasiMusteriListele(x);
                TextBox1.Text = musterilistesi[0].MusteriAd.ToString();
                TextBox2.Text = musterilistesi[0].MusteriSoyad.ToString();
            }
        }
        public static bool MusteriGuncelle(EntityMusteri musteri)
        {
            SqlCommand guncelle = new SqlCommand("update TBLMUSTERI set MUSTERIAD=@p1, MUSTERISOYAD=@p2 where MUSTERIID=@p3", Baglanti.baglanti);

            if (guncelle.Connection.State != ConnectionState.Open)
            {
                guncelle.Connection.Open();
            }

            guncelle.Parameters.AddWithValue("@p1", musteri.MusteriAd);
            guncelle.Parameters.AddWithValue("@p2", musteri.MusteriSoyad);
            guncelle.Parameters.AddWithValue("@p3", musteri.MusteriId);
            return(guncelle.ExecuteNonQuery() > 0);
        }
示例#24
0
        public static EntityMusteri MusteriGetirById(int?id)
        {
            EntityMusteri entityMusteri = new EntityMusteri();
            SqlCommand    command       = MyExtensions.CreateCommandAndOpenConnection(ResourceMusteri.SelectMusteriByIdSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceMusteri.IdParameter, id);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                entityMusteri.MusteriId    = Convert.ToInt32(dr[ResourceMusteri.MUSTERIID]);
                entityMusteri.MusteriAd    = dr[ResourceMusteri.MUSTERIAD].ToString();
                entityMusteri.MusteriSoyad = dr[ResourceMusteri.MUSTERISOYAD].ToString();
            }

            dr.Close();
            return(entityMusteri);
        }
示例#25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int x = Convert.ToInt32(Request.QueryString["MUSTERIID"]);
                TextBox3.Text = x.ToString();
                EntityMusteri ent = new EntityMusteri();

                if (Page.IsPostBack == false)
                {
                    List <EntityMusteri> MusList = BLLMusteri.BLLMusteriGetir(x);
                    TextBox1.Text = MusList[0].Musteriad.ToString();
                    TextBox2.Text = MusList[0].Musterisoyad.ToString();
                }
            }
            catch (Exception ex)
            {
                string script = "<script>alert('" + ex.Message + "');</script>";
            }
        }
        public static List <EntityMusteri> MusteriListesi()
        {
            List <EntityMusteri> degerler = new List <EntityMusteri>();
            SqlCommand           komut    = new SqlCommand("SELECT * FROM TBLMUSTERI", Baglanti.bgl);

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }
            SqlDataReader dr = komut.ExecuteReader();

            while (dr.Read())
            {
                EntityMusteri ent = new EntityMusteri();
                ent.Musteriid    = int.Parse(dr["MUSTERIID"].ToString());
                ent.Musteriad    = dr["MUSTERIAD"].ToString();
                ent.Musterisoyad = dr["MUSTERISOYAD"].ToString();
                degerler.Add(ent);
            }
            dr.Close();
            return(degerler);
        }
        public static List <EntityMusteri> GuncellemeSayfasinaMusteriListele(int id)
        {
            List <EntityMusteri> degerler = new List <EntityMusteri>();
            SqlCommand           komut    = new SqlCommand("Select * from TBLMUSTERI where MUSTERIID=@p1", Baglanti.baglanti);

            komut.Parameters.AddWithValue("@p1", id);
            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }

            SqlDataReader dr = komut.ExecuteReader();

            while (dr.Read())
            {
                EntityMusteri ent = new EntityMusteri();

                ent.MusteriAd    = dr["MUSTERIAD"].ToString();
                ent.MusteriSoyad = dr["MUSTERISOYAD"].ToString();
                degerler.Add(ent);
            }
            dr.Close();
            return(degerler);
        }
示例#28
0
        public static List <EntityMusteri> MusteriGetir(int id)
        {
            List <EntityMusteri> degerler = new List <EntityMusteri>();
            SqlCommand           komut4   = new SqlCommand("SELECT *FROM TBLMUSTERI WHERE MUSTERIID = @P1", Baglanti.bgl);

            komut4.Parameters.AddWithValue("@P1", id);
            if (komut4.Connection.State != ConnectionState.Open)
            {
                komut4.Connection.Open();
            }

            SqlDataReader dr = komut4.ExecuteReader();

            while (dr.Read())
            {
                EntityMusteri ent = new EntityMusteri();
                //  ent.Musteriid = Convert.ToInt32(dr["MUSTERIID"].ToString());
                ent.Musteriad    = dr["MUSTERIAD"].ToString();
                ent.Musterisoyad = dr["MUSTERISOYAD"].ToString();
                degerler.Add(ent);
            }
            dr.Close();
            return(degerler);
        }