示例#1
0
        public List <MainSkill> GetMainSkills()
        {
            List <MainSkill> mainSkill = new List <MainSkill>();

            try
            {
                object[] param = { };
                var      da    = SqlDBHelper.ExecuteDataset(_connection, StoredProcedures.sp_GetMainSkill,
                                                            param);
                DataTable dt = da.Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    mainSkill.Add(
                        new MainSkill
                    {
                        Id                   = Convert.ToInt32(dr["Id"]),
                        MainSkillName        = dr["SkillName"].ToString(),
                        MainSkillDesctiption = dr["SkillDescription"].ToString(),
                        Active               = Convert.ToBoolean(dr["Active"])
                    });
                }
            }
            catch (Exception ex)
            {
            }
            return(mainSkill);
        }
        public List <KeyValue> GetDropDownData(string tableName)
        {
            List <KeyValue> keyValuePair = new List <KeyValue>();

            try
            {
                object[] param = { tableName };
                var      da    = SqlDBHelper.ExecuteDataset(_connection, StoredProcedures.sp_GetLookUpData,
                                                            param);
                DataTable dt = da.Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    keyValuePair.Add(
                        new KeyValue
                    {
                        Key   = dr["Key"].ToString(),
                        Value = dr["Value"].ToString(),
                    });
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(keyValuePair);
        }