예제 #1
0
        private void btnComfirm_Click(object sender, EventArgs e)
        {
            StudentDto newStudentDto;

            if (Utilities.StringIsNullOrEmpty(txtStudentId.Text, txtName.Text, txtAddress.Text, txtNation.Text, txtReligion.Text,
                                              txtPhone.Text, txtSsn.Text, lookUpEditClass.Text))
            {
                XtraMessageBox.Show(@"Please fill in all fields", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            try
            {
                newStudentDto = CreateStudent();
            }
            catch (Exception)
            {
                XtraMessageBox.Show(@"Please input valid information.", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            try
            {
                StudentBusiness.AddStudent(newStudentDto);
            }
            catch (Exception)
            {
                XtraMessageBox.Show(@"Duplicate student. Please check the input information.", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            Close();
        }
예제 #2
0
        public bool UploadStudentResume(int studentId)
        {
            var           folderPath         = CommonFunctions.GetConfigValue("studentFilePath");
            List <string> documentExtensions = new List <string>()
            {
                ".pdf", ".doc", ".docx"
            };

            for (int i = 0; i < Request.Files.Count; i++)
            {
                var fileName       = Path.GetFileName(Request.Files[i].FileName);
                var fileExtension  = Path.GetExtension(Request.Files[i].FileName);
                var fileNameOnDisk = string.Empty;
                if (documentExtensions.IndexOf(fileExtension) < 0)
                {
                    return(false);
                }
                fileNameOnDisk = fileNameOnDisk = "STP-" + studentId + "-" + Guid.NewGuid().ToString().Replace("-", "") + fileExtension;
                Request.Files[i].SaveAs(folderPath + fileNameOnDisk);
                if (StudentBusiness.SaveStudentDocument(studentId, fileName, fileNameOnDisk, Request.Files[i].ContentLength) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }
        public DataResultArgs <StudentEntity> ConvertStudent(string id)
        {
            DataResultArgs <StudentEntity> result = new DataResultArgs <StudentEntity>
            {
                HasError         = true,
                ErrorDescription = "Id bilgisine ulaşılamadı"
            };

            if (!string.IsNullOrEmpty(id))
            {
                int.TryParse(Cipher.Decrypt(id), out var idInt);
                if (idInt > 0)
                {
                    StudentEntity studentEntity = new StudentBusiness().Get_Student(idInt).Result;

                    if (studentEntity != null)
                    {
                        studentEntity.IsStudent                  = true;
                        studentEntity.DatabaseProcess            = DatabaseProcess.Update;
                        studentEntity.IsAddAfterPaymentUnPayment = true;
                        result = new StudentBusiness().Set_Student(studentEntity);
                    }
                }
            }
            return(result);
        }
        public DataResultArgs <bool> DeleteStudent(string id)
        {
            DataResultArgs <bool> result = new DataResultArgs <bool>
            {
                HasError = true, ErrorDescription = "Id bilgisine ulaşılamadı"
            };

            if (!string.IsNullOrEmpty(id))
            {
                int.TryParse(Cipher.Decrypt(id), out var idInt);
                if (idInt > 0)
                {
                    StudentEntity entity = new StudentEntity {
                        Id = idInt, DatabaseProcess = DatabaseProcess.Deleted
                    };

                    DataResultArgs <StudentEntity> resultSet = new StudentBusiness().Set_Student(entity);
                    result.HasError         = resultSet.HasError;
                    result.MyException      = resultSet.MyException;
                    result.ErrorDescription = resultSet.ErrorDescription;
                    result.Result           = !resultSet.HasError;
                }
            }

            return(result);
        }
        public ActionResult Format()
        {
            StudentBusiness C = new StudentBusiness();

            C.Format();
            return(View(C));
        }
        public ActionResult Student_Export()
        {
            StudentBusiness C = new StudentBusiness();

            C.Student_Export();
            return(View(C));
        }
예제 #7
0
 public JsonResult UpdateStudentInfo(StudentInfoModel model)
 {
     try
     {
         var result = StudentBusiness.UpdateStudentInfo(model);
         if (result != null)
         {
             if (Request.Files.Count > 0)
             {
                 UploadStudentResume(result.studentId);
             }
         }
         var response = new ApiRespnoseWrapper {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 result
             }
         };
         return(new JsonResult {
             Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
        public StudentListAndPaymentTypeInfo GetStudentListAndPaymentTypeInfoForPaymentDetail(string decryptStudentId, string year)
        {
            StudentListAndPaymentTypeInfo info = new StudentListAndPaymentTypeInfo
            {
                PaymentTypeList = GetPaymentAllPaymentType()
            };

            string id = Cipher.Decrypt(decryptStudentId);

            int idInt = GeneralFunctions.GetData <int>(id);

            if (idInt > 0)
            {
                StudentEntity studentEntity = new StudentBusiness().Get_Student().Result.FirstOrDefault(o => o.Id == idInt);
                if (studentEntity != null)
                {
                    DataResultArgs <List <PaymentEntity> > paymentListResult = new PaymentBusiness().Get_Payment(idInt, year);
                    if (!paymentListResult.HasError)
                    {
                        if (paymentListResult.Result.Any())
                        {
                            studentEntity.PaymentList = paymentListResult.Result;
                        }
                    }

                    info.StudentList.Add(studentEntity);
                }
            }
            return(info);
        }
예제 #9
0
 public FormStudent()
 {
     InitializeComponent();
     studentList = StudentBusiness.GetAll();
     studentDtoBindingSource.DataSource          = studentList;
     gridViewStudent.OptionsBehavior.EditingMode = GridEditingMode.EditFormInplace;
     gridViewPriorities.Columns["Content"].BestFit();
 }
예제 #10
0
        public ActionResult Edit(string id)

        {
            IStudentBusiness buisnes = new StudentBusiness();
            var i = buisnes.GetByID(id);

            return(View(i));
        }
예제 #11
0
        public AllResponse All()
        {
            var response        = new AllResponse();
            var studentBussines = new StudentBusiness();

            response.Result = studentBussines.All();
            return(response);
        }
예제 #12
0
        private void gridViewStudent_RowUpdated(object sender, RowObjectEventArgs e)
        {
            var index   = gridViewStudent.GetDataSourceRowIndex(e.RowHandle);
            var student = studentList[index];

            StudentBusiness.EditStudent(student);
            gridControl1.RefreshDataSource();
        }
예제 #13
0
        public StudentsForm()
        {
            InitializeComponent();
            IStudentRepository studentRepository = new StudentRepository();

            this.studentBusiness    = new StudentBusiness(studentRepository);
            comboBox1.DataSource    = arrClass;
            comboBox1.SelectedIndex = 0;
        }
예제 #14
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     StudentBusiness.InitialDatabase();
 }
예제 #15
0
 public List <Student> GetAllStudent()
 {
     using (SCContext context = new SCContext(_contextName)) {
         IUnitOfWork     uow             = new UnitOfWork(context);
         StudentBusiness studentBusiness = new StudentBusiness(uow);
         var             students        = studentBusiness.GetAllStudent();
         return(students.ToList());
     }
 }
        protected void btnSendEmail_Click(object sender, EventArgs e)
        {
            try
            {
                btnSendEmail.Enabled = false;
                object Id = Request.QueryString["Id"];

                if (Id == null)
                {
                    ThrowError();
                    return;
                }

                string IdDecrypt = Cipher.Decrypt(Id.ToString());
                int    id        = GeneralFunctions.GetData <int>(IdDecrypt);
                if (id <= 0)
                {
                    ThrowError();
                    return;
                }
                else
                {
                    StudentEntity entity          = new StudentBusiness().Get_StudentWithPaymentList(id);
                    string        savePathToFiles =
                        Server.MapPath("/PaymentDocument/" + GeneralFunctions.ReplaceTurkishChar(entity.FullName));

                    UpdateStudentEmailAndDeleteFolder(entity, savePathToFiles);


                    string fileName = savePathToFiles + "/" + GeneralFunctions.ReplaceTurkishChar(entity.FullName) +
                                      "_odemePlani_" + DateTime.Now.ToString("yyyyMMddhhmmss");


                    InitializeDocumentAndSave(entity, fileName);

                    try
                    {
                        sendMail(fileName, entity);
                        divInformation.SuccessfulText = "Mail gönderim işlemi başarıyla tamamlanmıştır";
                        divInformation.SetVisibleLink(true, false);
                        pnlBody.Enabled = false;
                    }
                    catch (Exception ex)
                    {
                        divInformation.ErrorText =
                            ex.Message + " - " + ex.InnerException + " - " + ex.StackTrace;
                        btnSendEmail.Enabled = true;
                    }
                }
            }
            catch (Exception exception)
            {
                divInformation.ErrorText =
                    exception.Message + " - " + exception.InnerException + " - " + exception.StackTrace;
                btnSendEmail.Enabled = true;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     int x = Convert.ToInt32(Request.QueryString["STDID"]);
     Response.Write(x);
     StudentEntity std = new StudentEntity();
     std.ID = x;
     StudentBusiness.DeleteStdBusiness(std.ID);
     Response.Redirect("StudentList.aspx");
 }
 public ActionResult Create(StudentViewModel student)
 {
     if (ModelState.IsValid)
     {
         var std = new StudentBusiness();
         std.Create(student);
     }
     return(RedirectToAction("Index"));
 }
        public AccountController()
        {
            RSMEntities db = new RSMEntities();

            AccBO   = new AccountBusiness(db);
            StaffBO = new StaffBusiness(db);
            InsBO   = new InstructorBusiness(db);
            StuBO   = new StudentBusiness(db);
        }
예제 #20
0
        private DataTable GetDataTableForOutput()
        {
            string name      = tb_AddName.Text.Trim();
            string school    = ddl_School.SelectedValue;
            string sex       = ddl_sex.SelectedValue;
            string startYear = input_start.Value;
            string endYear   = input_end.Value;

            return(StudentBusiness.GetStudentsAsDataTable(name, school, sex, startYear, endYear));
        }
 public ActionResult Edit(StudentViewModel s)
 {
     if (ModelState.IsValid)
     {
         var x = new StudentBusiness();
         x.Edit(s);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
예제 #22
0
        public void AddStudentTest()
        {
            var studentDto = new StudentDto
            {
                StudentId = "1"
            };

            StudentBusiness.AddStudent(studentDto);
            Assert.IsTrue(true);
        }
예제 #23
0
 public bool SaveStudent(Student student)
 {
     using (SCContext context = new SCContext(_contextName)) {
         IUnitOfWork     uow             = new UnitOfWork(context);
         StudentBusiness studentBusiness = new StudentBusiness(uow);
         bool            saved           = studentBusiness.SaveStudent(student);
         uow.SaveChanges();
         return(saved);
     }
 }
예제 #24
0
        public RatingsForm()
        {
            InitializeComponent();
            IRatingRepository  ratingRepository  = new RatingRepository();
            IStudentRepository studentRepository = new StudentRepository();
            ICourseRepository  courseRepository  = new CourseRepository();

            this.ratingBusiness  = new RatingBusiness(ratingRepository);
            this.studentBusiness = new StudentBusiness(studentRepository);
            this.courseBusiness  = new CourseBusiness(courseRepository);
        }
예제 #25
0
        public StudentController()
        {
            RSMEntities db = new RSMEntities();

            slFactory = new SelectListFactory(db);
            ClassBO   = new ClassBusiness(db);
            StuBO     = new StudentBusiness(db);
            AccBO     = new AccountBusiness(db);
            RollBO    = new RollCallBusiness(db);
            ReBO      = new RequestBusiness(db);
        }
예제 #26
0
        public void EditStudentTest()
        {
            var studentDto = new StudentDto
            {
                StudentId = "1",
                Name      = "Neptune"
            };

            StudentBusiness.EditStudent(studentDto);
            Assert.IsTrue(true);
        }
예제 #27
0
        public AdminController()
        {
            RSMEntities db = new RSMEntities();

            StuBO     = new StudentBusiness(db);
            ClaBO     = new ClassBusiness(db);
            ReBO      = new RequestBusiness(db);
            SlFactory = new SelectListFactory(db);
            StaffBO   = new StaffBusiness(db);
            AccBO     = new AccountBusiness(db);
            StuImBO   = new StudentImageBusiness(db);
        }
 public ActionResult Delete(Student model)
 {
     try
     {
         StudentBusiness.Delete(model);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #29
0
 public bool DeleteStudent(long id)
 {
     using (SCContext context = new SCContext(_contextName)) {
         IUnitOfWork     uow             = new UnitOfWork(context);
         StudentBusiness studentBusiness = new StudentBusiness(uow);
         bool            saved           = studentBusiness.SaveStudent(new Student {
             StudentID = id, EntityState = EntityState.Deleted
         });
         uow.SaveChanges();
         return(saved);
     }
 }
예제 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.studentBusiness = new StudentBusiness();

            List <Student> all = this.studentBusiness.GetStudents();

            ListBoxStudents.Items.Clear();

            foreach (Student s in all)
            {
                ListBoxStudents.Items.Add(s.Id + " - " + s.Name + " - " + s.IndexNumber + " - " + s.AverageMark);
            }
        }