Exemplo n.º 1
0
    protected void btnempdetails_Click(object sender, EventArgs e)
    {
        Hashtable data = new Hashtable();
        data.Add("name", txtname.Text);
        data.Add("dob", txtdob.Text);
        data.Add("adrs", txtadrs.Text);
        data.Add("phoneno", txtphoneno.Text);
        data.Add("emailid", txtemailid.Text);
        data.Add("designation", cbdesg.SelectedItem.Text);
        data.Add("dept", cbdep.SelectedItem.Text);

        if (cbdesg.SelectedItem.Text != "Head")
        {
            if (lblheadname.Visible == false)
            {
                data.Add("headname", "");
                data.Add("headid", "");
            }
            else
            {
                data.Add("headname", cbheadname.SelectedItem.Text);
                data.Add("headid", cbheadname.SelectedValue);
            }

        }

        data.Add("desc", txtdesc.Text);

        bll insempdet = new bll();
        int j;
        j=insempdet.insempdet(data);
        for (int i = 0; i < lbempunder.Items.Count; i++)
        {

            Hashtable datahead = new Hashtable();
            ListItem li = new ListItem();
            datahead.Add("empheadchange", lbempunder.Items[i].Value);
            datahead.Add("empheadname", txtname.Text);
            datahead.Add("empheadid", j);
            bll emphead = new bll();
            emphead.uphead(datahead);
        }

        lblretemp.Text = "Employee Details Inserted & Employee ID is " + j.ToString();
    }