private void Login(string name, string password) { //Users usersobj = new Users(); //frmLogin flogin = new frmLogin(); //UserId = usersobj.LoginUser(name, password); //if (UserId != "") //{ // // this.Dispose(); // frmMainForm mf = new frmMainForm(); // // mf.MdiChildren = this; // //mf.Show(); // //this.Hide(); // // this.Close(); // this.Hide(); // mf.ShowDialog(); // this.Close(); //} //else //{ // MessageBox.Show("User Name and Password must be match"); // txtPassword.Text = ""; //} frmMainForm mf = new frmMainForm(); this.Hide(); mf.ShowDialog(); this.Close(); }
private void Login(string name, string password) { Users usersobj = new Users(); frmMainForm fmainform = new frmMainForm(); frmLogin flogin = new frmLogin(); UserId = usersobj.LoginUser(name, password); if (UserId != "") { frmMainForm.UserId = UserId; menuStrip1.Enabled = true; fileToolStripMenuItem.Enabled = true; mastersToolStripMenuItem.Enabled = true; transactionToolStripMenuItem.Enabled = true; reportsToolStripMenuItem.Enabled = true; btnRegistration.Enabled = true; panelLogin.Visible = false; pnLogin.Visible = false; } else { fileToolStripMenuItem.Enabled = false; mastersToolStripMenuItem.Enabled = false; transactionToolStripMenuItem.Enabled = false; reportsToolStripMenuItem.Enabled = false; btnRegistration.Enabled = false; MessageBox.Show("User Name and Password must be match"); txtPassword.Text = ""; } }
private void btnBack_Click(object sender, EventArgs e) { frmMainForm fmain = new frmMainForm(); this.Close(); frmShowLocation fshowloc = new frmShowLocation(); // this.MdiParent = fshowloc.MdiParent; // fshowloc.MdiParent = fmain.MdiParent; // fshowloc.Show(); }
private void btnDetailsEntries_Click(object sender, EventArgs e) { frmSearchStudentByTagId.studentID = studentId; frmMainForm fmain = new frmMainForm(); frmAttendanceDetails fattDeatails = new frmAttendanceDetails(); // this.Hide(); fattDeatails.MdiParent = this.MdiParent; fattDeatails.Show(); }
void eachPictureBox_Click(object sender, EventArgs e) { PictureBox picture = (PictureBox)sender; // MessageBox.Show(picture.Name.ToString()); frmShowLocation.locationId = picture.Name.ToString(); frmMainForm fmain = new frmMainForm(); // this.Hide(); frmAttendaceByLocation fattedance = new frmAttendaceByLocation(); fattedance.Top = 0; fattedance.Left = 0; //fattedance.MdiParent = fmain; fattedance.MdiParent = this.MdiParent; fattedance.Show(); }
void lblName_Click(object sender, EventArgs e) { Label lbl = (Label)sender; // MessageBox.Show(lbl.Text.ToString()); // MessageBox.Show(lbl.Name.ToString()); // conn.msgErr(btn.Name.ToString()); frmShowLocation.locationId = lbl.Name.ToString(); frmMainForm fmain = new frmMainForm(); // this.Hide(); frmAttendaceByLocation fattedance = new frmAttendaceByLocation(); this.Top = 0; this.Left = 0; fattedance.MdiParent = this.MdiParent; // fattDeatails.MdiParent = this.MdiParent; fattedance.Show(); }
private void frmShowLocation_Load(object sender, EventArgs e) { this.Top = 15; this.Left = 0; frmMainForm fmain = new frmMainForm(); frmAttendaceByLocation faatloc = new frmAttendaceByLocation(); // fmain.MdiChildren = this; // faatloc.MdiParent = fmain; // this.MdiChildren= // ShowLocationImageDataGridView1(); lblCountStudent.Text = Convert.ToString(locdalobj.CountRegistrationType("STUDENT")); lblCountFaculty.Text = Convert.ToString(locdalobj.CountRegistrationType("FACULTY")); lblCountHouseKeeping.Text = Convert.ToString(locdalobj.CountRegistrationType("HOUSE KEEPING")); lblCountGuests.Text = Convert.ToString(locdalobj.CountRegistrationType("GUEST")); ShowLocationImage(); }
private void UpdateLocation() { if (locationId == "" || locationId == null) { MessageBox.Show("Please click Data Grid User"); } else { if (txtLocationName.Text == "") { MessageBox.Show("Required is Location Name"); txtLocationName.Focus(); } else if (txtLocationAddress.Text == "") { MessageBox.Show("Required is Location Address"); txtLocationAddress.Focus(); } else if (pbLocationPhoto.Image == null) { MessageBox.Show("Please click Photo Browse"); btnPhoto.Focus(); } else { frmMainForm frmmain = new frmMainForm(); userId = frmmain.userId; string date = DateTime.Now.ToShortDateString(); Database.LocationImageClass locobj = new LocationImageClass(); locobj.LocationId = locationId; locobj.LocationName = txtLocationName.Text; locobj.LocationAddress = txtLocationAddress.Text; locobj.UpdatedBy = frmMainForm.UserId; //locobj.Date = date; //locobj.Time = DateTime.Now.ToShortTimeString(); // locobj.LocationImage = img; img = ImageToBase64(pbLocationPhoto.Image, System.Drawing.Imaging.ImageFormat.Png); locobj.LocationImage = img; locobjdal.UpdateLocation(locobj); Clear(); } } }
private void InsertLocation() { if (txtLocationName.Text == "") { MessageBox.Show("Required is Location Name"); txtLocationName.Focus(); } else if (txtLocationAddress.Text == "") { MessageBox.Show("Required is Location Address"); txtLocationAddress.Focus(); } else if (img == null) { MessageBox.Show("Please click Photo Browse"); btnPhoto.Focus(); } else { frmMainForm frmmain = new frmMainForm(); userId = frmMainForm.UserId; GetId(); string date = DateTime.Now.ToShortDateString(); Database.LocationImageClass locobj = new LocationImageClass(); locobj.LocationId = nextLocationId; locobj.LocationName = txtLocationName.Text; locobj.LocationAddress = txtLocationAddress.Text; locobj.UpdatedBy = frmMainForm.UserId; locobj.Date = date; locobj.Time = DateTime.Now.ToShortTimeString(); locobj.LocationImage = img; locobjdal.InsertLocation(locobj); ShowLocation(); Clear(); } }