Пример #1
0
        private void FillBranch(string Uni_ID, string Inst_ID, string Fac_ID, string Cr_ID, string Molrn_ID, string Ptrn_ID)
        {
            ddlCrBrnDesc.Items.Clear();
            oDT = new System.Data.DataTable();
            try
            {
                if (hidInstID.Value != "")
                {
                    oDT = oInstituteRepository.AssignedConfirmedBranches(Uni_ID, Inst_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID);
                }
                else
                {
                    oDT = crRepository.ListCourseModeOfLearningPatternWiseLaunchedBranches(long.Parse(Uni_ID), long.Parse(Fac_ID), long.Parse(Cr_ID), long.Parse(Molrn_ID), long.Parse(Ptrn_ID));
                }

                if (oDT.Rows.Count > 0)
                {
                    Common = new clsCommon();
                    if (oDT.Rows.Count == 1)
                    {
                        if (Convert.ToString(oDT.Rows[0]["Text"]) == "No Branch")
                        {
                            ListItem li = new ListItem();
                            li.Text  = "No Branch Available";
                            li.Value = "0";
                            ddlCrBrnDesc.Items.Add(li);
                            FillCoursePart(Uni_ID, Inst_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID, "0");
                        }
                        else
                        {
                            Common.fillDropDown(ddlCrBrnDesc, oDT, "-1", "Text", "Value", "---- Select ----");
                        }
                    }
                    else
                    {
                        Common.fillDropDown(ddlCrBrnDesc, oDT, "-1", "Text", "Value", "---- Select ----");
                    }
                    if (Common != null)
                    {
                        Common = null;
                    }
                }
                else
                {
                    if (ddlCrDesc.SelectedIndex == 0)
                    {
                        ListItem li = new ListItem();
                        li.Text  = "---- Select ----";
                        li.Value = "-1";
                        ddlCrBrnDesc.Items.Add(li);
                    }
                    else
                    {
                        ListItem li = new ListItem();
                        li.Text  = "No Branch Available";
                        li.Value = "0";
                        ddlCrBrnDesc.Items.Add(li);
                    }
                }
            }
            catch (Exception e) { }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Uni_ID"></param>
        /// <param name="Fac_ID"></param>
        /// <param name="Cr_ID"></param>
        /// <param name="Molrn_ID"></param>
        /// <param name="Ptrn_ID"></param>
        private void FillBranch(long Uni_ID, string Inst_ID, long Fac_ID, long Cr_ID, long Molrn_ID, long Ptrn_ID)
        {
            DD_Branch.Items.Clear();
            DT = new DataTable();

            if (Inst_ID != string.Empty)
            {
                DT = oInst.AssignedConfirmedBranches(Convert.ToString(Uni_ID), Inst_ID, Convert.ToString(Fac_ID), Convert.ToString(Cr_ID), Convert.ToString(Molrn_ID), Convert.ToString(Ptrn_ID));
            }
            else
            {
                DT = oCr.ListCourseModeOfLearningPatternWiseLaunchedBranches(Uni_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID);
            }

            if (DT.Rows.Count > 0)
            {
                oCommon = new clsCommon();

                if (DT.Rows.Count == 1)
                {
                    if (Convert.ToString(DT.Rows[0]["Text"]).ToUpper() == "NO BRANCH")
                    {
                        ListItem li = new ListItem();
                        li.Text  = "No Branch Available";
                        li.Value = "0";
                        DD_Branch.Items.Add(li);
                        FillCoursePart(Uni_ID, pk_Institute_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID, 0);
                    }
                    else
                    {
                        oCommon.fillDropDown(DD_Branch, DT, "-1", "Text", "Value", "---- Select ----");
                    }
                }
                else
                {
                    oCommon.fillDropDown(DD_Branch, DT, "-1", "Text", "Value", "---- Select ----");
                }

                if (oCommon != null)
                {
                    oCommon = null;
                }
            }
            else
            {
                if (DD_Course.SelectedIndex == 0)
                {
                    ListItem li = new ListItem();
                    li.Text  = "---- Select ----";
                    li.Value = "-1";
                    DD_Branch.Items.Add(li);
                }
                else
                {
                    ListItem li = new ListItem();
                    li.Text  = "No Branch Available";
                    li.Value = "0";
                    DD_Branch.Items.Add(li);
                }
            }
        }
        public void FillFacultyWiseCourseCoursePart(string FacID, string CrID, string MoLrnID, string PtrnID, string BrnID, string CrPrDetailsID)
        {
            clsCommon common = new clsCommon();
            DataTable dt;

            ddlFaculty.Items.Clear();

            try
            {
                dt = InstRep.AssignedConfirmedFaculties(hidUniID.Value, hidInstID.Value);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            Common.fillDropDown(ddlFaculty, dt, FacID, "Fac_Desc", "pk_Fac_ID", "--- Select ---");
            ddlCourse.Items.Clear();

            try
            {
                dt = InstRep.AssignedConfirmedCourses(hidUniID.Value, hidInstID.Value, FacID);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            common.fillDropDown(ddlCourse, dt, CrID, "Cr_Desc", "pk_Cr_ID", "--- Select ---");
            ddlMoLrn.Items.Clear();

            try
            {
                dt = InstRep.AssignedConfirmedModeOfLearning(hidUniID.Value, hidInstID.Value, FacID, CrID);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            common.fillDropDown(ddlMoLrn, dt, MoLrnID, "MoLrn_Type", "pk_MoLrn_ID", "--- Select ---");
            ddlCrPtrn.Items.Clear();

            try
            {
                dt = InstRep.AssignedConfirmedCoursePatterns(hidUniID.Value, hidInstID.Value, FacID, CrID, MoLrnID);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            common.fillDropDown(ddlCrPtrn, dt, PtrnID, "text", "value", "--- Select ---");
            ddlBranch.Items.Clear();

            try
            {
                dt = InstRep.AssignedConfirmedBranches(hidUniID.Value, hidInstID.Value, FacID, CrID, MoLrnID, PtrnID);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            if (hidBranchName.Value == "No Branch")
            {
                ddlBranch.Items.Insert(0, "No Branch");
            }
            else
            {
                common.fillDropDown(ddlBranch, dt, BrnID, "Text", "Value", "--- Select ---");
            }

            dt.Dispose();
        }