private void btnLogin_Click(object sender, EventArgs e) { string username = txtUserName.Text; string password = txtPassword.Text; Operator op = new Operator(username, password); if (username.Equals("")) { MessageBox.Show("Enter User Name !!!"); return; } if (password.Equals("")) { MessageBox.Show("Enter Password !!!"); return; } if (APPLICATION.VerifyOperator(op)) { MainForm frm = new MainForm(); this.Hide(); frm.Show(); } else { MessageBox.Show("Incorrect User name or Password"); } }
private void btnAddDepartment_Click(object sender, EventArgs e) { if (txtDepartmentName.Text.Equals("") || numDeptSeats.Value.Equals(0)) { MessageBox.Show("Department Name or number of seats is missing"); return; } int dept_id = APPLICATION.departments.Count + 1; Department d = new Department(dept_id, txtDepartmentName.Text, Convert.ToInt32(numDeptSeats.Value)); if (APPLICATION.AddDepartment(d)) { MessageBox.Show("Department Successfully Added"); // Displaying Departments in the Data Grid View BindingSource bs = new BindingSource(); bs.DataSource = APPLICATION.departments; dataGridDepartments.DataSource = bs; txtDepartmentName.Text = ""; numDeptSeats.Value = 0; } else { MessageBox.Show("Department Already Added"); } }
public ActionResult DeleteConfirmed(string id) { APPLICATION aPPLICATION = db.APPLICATION.Find(id); db.APPLICATION.Remove(aPPLICATION); db.SaveChanges(); return(RedirectToAction("Index")); }
public bool AddEditApplication(ApplicationModel appmodel, ref string mode) { bool status = false; APPLICATION app = new APPLICATION(); try { app = (from a in DB.APPLICATION where a.S_ == appmodel.SNo select a).FirstOrDefault <APPLICATION>(); if (app == null) { try { app = new APPLICATION(); app.S_ = appmodel.SNo; app.NewApplication = appmodel.PSWApplication; app.ENTERED_DATE = DateTime.Now; app.ENTERED_BY = userInformation.UserName; app.DELETE_FLAG = appmodel.Active; DB.APPLICATION.InsertOnSubmit(app); DB.SubmitChanges(); mode = "Add"; return(true); } catch (Exception e) { e.LogException(); DB.APPLICATION.DeleteOnSubmit(app); } } else { try { app.NewApplication = appmodel.PSWApplication; app.UPDATED_DATE = DateTime.Now; app.UPDATED_BY = userInformation.UserName; app.DELETE_FLAG = appmodel.Active; DB.SubmitChanges(); mode = "Update"; return(true); } catch (Exception e) { e.LogException(); DB.APPLICATION.Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, app); } } } catch (Exception e) { throw e.LogException(); } return(status); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); APPLICATION a = new APPLICATION(); Application.Run(new LoginForm()); //Application.Run(new MainForm()); }
public ActionResult Edit([Bind(Include = "DealID,StockID,OwnerID,StockQuantity")] APPLICATION aPPLICATION) { if (ModelState.IsValid) { db.Entry(aPPLICATION).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OwnerID = new SelectList(db.OWNER, "OwnerID", "OwnerName", aPPLICATION.OwnerID); return(View(aPPLICATION)); }
private void btnGenerateMeritList_Click(object sender, EventArgs e) { APPLICATION.GenerateMeritList(); btnSendEmail.Enabled = true; btnPDFPrint.Enabled = true; if (APPLICATION.selectedStudents.Count > 0) { btnPDFPrint.Enabled = true; btnSendEmail.Enabled = true; } }
// GET: APPLICATIONs/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } APPLICATION aPPLICATION = db.APPLICATION.Find(id); if (aPPLICATION == null) { return(HttpNotFound()); } return(View(aPPLICATION)); }
// GET: APPLICATIONs/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } APPLICATION aPPLICATION = db.APPLICATION.Find(id); if (aPPLICATION == null) { return(HttpNotFound()); } ViewBag.OwnerID = new SelectList(db.OWNER, "OwnerID", "OwnerName", aPPLICATION.OwnerID); return(View(aPPLICATION)); }
public bool DeletePswApplication(string application) { APPLICATION app = new APPLICATION(); try { app = (from c in DB.APPLICATION where c.NewApplication == application// && ((Convert.ToBoolean(Convert.ToInt16(c.DELETE_FLAG)) == false) || (c.DELETE_FLAG == null)) select c).FirstOrDefault <APPLICATION>(); if (app != null) { if (app.DELETE_FLAG == true) { app.DELETE_FLAG = false; } else { app.DELETE_FLAG = true; } //ddPswTitle.DELETE_FLAG = true; app.UPDATED_DATE = DateTime.Now; app.UPDATED_BY = userInformation.UserName; DB.SubmitChanges(); return(true); } else if (app == null) { return(false); } } catch (System.Data.Linq.ChangeConflictException) { // DB.PSW_WAR_TITLE.Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, ddPswTitle); DB.ChangeConflicts.ResolveAll(System.Data.Linq.RefreshMode.KeepChanges); } catch (Exception ex) { ex.LogException(); DB.APPLICATION.Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, app); } return(true); }
private void btnPDFPrint_Click(object sender, EventArgs e) { APPLICATION.PrintMeritList(); }
private void btnSendEmail_Click(object sender, EventArgs e) { APPLICATION.EmailSelectedStudents(); }
private void btnSubmitApplication_Click(object sender, EventArgs e) { StudentApplication app = new StudentApplication(); // check personal Information if (txtName.Text.Equals("") || txtFatherName.Text.Equals("") || txtEmail.Text.Equals("") || txtPhoneNumber.Text.Equals("") || txtIDCard.Equals("")) { MessageBox.Show("Personal information Incomplete"); return; } try { MailAddress email = new MailAddress(txtEmail.Text); } catch { MessageBox.Show("Email Address is not valid"); } // add Personal Information app.student_name = txtName.Text; app.std_father_name = txtFatherName.Text; app.std_email = txtEmail.Text; app.std_phone_number = txtPhoneNumber.Text; app.std_id_card = txtIDCard.Text; // check Educational Information if (numMatricMarks.Value.Equals(0) || numMatricMarks.Value.Equals(0) || numEcatMarks.Value.Equals(0)) { MessageBox.Show("Incomplete Educational Details"); return; } // add educational details app.Matric_got_marks = Convert.ToInt32(numMatricMarks.Value); app.FSC_got_marks = Convert.ToInt32(numFSCMarks.Value); app.ECAT_got_marks = Convert.ToInt32(numEcatMarks.Value); app.GAT_got_marks = Convert.ToInt32(numGatMarks.Value); app.aggregate = calculateAggrigate(app.FSC_got_marks, app.ECAT_got_marks); app.app_ref_number = APPLICATION.applications.Count + 1; // check Preference List if (prefs.Count == 3) { // Add Preference List app.preferences = prefs; } else { MessageBox.Show("You Must Add 3 Preferences"); return; } // Application Ready.. Now Add into Database if (APPLICATION.AddStudentApplication(app)) { MessageBox.Show("Application Submitted Successfully"); // new Binding Source to display in Applications Data Grid BindingSource bs = new BindingSource(); bs.DataSource = APPLICATION.applications; dataGridApplications.DataSource = bs; // function call to print the receipt for the Student // // clear the Filled Text Boxes txtName.Text = ""; txtFatherName.Text = ""; txtIDCard.Text = ""; txtPhoneNumber.Text = ""; txtEmail.Text = ""; numMatricMarks.Value = 0; numFSCMarks.Value = 0; numEcatMarks.Value = 0; numGatMarks.Value = 0; dataGridPreferences.DataSource = null; prefs = null; personalInfoPanel.BringToFront(); panelApplications.Visible = false; } }
public PageValidationResult Validate(CSOMContext dbContext, APPLICATION app) { throw new System.NotImplementedException(); }