public ItemTracker(cUsers user) { InitializeComponent(); LoadItems(); loggedUser = new cUsers(); loggedUser = user; }
public QuanTypeView(cUsers user) { InitializeComponent(); LoadQuanTypes(); CenterToParent(); loggedUser = new cUsers(); loggedUser = user; llblLog.Text = loggedUser.UserName; }
public QuanTypeAdd(cUsers user) { InitializeComponent(); dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; CenterToParent(); loggedUser = new cUsers(); loggedUser = user; llblLog.Text = loggedUser.UserName; }
public UserAdd(cUsers user) { InitializeComponent(); loggedUser = new cUsers(); loggedUser = user; dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; CenterToParent(); loadUserTypes(); }
public InventoryAdd(cUsers user) { InitializeComponent(); CenterToParent(); LoadItems(); dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; loggedUser = user; llblLog.Text = loggedUser.UserName; }
public ReportView(cReports report, cUsers user) { rep = new cReports(); rep = report; InitializeComponent(); loggedUser = new cUsers(); loggedUser = user; //nibbies(); //openConnection(); }
public Mainform(cUsers user) { Cursor.Current = Cursors.WaitCursor; CommonFunc cmm = new CommonFunc(); InitializeComponent(); toolStripStatusLabelCompany.Text = cmm.Company; // toolStripStatusLabelUser.Text = new UserLogin(; toolStripStatusLabelDate.Text = /*DateTime.Today.DayOfWeek.ToString() + ", " + */ DateTime.Today.ToLongDateString() + " " + DateTime.Now.ToShortTimeString(); //UserAccessLevel = 3; //this.WindowState = FormWindowState.Maximized; tooltips(); try { //Solution = ConfigurationManager.AppSettings["Solution"]; //mClient = ConfigurationManager.AppSettings["ClientInfo"]; //toolStripStatusLabelClientData.Text = mClient; //if (Solution.Trim().Length == 0) //{ // MessageBox.Show("Solution Key Not defined in config file. Please Contact Administrator to ensure Solution Code is defined."); //} } catch (Exception ex) { MessageBox.Show("Error reading Solution/ClientInfo data from config file." + Environment.NewLine + ex.Message); } Cursor.Current = Cursors.Default; bool status = loginSuccess(); if (!status) { loggedUser = null; return; } loadUserDetails(status); CenterToScreen(); this.Refresh(); }
public Print(ListView lst, cUsers user, decimal cash, decimal change) { InitializeComponent(); CenterToScreen(); loggedUser = new cUsers(); loggedUser = user; llblLog.Text = loggedUser.UserName; dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; list = lst; this.change = change; foreach (ListViewItem itm in lst.Items) { ListViewItem lvi = new ListViewItem(itm.SubItems[0].Text); lvi.SubItems.Add(itm.SubItems[1].Text); // Price // lvi.SubItems.Add(qty); // Portions lvi.SubItems.Add(itm.SubItems[4].Text); // from previous form it's portions or qty lvi.SubItems.Add(itm.SubItems[3].Text); // add the Type -- deluxe half portion lvi.SubItems.Add(itm.SubItems[6].Text); // is it part of the stock table // ---------------------- //ListViewItem item = new ListViewItem(item); lstVwItms.Items.Add(lvi); total += Convert.ToDecimal(itm.SubItems[4].Text); } if (lst.Items.ContainsKey(staffDiscountID.ToString())) numTotal.Minimum = -20; else numTotal.Minimum = 0; numTotal.Value = Convert.ToDecimal(total); //total_tbox.Text = String.Format("{0:c}", total); numCash.Value = cash; }
private void btnAdd_Click(object sender, EventArgs e) { if (tBxFirstName.Text.Trim() == "") { MessageBox.Show("First Name Required"); return; } if (tBxLastName.Text.Trim() == "") { MessageBox.Show("Last Name Required"); return; } if (cmbType.SelectedIndex == -1) { MessageBox.Show("Please select a user type."); return; } if (txtBxPassword.Text == "") { MessageBox.Show("Please enter a password."); return; } cUsers use = new cUsers(tBxFirstName.Text, tBxLastName.Text, cUsers.CalculateSHA1(txtBxPassword.Text, Encoding.UTF8), txtBxCompany.Text, Convert.ToInt16(cmbType.SelectedValue.ToString()), false, dtpDtAdd.Value.ToString(), dtpDtAdd.Value.ToString(), dtpDtAdd.Value.ToString()); if (use.checkUserName()) { MessageBox.Show("A user with this name already exits!"); return; } if (use.saveRecord()) { MessageBox.Show("Saved"); txtBxPassword.Clear(); tBxFirstName.Clear(); tBxLastName.Clear(); cmbType.SelectedIndex = -1; tBxFirstName.Focus(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // switch to this Application.Run(new Mainform(new cUsers())); //////////////////////////////////////////// //////// for debugging cUsers del = new cUsers(); del.UserID = 1; del.UserName = "******"; //Application.Run(new MealView(del)); //Application.Run(new Sale(del)); //Application.Run(new ReportOptions(del)); }
public MealAdd(cUsers user) { InitializeComponent(); CenterToParent(); LoadCategories(); LoadQtyTypes(); dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; loggedUser = new cUsers(); loggedUser = user; // advantages of superuser if (loggedUser.PermLevel == 3) { numPrice.Minimum = -50; } llblLog.Text = loggedUser.UserName; }
public UserView(cUsers user) { Cursor.Current = Cursors.WaitCursor; InitializeComponent(); loggedUser = new cUsers(); loggedUser = user; dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; CenterToParent(); LoadUserTypes(); LoadUsers(); loggedUser = new cUsers(); loggedUser = user; llblLog.Text = loggedUser.UserName; Cursor.Current = Cursors.WaitCursor; }
//object senderDoubleClcik; //EventArgs eDoubleClick = new EventArgs(); public Sale(cUsers user) { loggedUser = new cUsers(); loggedUser = user; InitializeComponent(); CenterToParent(); LoadDifCtgy(); //numTot.Tex; llblLog.Text = loggedUser.UserName; int a = SystemInformation.VerticalScrollBarWidth; //lstVwBrkfst. //tabCont.Sc //lstVwBrkfst. // make scrollbar width bigger //lstVwBrkfst.get //for (int i = 0; i < lstVwBrkfst.Controls.Count; i++) //{ // Control c = tabCont.Controls[i]; //} //cScrollBar sc = new cScrollBar(); //ListView ss = sc; //sc.OnScroll(); // Handle the TextChanged to get the text for our search. // txtSearch.TextChanged += new EventHandler(txtSearch_TextChanged); txtSearch.GotFocus += new EventHandler(RemoveText); txtSearch.LostFocus += new EventHandler(AddText); }
public MealView(cUsers user) { InitializeComponent(); CenterToParent(); LoadMeals(); LoadCategories(); LoadQtyTypes(); dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; // dgvCat_Click(dgvCat, new DataGridViewCellEventArgs(0, 0)); // datagridviewRowClickedEventHandler(new object(), new eventargs()); cmbQtyType.Enabled = false; loggedUser = new cUsers(); loggedUser = user; llblLog.Text = loggedUser.UserName; updateFont(); }
public InventoryView(cUsers user) { InitializeComponent(); CenterToParent(); LoadItems(); LoadMeals(); dtpDtAdd.Format = DateTimePickerFormat.Custom; dtpDtAdd.CustomFormat = "ddd dd MMM yyyy"; dtpDateAdded.Format = DateTimePickerFormat.Custom; dtpDateAdded.CustomFormat = "ddd dd MMM yyyy"; //cmbItems.Enabled = false; pEdt.Enabled = false; loggedUser = new cUsers(); loggedUser = user; llblLog.Text = loggedUser.UserName; productID = 0; updateFont(); }
private void btnDel_Click(object sender, EventArgs e) { cUsers user = new cUsers(); user.UserID = Convert.ToUInt16(dgvUsr["UserID", dgvUsr.CurrentCell.RowIndex].Value); DialogResult decision = MessageBox.Show("Are you sure you want to delete" + user.UserName + "?", "Confirmation", MessageBoxButtons.YesNo); if (decision == DialogResult.Yes) { if (user.deactivateUser()) { MessageBox.Show("User has been deactivated"); //txtBxPassword.Clear(); //tBxFirstName.Clear(); ////tBxLastName.Clear(); //cmbType.SelectedIndex = -1; //tBxFirstName.Focus(); LoadUsers(); } else{ MessageBox.Show("User could not be deactivated."); } } }
private bool loginSuccess() { bool result = false; UserLogin userDetail = new UserLogin(); userDetail.ShowDialog(); //if (userDetail.UserName != null && userDetail.UserName != "" && userDetail.mUser.checkUserName()) //{ // loggedUser = new cUsers(); // loggedUser.UserName = userDetail.UserName; // loggedUser.Password = userDetail.mUser.Password; // result = true; //} if (userDetail.mUser.UserName != null && userDetail.mUser.UserName != "" && userDetail.mUser.checkUserName()) { loggedUser = new cUsers(); loggedUser.UserName = userDetail.mUser.UserName; loggedUser.Password = userDetail.mUser.Password; result = true; } loadUserDetails(result); return result; }
private bool loadUserDetails(bool loadOrNa) { if (loadOrNa) { DataSet ds = new DataSet(); ds = loggedUser.userDetailsGet(); try { if (ds.Tables[0].Rows.Count > 0) { loggedUser.UserID = Convert.ToInt16(ds.Tables[0].Rows[0]["UserID"].ToString()); loggedUser.PermLevel = Convert.ToInt16(ds.Tables[0].Rows[0]["PermLevel"].ToString()); loggedUser.Company = (ds.Tables[0].Rows[0]["Company"].ToString()); loggedUser.DeActivate = false; if ((ds.Tables[0].Rows[0]["DeActivate"].ToString()) == "1") { loggedUser.DeActivate = true; } lblLog.Text = loggedUser.UserName; toolStripStatusLabelUser.Text = loggedUser.UserName; return true; } else return false; } catch (IndexOutOfRangeException outRange) { MessageBox.Show("Not Logged In\n" + outRange.ToString() + "\nEntered username and cancelled or db parameter lengths"); loggedUser = null; return false; //EndApp(); } } else { lblLog.Text = "Not Logged In"; toolStripStatusLabelUser.Text = "Not Logged In"; return false; } }
private void btnLg_Click(object sender, EventArgs e) { bool status = loginSuccess(); if (!status) { loggedUser = null; return; } loadUserDetails(status); }
private void btnSave_Click(object sender, EventArgs e) { if (tBxFirstName.Text.Trim() == "") { MessageBox.Show("Name Required"); return; } if (cmbType.SelectedIndex == -1) { MessageBox.Show("Please select a user type."); return; } if (txtBxPassword.Text == "") { MessageBox.Show("Please enter a password."); return; } string[] names = tBxFirstName.Text.Split(); int usertype = 0; bool deactivate = false; cUsers use = new cUsers(); //if (tBxFirstName.Text == "Del") // use = new cUsers("Del", "", cUsers.CalculateSHA1(txtBxPassword.Text, Encoding.UTF8), "de~la", 3, false, dtpDtAdd.Value.ToString(), dtpDtAdd.Value.ToString(), dtpDtAdd.Value.ToString()); //else ////Convert.ToInt16(cmbType.SelectedValue.ToString()); //{ if (tBxFirstName.Text == "Del") { names = new string[]{"Del",""}; } use = new cUsers(names[0], names[1], cUsers.CalculateSHA1(txtBxPassword.Text, Encoding.UTF8), company, Convert.ToUInt16(cmbType.SelectedValue), deactivate, dtpDtAdd.Value.ToString(), dtpDtAdd.Value.ToString(), dtpDtAdd.Value.ToString()); //} use.UserID = Convert.ToUInt16(dgvUsr["UserID", dgvUsr.CurrentCell.RowIndex].Value); //if (tBxFirstName.Text == "Del") //{ // use.UserName = "******"; // use.Password = cUsers.CalculateSHA1(txtBxPassword.Text, Encoding.UTF8); // //use.PermLevel = 3; //} //else //{ //} if (chkPassword.Checked) { if (use.saveRecord()) { MessageBox.Show("Saved with password change"); //txtBxPassword.Clear(); //tBxFirstName.Clear(); ////tBxLastName.Clear(); //cmbType.SelectedIndex = -1; //tBxFirstName.Focus(); LoadUsers(); } } else { if (use.saveRecordNoPassword()) { MessageBox.Show("Saved with no password change"); //txtBxPassword.Clear(); //tBxFirstName.Clear(); ////tBxLastName.Clear(); //cmbType.SelectedIndex = -1; //tBxFirstName.Focus(); LoadUsers(); } } }
private void LoadUsers() { DataSet ds = new DataSet(); cUsers user = new cUsers(); ds = user.UsersGetActive(); cmbUsers.DataSource = ds.Tables[0]; cmbUsers.ValueMember = "UserID"; cmbUsers.DisplayMember = "UserName"; cmbUsers.SelectedIndex = cmbUsers.FindStringExact("Del"); }
private void LoadUsers() { DataSet ds = new DataSet(); try { cUsers user = new cUsers(); user.UserID = 0; ds = user.UsersGetAll(); dgvUsr.DataSource = ds.Tables[0]; dgvUsr.Columns[0].HeaderText = "User ID"; dgvUsr.Columns[1].HeaderText = "Name"; dgvUsr.Columns[2].HeaderText = "Company"; dgvUsr.Columns[3].HeaderText = "Permission"; dgvUsr.Columns[4].HeaderText = "Date Added"; dgvUsr.Columns[5].HeaderText = "Last Attepted Login"; dgvUsr.Columns[6].HeaderText = "Last Login"; dgvUsr.Columns[7].HeaderText = "Deactived"; dgvUsr.Columns[8].HeaderText = "Position"; dgvUsr.Columns[0].Visible = false; dgvUsr.Columns[2].Visible = false; dgvUsr.Columns[3].Visible = false; dgvUsr.Columns[8].Visible = false; //dgvUsr.Columns[0].Visible = false; dgvUsr.Columns[1].Width = 200; dgvUsr.Columns[2].Width = 200; //dgvUsr.Columns[3].Width = 150; dgvUsr.Columns[4].Width = 150; dgvUsr.Columns[5].Width = 150; dgvUsr.Columns[6].Width = 150; dgvUsr.Columns[6].Width = 150; dgvUsr.Columns[7].Width = 80; dgvUsr.Columns[8].Width = 120; } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { ds.Dispose(); } disableTools(false); }