Example #1
0
        //admin için
        public musteri_tel_mail musteriListesiR()
        {
            musteri_tel_mail liste = new musteri_tel_mail();

            List <TeknikServis.Radius.customer> mler = db.customers.Where(x => x.CustID > 0).OrderByDescending(x => x.CustID).ToList();
            string teller  = "";
            string mailler = "";

            foreach (customer c in mler)
            {
                if (!String.IsNullOrEmpty(c.telefon) && c.telefon.Length > 9)
                {
                    teller += c.telefon + ",";
                }
                if (!String.IsNullOrEmpty(c.email) && c.email.Length > 7)
                {
                    mailler += c.email + ";";
                }
            }
            liste.musteriler = mler;
            liste.mailler    = mailler;
            liste.teller     = teller;


            return(liste);
        }
Example #2
0
        public musteri_tel_mail musteriAraR(string kelime)
        {
            kelime = kelime.ToLower();
            musteri_tel_mail liste = new musteri_tel_mail();

            List <TeknikServis.Radius.customer> mler = (from c in db.customers
                                                        where (c.CustID > 0) && (c.Ad.Contains(kelime) || c.TC.Contains(kelime) || c.telefon.Contains(kelime) ||
                                                                                 c.telefon_cep.Contains(kelime) || c.email.Contains(kelime) ||
                                                                                 c.Adres.Contains(kelime) || c.tanimlayici.Contains(kelime))
                                                        orderby c.CustID descending
                                                        select c).ToList();

            string teller  = "";
            string mailler = "";

            foreach (customer c in mler)
            {
                if (!String.IsNullOrEmpty(c.telefon) && c.telefon.Length > 9)
                {
                    teller += c.telefon + ",";
                }
                if (!String.IsNullOrEmpty(c.email) && c.email.Length > 7)
                {
                    mailler += c.email + ";";
                }
            }
            liste.musteriler = mler;
            liste.mailler    = mailler;
            liste.teller     = teller;


            return(liste);
        }
Example #3
0
        public musteri_tel_mail antenMusterileri(string antendekiler)
        {
            musteri_tel_mail bilgiler = new musteri_tel_mail();


            if (!String.IsNullOrEmpty(antendekiler))
            {
                string[] idsler = antendekiler.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                if (idsler.Length > 0)
                {
                    List <int> idlistesi = new List <int>();
                    for (int i = 0; i < idsler.Length; i++)
                    {
                        if (!string.IsNullOrEmpty(idsler[i]))
                        {
                            idlistesi.Add(Convert.ToInt32(idsler[i]));
                        }
                    }
                    if (idlistesi.Count > 0)
                    {
                        List <customer> musteriler = db.customers.Where(x => idlistesi.Contains(x.CustID)).ToList();
                        bilgiler.musteriler = musteriler;
                        if (musteriler.Count > 0)
                        {
                            List <string> teller  = musteriler.Where(x => !String.IsNullOrEmpty(x.telefon)).Select(x => x.telefon).ToList();
                            List <string> mailler = musteriler.Where(x => !String.IsNullOrEmpty(x.email)).Select(x => x.email).ToList();
                            string        tels    = "";
                            string        mails   = "";
                            StringBuilder build   = new StringBuilder();
                            StringBuilder build2  = new StringBuilder();
                            foreach (string t in teller)
                            {
                                build.Append(t);
                                build.Append(",");
                            }
                            tels = build.ToString();

                            foreach (string m in mailler)
                            {
                                build2.Append(m);
                                build2.Append(",");
                            }
                            mails            = build2.ToString();
                            bilgiler.teller  = tels;
                            bilgiler.mailler = mails;
                        }
                    }
                }
            }
            return(bilgiler);
        }
Example #4
0
        public musteri_tel_mail antenMusterileri(int antenid)
        {
            musteri_tel_mail bilgiler = new musteri_tel_mail();
            string           antenadi = db.antens.FirstOrDefault(x => x.anten_id == antenid).anten_adi;

            bilgiler.anten_adi = antenadi;
            List <customer> musteriler = db.customers.Where(x => x.antenid == antenid).ToList();

            bilgiler.musteriler = musteriler;
            if (musteriler.Count > 0)
            {
                List <string> teller  = musteriler.Where(x => !String.IsNullOrEmpty(x.telefon)).Select(x => x.telefon).ToList();
                List <string> mailler = musteriler.Where(x => !String.IsNullOrEmpty(x.email)).Select(x => x.email).ToList();
                string        tels    = "";
                string        mails   = "";
                StringBuilder build   = new StringBuilder();
                StringBuilder build2  = new StringBuilder();
                foreach (string t in teller)
                {
                    build.Append(t);
                    build.Append(",");
                }
                tels = build.ToString();

                foreach (string m in mailler)
                {
                    build2.Append(m);
                    build2.Append(",");
                }
                mails            = build2.ToString();
                bilgiler.teller  = tels;
                bilgiler.mailler = mails;
            }



            return(bilgiler);
        }