public ActionResult CreateStudentInfo(studentInfo e)
        {
            e.id = new StudentInfoService().getMaxID() + 1;

            new StudentInfoService().addStudentInfo(e);
            return(RedirectToAction("ViewEnrollments"));
        }
コード例 #2
0
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            globleVeriables.STU_ID = 0;
            studentInfo st_Info = new studentInfo();
            int         count   = st_Info.getTemCount();

            if (count > 0)
            {
                DialogResult dialogResult = MessageBox.Show(systemMessage.EXIT_APP, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Warning);

                if (dialogResult == DialogResult.OK)
                {
                    try
                    {
                        if (st_Info.add_StudentData() && st_Info.delete_TempData())
                        {
                            DialogResult dResult = MessageBox.Show(+count + "  " + "Records add to view successfully.", systemMessage.MESSAGEBOXTITLE_SUCCESS, MessageBoxButtons.OK, MessageBoxIcon.Information);

                            if (dResult == DialogResult.OK)
                            {
                                Application.Exit();;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(systemMessage.TEMP_INSERT, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            else
            {
                Application.Exit();
            }
        }
コード例 #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            fill_DataGried();
            studentInfo           st_Info = new studentInfo();
            int                   count   = st_Info.getTemCount();
            frmMain               frm_M   = new frmMain();
            frmStudentRegistation frm_Reg = new frmStudentRegistation();

            try
            {
                if (st_Info.add_StudentData() && st_Info.delete_TempData())
                {
                    DialogResult dResult = MessageBox.Show(+count + "  " + "Records added successfully.", systemMessage.MESSAGEBOXTITLE_SUCCESS, MessageBoxButtons.OK, MessageBoxIcon.Information);

                    if (dResult == DialogResult.OK)
                    {
                        frmStuden_Details frm_Stdetail = new frmStuden_Details();

                        frmMain frm_M1 = new frmMain();
                        frm_Stdetail.MdiParent = frm_M1;
                        frm_M1.mainPanel.Controls.Clear();
                        frm_M1.mainPanel.Controls.Add(frm_Stdetail);
                        frm_M1.mainPanel.Dock = DockStyle.Fill;
                        frm_Stdetail.Show();
                        this.Close();
                        fill_DataGried();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(systemMessage.TEMP_INSERT, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        public void setStudentId()
        {
            studentInfo stInfo = null;

            try
            {
                if (globleVeriables.STU_ID == 0)
                {
                    stInfo = new studentInfo();
                    int x   = 0;
                    int tot = 0;

                    int i = globleVeriables.STU_ID;

                    x = stInfo.getLastStID();

                    if (x == -1)
                    {
                        globleVeriables.STU_ID = 1;
                        txtStudentId.Text      = globleVeriables.STU_ID.ToString();
                    }
                    else
                    {
                        tot = (x + 1);
                        txtStudentId.Text      = tot.ToString();
                        globleVeriables.STU_ID = tot;
                    }
                }

                else if (globleVeriables.STU_ID > 0)
                {
                    int y    = 0;
                    int tot2 = 0;
                    y    = globleVeriables.STU_ID;
                    tot2 = y + 1;
                    txtStudentId.Text      = tot2.ToString();
                    globleVeriables.STU_ID = tot2;
                }
            }
            catch (SqlException ex)
            {
                globleVeriables.STU_ID = globleVeriables.STU_ID - 1;
                if (ex.Message.Equals("Database Not Found!"))
                {
                    MessageBox.Show(systemMessage.DATABASE_NOTFOUND, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show(systemMessage.TABLE_FAILED, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #5
0
 public string PutStudent(int Id, studentInfo student)
 {
     try
     {
         studentInfo eStudent = _db.studentInfo.First(x => x.Id == Id);
         eStudent.Id       = Id;
         eStudent.FullName = student.FullName;
         eStudent.Address  = student.Address;
         eStudent.email    = student.email;
         eStudent.Branch   = student.Branch;
         _db.SaveChanges();
         return("Updated Successfully");
     }
     catch (Exception e)
     {
         return("Error Updating");
     }
 }
コード例 #6
0
 public string AddStudent([FromBody] studentInfo student)
 {
     try
     {
         _db.studentInfo.Add(student);
         _db.SaveChanges();
         return("Record Added Successfully");
     }
     catch (Exception e)
     {
         if (e.HResult == -2146233087)
         {
             return("Id Number Already Exists");
         }
         else if (e.HResult == -2146232032)
         {
             return("String Too Long");
         }
         return(e.InnerException.InnerException.Message);
     }
 }
コード例 #7
0
        public void fill_DataGried()
        {
            studentInfo st_Info = null;
            DataSet     ds      = null;

            try
            {
                st_Info = new studentInfo();
                ds      = new DataSet();

                ds = st_Info.getAllTepDataDorDataGride();

                this.gdvStudentDetails.DataSource = ds;
                this.gdvStudentDetails.DataMember = "student_Data";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ds.Dispose();
            }
        }
コード例 #8
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            personalInfo personalinfo = new personalInfo()
            {
                FirstName     = firstname.Value,
                MiddleName    = "NA",
                LastName      = lastname.Value,
                Email         = email.Value,
                Password      = password.Value,
                Phone         = phoneNumber.Value,
                Gender        = "M",
                Title         = "1",
                DateofBirth   = "01/01/1991",
                MaritalStatus = Convert.ToInt32("1"),
            };

            residentialInfo residentialinfo = new residentialInfo()
            {
                Streetname   = streetAddress.Text,
                StreetnameII = "NA",
                City         = city.Value,
                Zipcode      = "NA",
                State        = stateID.Value,
                Country      = country.Value,
            };

            // add the business referee to the save method.



            educationInfo educationinfo = new educationInfo()
            {
                HighestDegree  = "NA",
                NameofSchool   = "NA",
                Graddate       = "01/01/1991",
                Certifications = "NA",
            };

            employmentInfo employmentinfo = new employmentInfo()
            {
                YearsofExperience = "3",
                RecentEmployer    = "NA",
                Position          = "NA",
                DateEmployed      = "01/01/1991",
                Functions         = "NA",

                OtherEmployerII  = "null",
                PositionII       = "null",
                DateEmployedII   = "01/01/1991",
                EndDateII        = "01/01/1991",
                JobDescriptionII = "null",

                OtherEmployerIII  = "null",
                PositionIII       = "null",
                DateEmployedIII   = "01/01/1991",
                EndDateIII        = "01/01/1991",
                JobDescriptionIII = "null",
            };

            businessReferee businessreferee = new businessReferee()
            {
                RefereeFirstName   = "NA",
                RefereeLastName    = "NA",
                PositionOccupied   = "NA",
                RefereeEmail       = "NA",
                RefereePhoneNumber = "NA",

                RefereeFirstNameII   = "NA",
                RefereeLastNameII    = "NA",
                PositionOccupiedII   = "NA",
                RefereeEmailII       = "NA",
                RefereePhoneNumberII = "NA"
            };

            userInfo userinfo = new userInfo()
            {
                MemcategoryID = Convert.ToInt32(memcatgoryID.Value),
            };

            studentInfo studentinfo = new studentInfo()
            {
                NyscStateCode = "NA"
            };


            companyInfo companyinfo = new companyInfo()
            {
                Position       = position.Value,
                CompanyName    = nameofCompany.Value,
                CompanyAddress = adressofCompany.Text,
                CompanyEmail   = companyEmail.Text,
                WebAddress     = webAddress.Value,
            };
            //paymentDetails paymentdetails = new paymentDetails()
            //{
            //    Description = paymentCatID.Value,
            //    ReferenceID = transRefID.Value,
            //    PaymentItemID = paymentCatID.Value,
            //};

            registrationViewModel viewObj = new registrationViewModel()
            {
                personalinfo    = personalinfo,
                residentinfo    = residentialinfo,
                businessreferee = businessreferee,
                educationinfo   = educationinfo,
                employmentinfo  = employmentinfo,
                userinfo        = userinfo,
                studentinfo     = studentinfo,
                companyinfo     = companyinfo
            };

            Session["ActiveMemCatID"] = userinfo.MemcategoryID;

            long biodataid = logic.RegisterUser(viewObj);

            //biodataid =Convert.ToInt64(Session["active_biodataid"]);

            if (biodataid > 0)
            {
                Session["UserEmail"] = personalinfo.Email;


                //   try
                //   {
                //       if (FileUpload1.FileName.EndsWith("jpg"))
                //       {
                //           String fileName = Server.MapPath("~") + "/ICA/Credentials/Passport/" + biodataid + ".jpg";
                //           FileUpload1.SaveAs(fileName);
                //           uploadNotificationI.Text = utilities.ShowSuccess("Uploaded Successfully.");

                //       }
                //       else
                //       {
                //           uploadNotificationI.Text = utilities.ShowError("Invalid File Format.");
                //       }

                //// upload pdf files to the folder.

                //       if (FileUpload2.FileName.EndsWith("pdf"))
                //       {
                //           String fileNameII = Server.MapPath("~") + "/ICA/Credentials/Resume/" + biodataid + ".pdf";
                //           FileUpload2.SaveAs(fileNameII);
                //           uploadNotificationII.Text = utilities.ShowSuccess("Uploaded Successfully.");


                //       }
                //       else
                //       {
                //           uploadNotificationII.Text = utilities.ShowError("Invalid File Format.");
                //       }



                //   }
                //   catch (Exception ex)
                //   {


                //   }
                Response.Write("<script>alert('Registration Process is Successful');</script>");
                Response.Redirect("~/guest/registrationPayment.aspx");
            }
            else
            {
            }
        }
 public void updateStudentInfo(studentInfo u)
 {
     new StudentInfoRepository().updateclientInfo(u);
 }
 public void addStudentInfo(studentInfo u)
 {
     new StudentInfoRepository().addstudentInfo(u);
 }
コード例 #11
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            studentBean stBean = null;
            studentInfo stInfo = null;

            if (valid_control())
            {
                try
                {
                    stBean = new studentBean();
                    stInfo = new studentInfo();

                    stBean.Studentid        = Int32.Parse(this.txtStudentId.Text.ToString().Trim());
                    stBean.St_name          = this.txtStudentName.Text.Trim();
                    stBean.Dob              = DateTime.Parse(this.dtpDOB.Text.Trim());
                    stBean.St_gradepointavg = Decimal.Parse(this.txtGradeAvg.Text.Trim());

                    if (this.cbTrue.Checked)
                    {
                        stBean.St_active = "Yes";
                    }
                    else
                    {
                        stBean.St_active = "No";
                    }

                    if (stInfo.add_TemStudentData(stBean))
                    {
                        MessageBox.Show(systemMessage.TEMP_SAVE, systemMessage.MESSAGEBOXTITLE_SUCCESS, MessageBoxButtons.OK, MessageBoxIcon.Information);

                        frmStuden_Details frm_Stdetail = new frmStuden_Details();
                        globleVeriables.STU_ID = globleVeriables.STU_ID - 1;

                        frmMain frm_M = new frmMain();
                        frm_Stdetail.MdiParent = frm_M;
                        frm_M.mainPanel.Controls.Clear();
                        frm_M.mainPanel.Controls.Add(frm_Stdetail);
                        frm_M.mainPanel.Dock = DockStyle.Fill;

                        frm_Stdetail.Show();
                        // Close form
                        this.Dispose();
                    }
                    else
                    {
                        MessageBox.Show(systemMessage.TEMP_INSERT, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                catch (Exception ex)
                {
                    globleVeriables.STU_ID = globleVeriables.STU_ID - 1;
                    if (ex.Message.Equals("Database Not Found!"))
                    {
                        MessageBox.Show(systemMessage.DATABASE_NOTFOUND, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show(systemMessage.TEMP_INSERT, systemMessage.MESSAGEBOXTITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }



                clear_Content();
                setStudentId();
            }
        }