public DataTable SearchEmailAddrress(string searchTitle)
        {
            List <EmailContact> result = new List <EmailContact>();

            using (PersonsDBEntities pb = conn.GetContext())
            {
                IEnumerable <EmailContact> pl =
                    from r in pb.EmailContacts
                    where
                    r.EmailAddrress.Contains(searchTitle)


                    select r;

                result = pl.ToList();
            }

            return(PersonTools.ToDataTable(result));
        }
Ejemplo n.º 2
0
        public void SaveFaculty(Faculty faculty)
        {
            using (PersonsDBEntities DC = conn.GetContext())
            {
                if (faculty.FacultyID > 0)
                {
                    //==== UPDATE ====
                    DC.Faculties.Attach(faculty);
                    DC.Entry(faculty).State = EntityState.Modified;
                }
                else
                {
                    //==== INSERT ====
                    DC.Faculties.Add(faculty);
                }

                DC.SaveChanges();
            }
        }
Ejemplo n.º 3
0
        public DataTable SearchTitle(string searchTitle)
        {
            List <Faculty> result = new List <Faculty>();

            using (PersonsDBEntities pb = conn.GetContext())
            {
                IEnumerable <Faculty> pl =
                    from r in pb.Faculties
                    where
                    r.FacultyTitle.Contains(searchTitle)


                    select r;

                result = pl.ToList();
            }

            return(PersonTools.ToDataTable(result));
        }
Ejemplo n.º 4
0
        public DataTable Searchid(int searchText)
        {
            List <Faculty> result = new List <Faculty>();

            using (PersonsDBEntities pb = conn.GetContext())
            {
                IEnumerable <Faculty> pl =
                    from r in pb.Faculties
                    where
                    r.FacultyID == searchText


                    select r;

                result = pl.ToList();
            }

            return(PersonTools.ToDataTable(result));
        }
Ejemplo n.º 5
0
        public void SaveRoles(Role role)
        {
            using (PersonsDBEntities DC = conn.GetContext())
            {
                if (role.RoleID > 0)
                {
                    //==== UPDATE ====
                    DC.Roles.Attach(role);
                    DC.Entry(role).State = EntityState.Modified;
                }
                else
                {
                    //==== INSERT ====
                    DC.Roles.Add(role);
                }

                DC.SaveChanges();
            }
        }
        public DataTable SearchUserName(string searchTitle)
        {
            List <WebServiceAccount> result = new List <WebServiceAccount>();

            using (PersonsDBEntities pb = conn.GetContext())
            {
                IEnumerable <WebServiceAccount> pl =
                    from r in pb.WebServiceAccounts
                    where
                    r.Username.Contains(searchTitle)


                    select r;

                result = pl.ToList();
            }

            return(PersonTools.ToDataTable(result));
        }
        public void Saveaccount(WebServiceAccount account)
        {
            using (PersonsDBEntities DC = conn.GetContext())
            {
                if (account.AccountID > 0)
                {
                    //==== UPDATE ====
                    DC.WebServiceAccounts.Attach(account);
                    DC.Entry(account).State = EntityState.Modified;
                }
                else
                {
                    //==== INSERT ====
                    DC.WebServiceAccounts.Add(account);
                }

                DC.SaveChanges();
            }
        }
        public DataTable Searchid(int searchText)
        {
            List <WebServiceAccount> result = new List <WebServiceAccount>();

            using (PersonsDBEntities pb = conn.GetContext())
            {
                IEnumerable <WebServiceAccount> pl =
                    from r in pb.WebServiceAccounts
                    where
                    r.AccountID == searchText


                    select r;

                result = pl.ToList();
            }

            return(PersonTools.ToDataTable(result));
        }
Ejemplo n.º 9
0
        public void SavetelContact(TelContact TelContact)
        {
            using (PersonsDBEntities DC = conn.GetContext())
            {
                if (TelContact.ID > 0)
                {
                    //==== UPDATE ====
                    DC.TelContacts.Attach(TelContact);
                    DC.Entry(TelContact).State = EntityState.Modified;
                }
                else
                {
                    //==== INSERT ====

                    DC.TelContacts.Add(TelContact);
                }

                DC.SaveChanges();
            }
        }
Ejemplo n.º 10
0
        public DataTable SearchpersonTelNumber(string searchTitle, int UserTypeID, int UserID)
        {
            List <TelContact> result = new List <TelContact>();

            using (PersonsDBEntities pb = conn.GetContext())
            {
                IEnumerable <TelContact> pl =
                    from r in pb.TelContacts

                    where
                    r.TelNumber.Contains(searchTitle) && r.UserID == UserID && r.UserTypeID == UserTypeID


                    select r;

                result = pl.ToList();
            }

            return(PersonTools.ToDataTable(result));
        }
Ejemplo n.º 11
0
        public DataTable Searchstdid(int searchTitle)
        {
            List <VStudent> result = new List <VStudent>();

            using (PersonsDBEntities pb = conn.GetContext())
            {
                IEnumerable <VStudent> pl =
                    from r in pb.VStudents
                    where
                    r.StudentID == searchTitle



                    select r;

                result = pl.ToList();
            }

            return(PersonTools.ToDataTable(result));
        }
Ejemplo n.º 12
0
        public DataTable Getexeldata()
        {
            List <VTelContact> result = new List <VTelContact>();

            using (PersonsDBEntities ent = conn.GetContext())
            {
                System.Configuration.ConnectionStringSettingsCollection connectionStrings =
                    WebConfigurationManager.ConnectionStrings as ConnectionStringSettingsCollection;

                if (connectionStrings.Count > 0)
                {
                    DataContext db = new DataContext(connectionStrings["ConnectionString"].ConnectionString);

                    result = db.ExecuteQuery <VTelContact>(
                        string.Format(
                            "SELECT *  from VTelContacts"
                            )
                        ).ToList();
                }
            }
            return(PersonTools.ToDataTable(result));
        }