private void BindConrols()
        {
            _classType       = new ClassType();
            _classSection    = new ClassSection();
            _listClassType   = _classType.GetClassDetails();
            _listSectionType = _classSection.GetSectionDetails();

            if (_listClassType == null)
            {
                _listClassType = new List <ClassTypeModel>();
            }
            _listClassType.Add(new ClassTypeModel {
                ClassID = 0, ClassName = "Select"
            });
            ddlClass.DataSource    = _listClassType.OrderBy(x => x.ClassID).ToList();
            ddlClass.DisplayMember = "ClassName";
            ddlClass.ValueMember   = "ClassID";

            if (_listSectionType == null)
            {
                _listSectionType = new List <ClassSectionModel>();
            }
            _listSectionType.Add(new ClassSectionModel {
                ClassSectionID = 0, SectionName = "Select"
            });
            ddlSection.DataSource    = _listSectionType.OrderBy(x => x.ClassSectionID).ToList();
            ddlSection.DisplayMember = "SectionName";
            ddlSection.ValueMember   = "ClassSectionID";
        }
        private void Bind_DropDown_Controls()
        {
            classSection = new ClassSection();
            listSection  = classSection.GetSectionDetails();

            classType = new ClassType();
            listClass = classType.GetClassDetails();

            if (listSection != null)
            {
                listSection.Add(new ClassSectionModel {
                    ClassSectionID = 0, SectionName = "Select"
                });
                ddlSection.DataSource    = listSection.OrderBy(x => x.ClassSectionID).ToList();
                ddlSection.DisplayMember = "SectionName";
                ddlSection.ValueMember   = "ClassSectionID";
            }

            if (listClass != null)
            {
                listClass.Add(new ClassTypeModel {
                    ClassID = 0, ClassName = "Select", Active = true
                });
                ddlClass.DataSource    = listClass.OrderBy(x => x.ClassID).ToList();
                ddlClass.DisplayMember = "ClassName";
                ddlClass.ValueMember   = "ClassID";
            }
        }
Esempio n. 3
0
        private void BindDropDownControls()
        {
            fineSettings = new FineSettings();
            listFineType = fineSettings.GetFineType();

            classSection = new ClassSection();
            listSection  = classSection.GetSectionDetails();

            classType = new ClassType();
            listClass = classType.GetClassDetails();

            if (listSection != null)
            {
                listSection.Add(new ClassSectionModel {
                    ClassSectionID = 0, SectionName = "Select"
                });
                ddlCurrentSection.DataSource    = listSection.OrderBy(x => x.ClassSectionID).ToList();
                ddlCurrentSection.DisplayMember = "SectionName";
                ddlCurrentSection.ValueMember   = "ClassSectionID";
            }


            if (listFineType != null)
            {
                listFineType.Add(new FineTypeModel {
                    FineTypeID = 0, FineType = "Select"
                });
                ddlFeeType.DataSource    = listFineType.OrderBy(x => x.FineTypeID).ToList();
                ddlFeeType.DisplayMember = "FineType";
                ddlFeeType.ValueMember   = "FineTypeID";
            }

            if (listClass != null)
            {
                listClass.Add(new ClassTypeModel {
                    ClassID = 0, ClassName = "Select", Active = true
                });
                ddlCurrentClass.DataSource    = listClass.OrderBy(x => x.ClassID).ToList();
                ddlCurrentClass.DisplayMember = "ClassName";
                ddlCurrentClass.ValueMember   = "ClassID";
            }

            datePickerReport.Format       = DateTimePickerFormat.Custom;
            datePickerReport.Value        = DateTime.Now;
            datePickerReport.CustomFormat = "dd.MM.yyyy";
        }