예제 #1
0
        public TechCategory GetTechCategoryDetails(int TechCategoryID)
        {
            TechCategory category = null;

            SqlParameter[] Params = { new SqlParameter("@TechCategoryID", TechCategoryID) };
            using (DataTable table = DataProvider.ExecuteParamatizedSelectCommand("sp_ViewSpecificTechType",
                CommandType.StoredProcedure, Params))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];
                    category = new TechCategory();
                    category.TechCategoryID = Convert.ToInt32(row["TechCategoryID"]);
                    category.CategoryName = row["CategoryName"].ToString();
                    category.CategoryDescription = row["CategoryDescription"].ToString();
                }
            }
            return category;
        }
예제 #2
0
 public List<TechCategory> CheckDuplicateTechCategory(string category)
 {
     List<TechCategory> categoryList = null;
     SqlParameter[] Params = { new SqlParameter("@category", category) };
     using (DataTable table = DataProvider.ExecuteParamatizedSelectCommand("sp_CheckDuplicateTechCategory", CommandType.StoredProcedure, Params))
     {
         if (table.Rows.Count > 0)
         {
             categoryList = new List<TechCategory>();
             foreach (DataRow row in table.Rows)
             {
                 TechCategory techCategory = new TechCategory();
                 techCategory.TechCategoryID = Convert.ToInt32(row["TechCategoryID"]);
                 techCategory.CategoryName = row["CategoryName"].ToString();
                 techCategory.CategoryDescription = row["CategoryDescription"].ToString();
                 categoryList.Add(techCategory);
             }
         }
     }
     return categoryList;
 }
예제 #3
0
        public List<TechCategory> GetTechCategoryList()
        {
            List<TechCategory> TechCategoryList = null;

            using (DataTable table = DataProvider.ExecuteSelectCommand("sp_ViewAllTechCategories",
                CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    TechCategoryList = new List<TechCategory>();
                    foreach (DataRow row in table.Rows)
                    {
                        TechCategory category = new TechCategory();
                        category.TechCategoryID = Convert.ToInt32(row["TechCategoryID"]);
                        category.CategoryName = row["CategoryName"].ToString();
                        category.CategoryDescription = row["CategoryDescription"].ToString();
                        TechCategoryList.Add(category);
                    }
                }
            }
            return TechCategoryList;
        }
예제 #4
0
 public bool UpdateTechnologyType(TechCategory type)
 {
     TechCategoryHandler myHandler = new TechCategoryHandler(); return myHandler.UpdateTechCategory(type);
 }
예제 #5
0
 public bool AddTechnologyType(TechCategory type)
 {
     TechCategoryHandler myHandler = new TechCategoryHandler(); return myHandler.InsertTechCategory(type);
 }
예제 #6
0
 public bool InsertTechCategory(TechCategory categor)
 {
     SqlParameter[] Params = new SqlParameter[]
     {
         new SqlParameter("@CategoryName", categor.CategoryName ),
         new SqlParameter("@CategoryDescription", categor.CategoryDescription)
     };
     return DataProvider.ExecuteNonQuery("sp_InsertTechCategory", CommandType.StoredProcedure,
         Params);
 }
예제 #7
0
        public List<TechCategory> TechnologyCategoryGloablSearch(string query)
        {
            List<TechCategory> TechCategoryList = null;

            SqlParameter[] Params = { new SqlParameter("@Search", query) };
            using (DataTable table = DataProvider.ExecuteParamatizedSelectCommand("sp_TechnologyCategoryGloablSearch",
                CommandType.StoredProcedure, Params))
            {
                if (table.Rows.Count > 0)
                {
                    TechCategoryList = new List<TechCategory>();
                    foreach (DataRow row in table.Rows)
                    {
                        TechCategory category = new TechCategory();
                        category.TechCategoryID = Convert.ToInt32(row["TechCategoryID"]);
                        category.CategoryName = row["CategoryName"].ToString();
                        category.CategoryDescription = row["CategoryDescription"].ToString();
                        TechCategoryList.Add(category);
                    }
                }
            }
            return TechCategoryList;
        }
예제 #8
0
        public TechCategory SearchTechCategory(string Query)
        {
            TechCategory category = null;
            SqlParameter[] Params = new SqlParameter[]
            {
                new SqlParameter("@Name", Query) ///SEARCH
            };
            using (DataTable table = DataProvider.ExecuteParamatizedSelectCommand("sp_...",
                CommandType.StoredProcedure, Params))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];
                    category = new TechCategory();
                    category.TechCategoryID = Convert.ToInt32(row["TechCategoryID"]);
                    category.CategoryName = row["CategoryName"].ToString();
                    category.CategoryDescription = row["CategoryDescription"].ToString();

                }
            }
            return category;
        }