Example #1
0
        private void BindSubCategoriesGrid()
        {
            try
            {
                var blCategories    = new BLCategories();
                var dtAllCategories = blCategories.LoadSubCategories(1, "DEMO");

                if (dtAllCategories != null)
                {
                    //LoadParentSubCategories(dtAllCategories);

                    gvSubCategory.Visible    = true;
                    gvSubCategory.DataSource = dtAllCategories;
                    gvSubCategory.DataBind();
                    ViewState["SubCategories"] = dtAllCategories;
                }
                else
                {
                    gvSubCategory.Visible    = false;
                    gvSubCategory.DataSource = null;
                    gvSubCategory.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        private void LoadDetails(string studentId)
        {
            try
            {
                var blStudents = new BLCategories();
                var students   = blStudents.LoadStudents(1, "DEMO");

                if (students != null && students.Count > 0)
                {
                    var student = students.FirstOrDefault(s => s.AdmissionId == studentId);
                    if (student != null)
                    {
                        lblstudent.Text    = student.FirstName + "." + student.SurName;
                        lblsection.Text    = student.ClassName + ", " + student.SectionName;
                        lbladmission.Text  = student.AdmissionId;
                        lbldob.Text        = student.DOB;
                        lbladdress.Text    = student.ResAddress;
                        lblmob.Text        = student.TeleNumber;
                        lbltel.Text        = student.TeleNumber;
                        lblfathername.Text = student.FatherName;
                        lblmothername.Text = student.MotherName;
                    }
                }
                else
                {
                    lblMsg.Text = "Student data is not available.";
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        private void LoadDetails(string studentId)
        {
            try
            {
                var blStudents = new BLCategories();
                var students = blStudents.LoadStudents(1, "DEMO");

                if (students != null && students.Count > 0)
                {
                    var student = students.FirstOrDefault(s => s.AdmissionId == studentId);
                    if (student != null)
                    {
                        lblstudent.Text = student.FirstName + "." + student.SurName;
                        lblsection.Text = student.ClassName + ", " + student.SectionName;
                        lbladmission.Text = student.AdmissionId;
                        lbldob.Text = student.DOB;
                        lbladdress.Text = student.ResAddress;
                        lblmob.Text = student.TeleNumber;
                        lbltel.Text = student.TeleNumber;
                        lblfathername.Text = student.FatherName;
                        lblmothername.Text = student.MotherName;
                    }
                }
                else
                {
                    lblMsg.Text = "Student data is not available.";
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #4
0
        private void LoadDropDowns()
        {
            try
            {
                drpAge.Items.Insert(0, new ListItem("Select", "0"));
                for (int i = 18; i <= 60; i++)
                {
                    drpAge.Items.Add(new ListItem(i.ToString(), i.ToString()));
                }

                var blCategories  = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null)
                {
                    return;
                }

                var sections = subCategories.Where(sb => sb.CategoryCode != null && sb.CategoryCode.ToUpper() == "DEPT").ToList();
                if (sections != null)
                {
                    drpSelectDepartment.DataSource = sections;
                    drpSelectDepartment.DataBind();
                    drpSelectDepartment.DataTextField  = "SubCategoryName";
                    drpSelectDepartment.DataValueField = "SubCategoryId";
                    drpSelectDepartment.DataBind();

                    drpSelectDepartment.Items.Insert(0, new ListItem("Select", "0"));
                }

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null &&
                                                           sb.CategoryCode.ToUpper() == "SEQ").ToList();
                if (admissionClasses != null)
                {
                    drpSecurityQuestion.DataSource = admissionClasses;
                    drpSecurityQuestion.DataBind();
                    drpSecurityQuestion.DataTextField  = "SubCategoryName";
                    drpSecurityQuestion.DataValueField = "SubCategoryId";
                    drpSecurityQuestion.DataBind();

                    drpSecurityQuestion.Items.Insert(0, new ListItem("Select", "0"));
                }
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #5
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories = new BLCategories();
                var students     = blCategories.LoadStudents(1, "DEMO");
                ViewState["students"] = students;

                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null)
                {
                    return;
                }

                var sections = subCategories.Where(sb => sb.CategoryCode != null && sb.CategoryCode.ToUpper() == "SEC").ToList();
                if (sections != null)
                {
                    drpSection.DataSource = sections;
                    drpSection.DataBind();
                    drpSection.DataTextField  = "SubCategoryName";
                    drpSection.DataValueField = "SubCategoryId";
                    drpSection.DataBind();
                }
                drpSection.Items.Insert(0, new ListItem("Select", "0"));

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null &&
                                                           sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (admissionClasses != null)
                {
                    drpClass.DataSource = admissionClasses;
                    drpClass.DataBind();
                    drpClass.DataTextField  = "SubCategoryName";
                    drpClass.DataValueField = "SubCategoryId";
                    drpClass.DataBind();
                }
                drpClass.Items.Insert(0, new ListItem("Select", "0"));
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var blCategories  = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null)
                {
                    return;
                }

                var classes = subCategories.Where(sb => sb.CategoryCode != null &&
                                                  sb.CategoryCode.ToUpper() == "TERM").ToList();

                if (classes != null)
                {
                    AddControls(classes);
                }
            }
        }
Example #7
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories  = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null)
                {
                    return;
                }

                var sections = subCategories.Where(sb => sb.SubCategoryCode != null && sb.SubCategoryCode.ToUpper() == "EXAMTYPE").ToList();
                if (sections != null)
                {
                    drpExamType.DataSource = sections;
                    drpExamType.DataBind();
                    drpExamType.DataTextField  = "SubCategoryName";
                    drpExamType.DataValueField = "SubCategoryId";
                    drpExamType.DataBind();

                    drpExamType.Items.Insert(0, new ListItem("Select", "0"));
                }

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null &&
                                                           sb.CategoryCode.ToUpper() == "GRADE").ToList();
                if (admissionClasses != null)
                {
                    drpGrade.DataSource = admissionClasses;
                    drpGrade.DataBind();
                    drpGrade.DataTextField  = "SubCategoryName";
                    drpGrade.DataValueField = "SubCategoryId";
                    drpGrade.DataBind();

                    drpGrade.Items.Insert(0, new ListItem("Select", "0"));
                }
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #8
0
        private void LoadCategories()
        {
            try
            {
                var blCategories = new BLCategories();
                var dtCategories = blCategories.LoadCategories(1, "DEMO");

                if (dtCategories != null)
                {
                    drpcategoryID.DataSource = dtCategories;
                    drpcategoryID.DataBind();
                    drpcategoryID.DataTextField  = "CategoryName";
                    drpcategoryID.DataValueField = "Id";
                    drpcategoryID.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #9
0
        private void LoadDropDowns()
        {
            var blCategories  = new BLCategories();
            var subCategories = blCategories.LoadSubCategories(1, "DEMO");

            if (subCategories == null)
            {
                return;
            }

            var classes = subCategories.Where(sb => sb.CategoryCode != null &&
                                              sb.CategoryCode.ToUpper() == "CLS").ToList();

            if (classes != null)
            {
                drpclass.DataSource = classes;
                drpclass.DataBind();
                drpclass.DataTextField  = "SubCategoryName";
                drpclass.DataValueField = "SubCategoryId";
                drpclass.DataBind();
            }
            drpclass.Items.Insert(0, new ListItem("Select", "0"));
        }
Example #10
0
        private void BindUsers()
        {
            try
            {
                var blStudents  = new BLCategories();
                var dtStuidents = blStudents.LoadUsers(1, "DEMO");

                if (dtStuidents != null)
                {
                    gvGradeSystem.Visible    = true;
                    gvGradeSystem.DataSource = dtStuidents;
                    gvGradeSystem.DataBind();
                    ViewState["users"] = dtStuidents;
                }
                else
                {
                    gvGradeSystem.Visible = false;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #11
0
        private void BindCategoriesGrid()
        {
            try
            {
                var blCategories = new BLCategories();
                var dtCategories = blCategories.LoadCategories(1, "DEMO");

                if (dtCategories != null)
                {
                    gvCategory.Visible    = true;
                    gvCategory.DataSource = dtCategories;
                    gvCategory.DataBind();
                    ViewState["Categories"] = dtCategories;
                }
                else
                {
                    gvCategory.Visible = false;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #12
0
        private void LoadDropDowns()
        {
            try
            {
                drpAge.Items.Insert(0, new ListItem("Select", "0"));
                for (int i = 18; i <= 60; i++)
                {
                    drpAge.Items.Add(new ListItem(i.ToString(), i.ToString()));
                }

                var blCategories = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null) return;

                var sections = subCategories.Where(sb => sb.CategoryCode != null && sb.CategoryCode.ToUpper() == "DEPT").ToList();
                if (sections != null)
                {
                    drpSelectDepartment.DataSource = sections;
                    drpSelectDepartment.DataBind();
                    drpSelectDepartment.DataTextField = "SubCategoryName";
                    drpSelectDepartment.DataValueField = "SubCategoryId";
                    drpSelectDepartment.DataBind();

                    drpSelectDepartment.Items.Insert(0, new ListItem("Select", "0"));
                }

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "SEQ").ToList();
                if (admissionClasses != null)
                {
                    drpSecurityQuestion.DataSource = admissionClasses;
                    drpSecurityQuestion.DataBind();
                    drpSecurityQuestion.DataTextField = "SubCategoryName";
                    drpSecurityQuestion.DataValueField = "SubCategoryId";
                    drpSecurityQuestion.DataBind();

                    drpSecurityQuestion.Items.Insert(0, new ListItem("Select", "0"));
                }
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #13
0
        private void LoadCategories()
        {
            try
            {
                var blCategories = new BLCategories();
                var dtCategories = blCategories.LoadCategories(1, "DEMO");

                if (dtCategories != null)
                {
                    drpcategoryID.DataSource = dtCategories;
                    drpcategoryID.DataBind();
                    drpcategoryID.DataTextField = "CategoryName";
                    drpcategoryID.DataValueField = "Id";
                    drpcategoryID.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #14
0
        private void BindSubCategoriesGrid()
        {
            try
            {
                var blCategories = new BLCategories();
                var dtAllCategories = blCategories.LoadSubCategories(1, "DEMO");

                if (dtAllCategories != null)
                {
                    //LoadParentSubCategories(dtAllCategories);

                    gvSubCategory.Visible = true;
                    gvSubCategory.DataSource = dtAllCategories;
                    gvSubCategory.DataBind();
                    ViewState["SubCategories"] = dtAllCategories;
                }
                else
                {
                    gvSubCategory.Visible = false;
                    gvSubCategory.DataSource = null;
                    gvSubCategory.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #15
0
        private void BindCategoriesGrid()
        {
            try
            {
                var blCategories = new BLCategories();
                var dtCategories = blCategories.LoadCategories(1, "DEMO");

                if (dtCategories != null)
                {
                    gvCategory.Visible = true;
                    gvCategory.DataSource = dtCategories;
                    gvCategory.DataBind();
                    ViewState["Categories"] = dtCategories;
                }
                else
                {
                    gvCategory.Visible = false;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #16
0
        private void LoadDropDowns()
        {
            try
            {

                var blCategories = new BLCategories();
                var students = blCategories.LoadStudents(1, "DEMO");
                ViewState["students"] = students;

                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null) return;

                var sections = subCategories.Where(sb => sb.CategoryCode != null && sb.CategoryCode.ToUpper() == "SEC").ToList();
                if (sections != null)
                {
                    drpSection.DataSource = sections;
                    drpSection.DataBind();
                    drpSection.DataTextField = "SubCategoryName";
                    drpSection.DataValueField = "SubCategoryId";
                    drpSection.DataBind();
                }
                drpSection.Items.Insert(0, new ListItem("Select", "0"));

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (admissionClasses != null)
                {
                    drpClass.DataSource = admissionClasses;
                    drpClass.DataBind();
                    drpClass.DataTextField = "SubCategoryName";
                    drpClass.DataValueField = "SubCategoryId";
                    drpClass.DataBind();
                }
                drpClass.Items.Insert(0, new ListItem("Select", "0"));

            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #17
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories  = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null)
                {
                    return;
                }

                var classes = subCategories.Where(sb => sb.CategoryCode != null &&
                                                  sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (classes != null)
                {
                    drpClass.DataSource = classes;
                    drpClass.DataBind();
                    drpClass.DataTextField  = "SubCategoryName";
                    drpClass.DataValueField = "SubCategoryId";
                    drpClass.DataBind();
                }
                drpClass.Items.Insert(0, new ListItem("Select", "0"));
                drpRegNo.Items.Insert(0, new ListItem("Select", "0"));

                var sections = subCategories.Where(sb => sb.CategoryCode != null &&
                                                   sb.CategoryCode.ToUpper() == "SEC").ToList();
                if (sections != null)
                {
                    drpSection.DataSource = sections;
                    drpSection.DataBind();
                    drpSection.DataTextField  = "SubCategoryName";
                    drpSection.DataValueField = "SubCategoryId";
                    drpSection.DataBind();
                }
                drpSection.Items.Insert(0, new ListItem("Select", "0"));

                var examTypes = subCategories.Where(sb => sb.CategoryCode != null &&
                                                    sb.CategoryCode.ToUpper() == "EXAMTYPE").ToList();
                if (examTypes != null)
                {
                    drpExamType.DataSource = examTypes;
                    drpExamType.DataBind();
                    drpExamType.DataTextField  = "SubCategoryName";
                    drpExamType.DataValueField = "SubCategoryId";
                    drpExamType.DataBind();
                }
                drpExamType.Items.Insert(0, new ListItem("Select", "0"));

                var absentSubjects = subCategories.Where(sb => sb.CategoryCode != null &&
                                                         sb.CategoryCode.ToUpper() == "SUBJECT").ToList();
                if (absentSubjects != null)
                {
                    lstAbsentSubjects.DataSource = absentSubjects;
                    lstAbsentSubjects.DataBind();
                    lstAbsentSubjects.DataTextField  = "SubCategoryName";
                    lstAbsentSubjects.DataValueField = "SubCategoryId";
                    lstAbsentSubjects.DataBind();
                }
                ViewState["subjects"] = absentSubjects;
                lstAbsentSubjects.Items.Insert(0, new ListItem("None", "0"));

                var studentsInfo = blCategories.LoadStudents(1, "DEMO");
                ViewState["students"] = studentsInfo;
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #18
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null) return;

                var sections = subCategories.Where(sb => sb.SubCategoryCode != null && sb.SubCategoryCode.ToUpper() == "EXAMTYPE").ToList();
                if (sections != null)
                {
                    drpExamType.DataSource = sections;
                    drpExamType.DataBind();
                    drpExamType.DataTextField = "SubCategoryName";
                    drpExamType.DataValueField = "SubCategoryId";
                    drpExamType.DataBind();

                    drpExamType.Items.Insert(0, new ListItem("Select", "0"));
                }

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "GRADE").ToList();
                if (admissionClasses != null)
                {
                    drpGrade.DataSource = admissionClasses;
                    drpGrade.DataBind();
                    drpGrade.DataTextField = "SubCategoryName";
                    drpGrade.DataValueField = "SubCategoryId";
                    drpGrade.DataBind();

                    drpGrade.Items.Insert(0, new ListItem("Select", "0"));
                }
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #19
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null) return;

                var termPlans = subCategories.Where(sb => sb.CategoryCode != null
                                    && sb.CategoryCode.ToUpper() == "TERM").ToList();
                if (termPlans != null)
                {
                    drpTerm.DataSource = termPlans;
                    drpTerm.DataBind();
                    drpTerm.DataTextField = "SubCategoryName";
                    drpTerm.DataValueField = "SubCategoryId";
                    drpTerm.DataBind();
                }
                drpTerm.Items.Insert(0, new ListItem("Select", "0"));

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (admissionClasses != null)
                {
                    drpClass.DataSource = admissionClasses;
                    drpClass.DataBind();
                    drpClass.DataTextField = "SubCategoryName";
                    drpClass.DataValueField = "SubCategoryId";
                    drpClass.DataBind();
                }
                drpClass.Items.Insert(0, new ListItem("Select", "0"));

                var subjects = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "SUBJECT").ToList();
                if (subjects != null)
                {
                    drpSubject.DataSource = subjects;
                    drpSubject.DataTextField = "SubCategoryName";
                    drpSubject.DataValueField = "SubCategoryId";
                    drpSubject.DataBind();
                }
                drpSubject.Items.Insert(0, new ListItem("Select", "0"));

                var months = subCategories.Where(sb => sb.CategoryCode != null
                            && sb.CategoryCode.ToUpper() == "MONTH").ToList();
                if (months != null)
                {
                    drpFrom.DataSource = months;
                    drpFrom.DataTextField = "SubCategoryName";
                    drpFrom.DataValueField = "SubCategoryId";
                    drpFrom.DataBind();

                    drpTo.DataSource = months;
                    drpTo.DataTextField = "SubCategoryName";
                    drpTo.DataValueField = "SubCategoryId";
                    drpTo.DataBind();

                    drpMonth.DataSource = months;
                    drpMonth.DataTextField = "SubCategoryName";
                    drpMonth.DataValueField = "SubCategoryId";
                    drpMonth.DataBind();
                }

                drpFrom.Items.Insert(0, new ListItem("Select", "0"));
                drpTo.Items.Insert(0, new ListItem("Select", "0"));
                drpMonth.Items.Insert(0, new ListItem("Select", "0"));
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #20
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null) return;

                var sections = subCategories.Where(sb => sb.CategoryCode != null && sb.CategoryCode.ToUpper() == "SEC").ToList();
                if (sections != null)
                {
                    drpSection.DataSource = sections;
                    drpSection.DataBind();
                    drpSection.DataTextField = "SubCategoryName";
                    drpSection.DataValueField = "SubCategoryId";
                    drpSection.DataBind();

                    drpSection.Items.Insert(0, new ListItem("Select", "0"));
                }

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (admissionClasses != null)
                {
                    drpAdmissiontoclass.DataSource = admissionClasses;
                    drpAdmissiontoclass.DataBind();
                    drpAdmissiontoclass.DataTextField = "SubCategoryName";
                    drpAdmissiontoclass.DataValueField = "SubCategoryId";
                    drpAdmissiontoclass.DataBind();

                    drpAdmissiontoclass.Items.Insert(0, new ListItem("Select", "0"));
                }

                var states = subCategories.Where(sb => sb.CategoryCode != null
                                           && sb.CategoryCode.ToUpper() == "STATE").ToList();
                if (states != null)
                {
                    drpState.DataSource = states;
                    drpState.DataBind();
                    drpState.DataTextField = "SubCategoryName";
                    drpState.DataValueField = "SubCategoryId";
                    drpState.DataBind();

                    drpState.Items.Insert(0, new ListItem("Select", "0"));
                }

                var cities = subCategories.Where(sb => sb.CategoryCode != null
                                           && sb.CategoryCode.ToUpper() == "CITY").ToList();
                if (cities != null)
                {
                    drpCity.DataSource = cities;
                    drpCity.DataBind();
                    drpCity.DataTextField = "SubCategoryName";
                    drpCity.DataValueField = "SubCategoryId";
                    drpCity.DataBind();

                    drpCity.Items.Insert(0, new ListItem("Select", "0"));
                }

                var districts = subCategories.Where(sb => sb.CategoryCode != null
                                           && sb.CategoryCode.ToUpper() == "DIST").ToList();
                if (districts != null)
                {
                    drpDistrict.DataSource = districts;
                    drpDistrict.DataBind();
                    drpDistrict.DataTextField = "SubCategoryName";
                    drpDistrict.DataValueField = "SubCategoryId";
                    drpDistrict.DataBind();

                    drpDistrict.Items.Insert(0, new ListItem("Select", "0"));
                }
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #21
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                var user = new BOUser();

                user.FirstName = txtFirstName.Text;
                user.LastName = txtLastName.Text;
                user.Age = drpAge.SelectedItem.Text;
                user.Gender = drpGender.SelectedItem.Text;
                //TODO
                if (txtDateOfBirth.Text.Trim().Length > 0)
                {
                    DateTime dob;
                    var isValid = DateTime.TryParse(txtDateOfBirth.Text.Trim(), out dob);
                    if (isValid)
                        user.DOB = dob.ToString();
                }

                user.ContactNo = txtContactNo.Text;
                user.Qualification = Convert.ToInt32(drpQualification.SelectedValue);
                user.Address = txtAddress.Text;
                user.Basic = txtBasic.Text;
                user.DA = txtDA.Text;
                user.HRA = txtHRA.Text;
                user.ProfTax = txtProfTax.Text;
                user.ConvAllowance = txtConveyanceAllowance.Text;
                user.CapitalCostAllow = txtCapitalCostAllowance.Text;
                user.EnterAllowance = txtEntertainmentAllowance.Text;
                user.NetSalary = txtNetSalary.Text;
                user.Department = Convert.ToInt32(drpSelectDepartment.SelectedValue);
                user.empid = txtEmpId.Text;
                user.userid = txtUserId.Text;
                user.password = txtCreatePassword.Text;
                user.SeqQuestion = Convert.ToInt32(drpSecurityQuestion.SelectedValue);
                user.Answer = txtAnswer.Text;
                // TODO
                if (txtDateOfJoin.Text.Trim().Length > 0)
                {
                    DateTime doj;
                    var isValid = DateTime.TryParse(txtDateOfJoin.Text.Trim(), out doj);
                    if (isValid)
                        user.DateOfJoin = doj.ToString();
                }

                user.CreatedBy = 1;
                user.ModifiedBy = 1;
                user.CreatedDate = DateTime.Now.ToString();

                var users = new BLCategories();
                string id = string.Empty;
                if (users.InsertUser(user, out id) == -1)
                {
                    lblErrorMsg.ForeColor = System.Drawing.Color.Green;
                    lblErrorMsg.Text = "user created successfully.";
                    BindUsers();
                    ResetControls();
                }
                else
                {
                    lblErrorMsg.ForeColor = System.Drawing.Color.Red;
                    lblErrorMsg.Text = "unable to save user";
                }
            }
            catch (Exception)
            {
            }
        }
Example #22
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories  = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null)
                {
                    return;
                }

                var termPlans = subCategories.Where(sb => sb.CategoryCode != null &&
                                                    sb.CategoryCode.ToUpper() == "TERM").ToList();
                if (termPlans != null)
                {
                    drpTerm.DataSource = termPlans;
                    drpTerm.DataBind();
                    drpTerm.DataTextField  = "SubCategoryName";
                    drpTerm.DataValueField = "SubCategoryId";
                    drpTerm.DataBind();
                }
                drpTerm.Items.Insert(0, new ListItem("Select", "0"));

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null &&
                                                           sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (admissionClasses != null)
                {
                    drpClass.DataSource = admissionClasses;
                    drpClass.DataBind();
                    drpClass.DataTextField  = "SubCategoryName";
                    drpClass.DataValueField = "SubCategoryId";
                    drpClass.DataBind();
                }
                drpClass.Items.Insert(0, new ListItem("Select", "0"));

                var subjects = subCategories.Where(sb => sb.CategoryCode != null &&
                                                   sb.CategoryCode.ToUpper() == "SUBJECT").ToList();
                if (subjects != null)
                {
                    drpSubject.DataSource     = subjects;
                    drpSubject.DataTextField  = "SubCategoryName";
                    drpSubject.DataValueField = "SubCategoryId";
                    drpSubject.DataBind();
                }
                drpSubject.Items.Insert(0, new ListItem("Select", "0"));

                var months = subCategories.Where(sb => sb.CategoryCode != null &&
                                                 sb.CategoryCode.ToUpper() == "MONTH").ToList();
                if (months != null)
                {
                    drpFrom.DataSource     = months;
                    drpFrom.DataTextField  = "SubCategoryName";
                    drpFrom.DataValueField = "SubCategoryId";
                    drpFrom.DataBind();

                    drpTo.DataSource     = months;
                    drpTo.DataTextField  = "SubCategoryName";
                    drpTo.DataValueField = "SubCategoryId";
                    drpTo.DataBind();

                    drpMonth.DataSource     = months;
                    drpMonth.DataTextField  = "SubCategoryName";
                    drpMonth.DataValueField = "SubCategoryId";
                    drpMonth.DataBind();
                }

                drpFrom.Items.Insert(0, new ListItem("Select", "0"));
                drpTo.Items.Insert(0, new ListItem("Select", "0"));
                drpMonth.Items.Insert(0, new ListItem("Select", "0"));
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #23
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories  = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null)
                {
                    return;
                }

                var sections = subCategories.Where(sb => sb.CategoryCode != null && sb.CategoryCode.ToUpper() == "SEC").ToList();
                if (sections != null)
                {
                    drpSection.DataSource = sections;
                    drpSection.DataBind();
                    drpSection.DataTextField  = "SubCategoryName";
                    drpSection.DataValueField = "SubCategoryId";
                    drpSection.DataBind();

                    drpSection.Items.Insert(0, new ListItem("Select", "0"));
                }

                var admissionClasses = subCategories.Where(sb => sb.CategoryCode != null &&
                                                           sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (admissionClasses != null)
                {
                    drpAdmissiontoclass.DataSource = admissionClasses;
                    drpAdmissiontoclass.DataBind();
                    drpAdmissiontoclass.DataTextField  = "SubCategoryName";
                    drpAdmissiontoclass.DataValueField = "SubCategoryId";
                    drpAdmissiontoclass.DataBind();

                    drpAdmissiontoclass.Items.Insert(0, new ListItem("Select", "0"));
                }

                var states = subCategories.Where(sb => sb.CategoryCode != null &&
                                                 sb.CategoryCode.ToUpper() == "STATE").ToList();
                if (states != null)
                {
                    drpState.DataSource = states;
                    drpState.DataBind();
                    drpState.DataTextField  = "SubCategoryName";
                    drpState.DataValueField = "SubCategoryId";
                    drpState.DataBind();

                    drpState.Items.Insert(0, new ListItem("Select", "0"));
                }

                var cities = subCategories.Where(sb => sb.CategoryCode != null &&
                                                 sb.CategoryCode.ToUpper() == "CITY").ToList();
                if (cities != null)
                {
                    drpCity.DataSource = cities;
                    drpCity.DataBind();
                    drpCity.DataTextField  = "SubCategoryName";
                    drpCity.DataValueField = "SubCategoryId";
                    drpCity.DataBind();

                    drpCity.Items.Insert(0, new ListItem("Select", "0"));
                }

                var districts = subCategories.Where(sb => sb.CategoryCode != null &&
                                                    sb.CategoryCode.ToUpper() == "DIST").ToList();
                if (districts != null)
                {
                    drpDistrict.DataSource = districts;
                    drpDistrict.DataBind();
                    drpDistrict.DataTextField  = "SubCategoryName";
                    drpDistrict.DataValueField = "SubCategoryId";
                    drpDistrict.DataBind();

                    drpDistrict.Items.Insert(0, new ListItem("Select", "0"));
                }
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #24
0
        private void LoadDropDowns()
        {
            var blCategories = new BLCategories();
            var subCategories = blCategories.LoadSubCategories(1, "DEMO");
            if (subCategories == null) return;

            var classes = subCategories.Where(sb => sb.CategoryCode != null
                                    && sb.CategoryCode.ToUpper() == "CLS").ToList();
            if (classes != null)
            {
                drpclass.DataSource = classes;
                drpclass.DataBind();
                drpclass.DataTextField = "SubCategoryName";
                drpclass.DataValueField = "SubCategoryId";
                drpclass.DataBind();
            }
            drpclass.Items.Insert(0, new ListItem("Select", "0"));
        }
Example #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var blCategories = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null) return;

                var classes = subCategories.Where(sb => sb.CategoryCode != null
                                        && sb.CategoryCode.ToUpper() == "TERM").ToList();

                if (classes != null)
                {
                    AddControls(classes);
                }

            }
        }
Example #26
0
        private void LoadDropDowns()
        {
            try
            {
                var blCategories = new BLCategories();
                var subCategories = blCategories.LoadSubCategories(1, "DEMO");
                if (subCategories == null) return;

                var classes = subCategories.Where(sb => sb.CategoryCode != null
                                        && sb.CategoryCode.ToUpper() == "CLS").ToList();
                if (classes != null)
                {
                    drpClass.DataSource = classes;
                    drpClass.DataBind();
                    drpClass.DataTextField = "SubCategoryName";
                    drpClass.DataValueField = "SubCategoryId";
                    drpClass.DataBind();
                }
                drpClass.Items.Insert(0, new ListItem("Select", "0"));
                drpRegNo.Items.Insert(0, new ListItem("Select", "0"));

                var sections = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "SEC").ToList();
                if (sections != null)
                {
                    drpSection.DataSource = sections;
                    drpSection.DataBind();
                    drpSection.DataTextField = "SubCategoryName";
                    drpSection.DataValueField = "SubCategoryId";
                    drpSection.DataBind();
                }
                drpSection.Items.Insert(0, new ListItem("Select", "0"));

                var examTypes = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "EXAMTYPE").ToList();
                if (examTypes != null)
                {
                    drpExamType.DataSource = examTypes;
                    drpExamType.DataBind();
                    drpExamType.DataTextField = "SubCategoryName";
                    drpExamType.DataValueField = "SubCategoryId";
                    drpExamType.DataBind();
                }
                drpExamType.Items.Insert(0, new ListItem("Select", "0"));

                var absentSubjects = subCategories.Where(sb => sb.CategoryCode != null
                                            && sb.CategoryCode.ToUpper() == "SUBJECT").ToList();
                if (absentSubjects != null)
                {
                    lstAbsentSubjects.DataSource = absentSubjects;
                    lstAbsentSubjects.DataBind();
                    lstAbsentSubjects.DataTextField = "SubCategoryName";
                    lstAbsentSubjects.DataValueField = "SubCategoryId";
                    lstAbsentSubjects.DataBind();
                }
                ViewState["subjects"] = absentSubjects;
                lstAbsentSubjects.Items.Insert(0, new ListItem("None", "0"));

                var studentsInfo = blCategories.LoadStudents(1, "DEMO");
                ViewState["students"] = studentsInfo;
            }
            catch (Exception ex)
            {
                //lblErrorMsg.Text = "Unable to load data.";
            }
        }
Example #27
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                var user = new BOUser();

                user.FirstName = txtFirstName.Text;
                user.LastName  = txtLastName.Text;
                user.Age       = drpAge.SelectedItem.Text;
                user.Gender    = drpGender.SelectedItem.Text;
                //TODO
                if (txtDateOfBirth.Text.Trim().Length > 0)
                {
                    DateTime dob;
                    var      isValid = DateTime.TryParse(txtDateOfBirth.Text.Trim(), out dob);
                    if (isValid)
                    {
                        user.DOB = dob.ToString();
                    }
                }

                user.ContactNo        = txtContactNo.Text;
                user.Qualification    = Convert.ToInt32(drpQualification.SelectedValue);
                user.Address          = txtAddress.Text;
                user.Basic            = txtBasic.Text;
                user.DA               = txtDA.Text;
                user.HRA              = txtHRA.Text;
                user.ProfTax          = txtProfTax.Text;
                user.ConvAllowance    = txtConveyanceAllowance.Text;
                user.CapitalCostAllow = txtCapitalCostAllowance.Text;
                user.EnterAllowance   = txtEntertainmentAllowance.Text;
                user.NetSalary        = txtNetSalary.Text;
                user.Department       = Convert.ToInt32(drpSelectDepartment.SelectedValue);
                user.empid            = txtEmpId.Text;
                user.userid           = txtUserId.Text;
                user.password         = txtCreatePassword.Text;
                user.SeqQuestion      = Convert.ToInt32(drpSecurityQuestion.SelectedValue);
                user.Answer           = txtAnswer.Text;
                // TODO
                if (txtDateOfJoin.Text.Trim().Length > 0)
                {
                    DateTime doj;
                    var      isValid = DateTime.TryParse(txtDateOfJoin.Text.Trim(), out doj);
                    if (isValid)
                    {
                        user.DateOfJoin = doj.ToString();
                    }
                }

                user.CreatedBy   = 1;
                user.ModifiedBy  = 1;
                user.CreatedDate = DateTime.Now.ToString();

                var    users = new BLCategories();
                string id    = string.Empty;
                if (users.InsertUser(user, out id) == -1)
                {
                    lblErrorMsg.ForeColor = System.Drawing.Color.Green;
                    lblErrorMsg.Text      = "user created successfully.";
                    BindUsers();
                    ResetControls();
                }
                else
                {
                    lblErrorMsg.ForeColor = System.Drawing.Color.Red;
                    lblErrorMsg.Text      = "unable to save user";
                }
            }
            catch (Exception)
            {
            }
        }
Example #28
0
        private void BindUsers()
        {
            try
            {
                var blStudents = new BLCategories();
                var dtStuidents = blStudents.LoadUsers(1, "DEMO");

                if (dtStuidents != null)
                {
                    gvGradeSystem.Visible = true;
                    gvGradeSystem.DataSource = dtStuidents;
                    gvGradeSystem.DataBind();
                    ViewState["users"] = dtStuidents;
                }
                else
                {
                    gvGradeSystem.Visible = false;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }