Пример #1
0
        private void profileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int    id    = LoginHelper.UserProfile.ID;
            string name  = LoginHelper.UserProfile.Name;
            string uName = LoginHelper.UserProfile.UserName;
            string pass  = LoginHelper.UserProfile.Password;
            int    uType = LoginHelper.UserProfile.User_Type;
            Image  image = LoginHelper.UserProfile.UImage;

            AddUser au = new AddUser(id, name, uName, pass, uType, image, null);

            au.Visible = true;
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            bool check = false;

            try
            {
                check = ad.AddSalesman(txtSName.Text, txtSAddress.Text, cmbSCity.Text, txtSPostalCode.Text, txtSMobile.Text, txtSEmail.Text, int.Parse(txtSCommission.Text), txtSRemarks.Text, pbS.ImageLocation);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Please fill the fiels properly");
            }
            if (check)
            {
                var data = from d in cmd.Salesman_Details
                           where d.Email_ID.ToString().Equals(txtSEmail.Text)
                           select d;

                AddUser au = new AddUser(data.Single().Sal_ID, data.Single().Name, null, null, 3, null, pbS.ImageLocation);
                au.Visible   = true;
                this.Visible = false;
            }
        }