Example #1
0
        private void Add2_Click(object sender, EventArgs e)
        {
            Employee info = new Employee();

            info.Name          = nametf.Text;
            info.Id            = Convert.ToInt32(idtf.Text);
            info.DOB           = dobtf.Text;
            info.Gender        = gendertf.Text;
            info.Address       = addresstf.Text;
            info.Email         = emailtf.Text;
            info.ContactNumber = contactnotf.Text;
            info.JoiningDate   = joiningdatetf.Text;
            info.Post          = posttf.Text;
            info.Salary        = salarytf.Text;
            info.WorkingDays   = workingdaystf.Text;
            info.WorkingHours  = workinghourstf.Text;
            info.ReportingTime = reportingtimetf.Text;
            info.LeavingTime   = leavingtimetf.Text;


            string error;

            if (!repo.AddInfo(info, out error))
            {
                /*this.Visible = false;
                 * Form7 a2 = new Form7();
                 * a2.Visible = true;*/
            }
            // else { MessageBox.Show("wrong or missing info"); }
            this.Visible = false;
            Form7 a2 = new Form7();

            a2.Visible = true;
        }