示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Details d   = new Details();
                long    det = d.smedet(Session["adminlogin"].ToString());
                RequestManagementSql smeDetail = new RequestManagementSql();
                model.SME            smeDao    = new model.SME();
                smeDao        = smeDetail.getSme(det);
                Label1.Text   = smeDao.SmeId.ToString();
                TextBox1.Text = smeDao.First_name;
                TextBox2.Text = smeDao.Last_name;
                TextBox3.Text = smeDao.Gender;
                TextBox4.Text = smeDao.Age.ToString();
                TextBox5.Text = smeDao.Contact_no.ToString();
                TextBox6.Text = smeDao.EmailId;
                TextBox7.Text = smeDao.Description;


                List <Skill>         dbdata          = new List <Skill>();
                RegistrationCheckbox checkboxDetails = new RegistrationCheckbox();
                dbdata = checkboxDetails.registrationCheckboxFill();
                foreach (Skill s in dbdata)
                {
                    ListItem item = new ListItem();
                    item.Value = s.SkillId.ToString();
                    item.Text  = s.SkillName;
                    CheckBoxList1.Items.Add(item);
                }
                SmeDao       sme       = new SmeDaoSqlImpl();
                List <Skill> skilllist = new List <Skill>();
                skilllist = sme.getsmeSkillList(det);

                foreach (ListItem item in CheckBoxList1.Items)
                {
                    foreach (Skill a in skilllist)
                    {
                        if (item.Value == a.SkillId.ToString())
                        {
                            item.Selected = true;
                        }
                    }
                }
            }
        }
示例#2
0
        public long smedet(string userid)
        {
            model.SME     details = new model.SME();
            SqlConnection connect = ConnectionHandler.getConnection();

            connect.Open();
            SqlCommand cmd = new SqlCommand("select * from sme where userid=@userid", connect);

            cmd.Parameters.AddWithValue("@userid", userid);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            connect.Close();
            DataTable dt = ds.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                details.SmeId = long.Parse(dr["smeId"].ToString());
            }
            long h = details.SmeId;

            return(h);
        }