Exemplo n.º 1
0
        private void BindEditForm(object[] data)
        {
            userBAL = new BAL.UserBAL();
            DataTable table = new DataTable();

            table = userBAL.getUsers(data);
            BindFields(table);
        }
Exemplo n.º 2
0
        private void BindUserDataGrid(object[] data)
        {
            userBAL = new BAL.UserBAL();
            DataTable table = new DataTable();

            table = userBAL.getUsers(data);
            this.dataGridUser.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvUserDetails_RowPostPaint);
            dataGridUser.DataSource         = table;
            this.dataGridUser.Columns["UserId"].Visible     = false;
            dataGridUser.Columns[5].DefaultCellStyle.Format = "MM/dd/yyyy";
            dataGridUser.Columns[6].DefaultCellStyle.Format = "MM/dd/yyyy";
            // Auto Resize
            dataGridUser.AutoResizeColumns();
            dataGridUser.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
        }
Exemplo n.º 3
0
        private void btnYes_Click(object sender, EventArgs e)
        {
            switch (OfModule)
            {
            case "User":
                BAL.UserBAL userBAL = new BAL.UserBAL();
                if (userBAL.deleteUser(ToDeleteId))
                {
                    MessageBox.Show("Deleted Successfully");
                    this.Close();
                }
                break;

            case "Customer":
                BAL.CustomerBAL customerBAL = new BAL.CustomerBAL();
                if (customerBAL.deleteCustomer(ToDeleteId))
                {
                    MessageBox.Show("Deleted Successfully");
                    this.Close();
                }
                break;

            case "Supplier":
                BAL.SupplierBAL supplierBAL = new BAL.SupplierBAL();
                if (supplierBAL.deleteSupplier(ToDeleteId))
                {
                    MessageBox.Show("Deleted Successfully");
                    this.Close();
                }
                break;

            case "Material":
                BAL.MaterialBAL materialBAL = new BAL.MaterialBAL();
                if (materialBAL.deleteMaterial(ToDeleteId))
                {
                    MessageBox.Show("Deleted Successfully");
                    this.Close();
                }
                break;

            default:
                break;
            }
        }
Exemplo n.º 4
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     Entity.User user = new Entity.User();
     try
     {
         user.UserId = Convert.ToInt32(lblUserId.Text);
     }
     catch { }
     try
     {
         user.FirstName = txtEditFirstName.Text.ToString();
     }
     catch { }
     try
     {
         user.LastName = txtEditLastName.Text.ToString();
     }
     catch { }
     try
     {
         user.UserName = txtEditUserName.Text.ToString();
     }
     catch { }
     try
     {
         user.EmailId = txtEditEmailId.Text.ToString();
     }
     catch { }
     user.ModifiedBy = "admin";
     userBAL         = new BAL.UserBAL();
     try
     {
         if (userBAL.updateUser(user))
         {
             MessageBox.Show("Updated Successfully");
             this.Close();
         }
         else
         {
             MessageBox.Show("Something Went Wrong.");
         }
     }
     catch (Exception ex) { Exceptions.WriteExceptionLog(ex); MessageBox.Show("Something Went Wrong."); }
 }
Exemplo n.º 5
0
 public AddUser()
 {
     InitializeComponent();
     userBAL = new BAL.UserBAL();
 }
Exemplo n.º 6
0
 public Login()
 {
     InitializeComponent();
     userBAL = new BAL.UserBAL();
 }