Exemple #1
0
        public IEnumerable <SelectListItem> GetCity()
        {
            List <SelectListItem> citys = new List <SelectListItem>();
            string   query = "select * from dbo.Citys";
            database ob2   = new database();

            return(ob2.dbCity(query));
        }
Exemple #2
0
        public IEnumerable <SelectListItem> GetDepartment()
        {
            List <SelectListItem> citys = new List <SelectListItem>();
            string   query = "select * from dbo.Department";
            database ob2   = new database();

            return(ob2.dbDepartment(query));
        }
Exemple #3
0
        //public Employee mySelect(string command)
        //{
        //    SqlConnection con = null;
        //    //   var modelList = new List<Employee>();

        //    Employee my = new Employee();

        //    con = new SqlConnection(sqlConnections);
        //    SqlCommand sqlCommand = new SqlCommand(command, con);
        //    try
        //    {
        //        con.Open();
        //        SqlDataReader dr = sqlCommand.ExecuteReader();
        //        while (dr.Read())
        //        {
        //            var emp = new Employee();
        //            emp.Name = dr["Names"].ToString();
        //            emp.Dateofbirth = dr["DateOfBirth"].ToString();
        //            emp.Phone = dr["Phone"].ToString();
        //            emp.Email = dr["Email"].ToString();
        //            emp.Department = dr["Department"].ToString();
        //            emp.Address = dr["Addresss"].ToString();
        //            emp.States = dr["States"].ToString();
        //            emp.City = dr["City"].ToString();
        //            emp.Zip = dr["ZipCode"].ToString();
        //            emp.Dateofjoin = dr["DateoFJoin"].ToString();
        //            my = emp;
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        throw e;
        //    }
        //    finally
        //    {
        //        con.Close();
        //    }
        //    return (my);
        //}
        //public dataset select(string command)
        //{
        //    dataset dataset = new dataset();
        //    sqlconnection con = null;
        //    using (con = new sqlconnection(sqlconnections))
        //    {
        //        sqldataadapter adapter = new sqldataadapter();
        //        adapter.selectcommand = new sqlcommand(command, con);
        //        adapter.fill(dataset);

        //    }
        //}



        public IEnumerable <SelectListItem> GetStates()
        {
            List <SelectListItem> states = new List <SelectListItem>();
            string   query = "select * from dbo.States";
            database ob2   = new database();

            return(ob2.dbState(query));
        }