Esempio n. 1
0
 protected void GetSelectedDetails()
 {
     try
     {
         BECourseAdmin objBECourseAdmin = new BECourseAdmin();
         BCourseAdmin  objBCourseAdmin  = new BCourseAdmin();
         objBECourseAdmin.IntCourseID = Convert.ToInt32(Request.QueryString["CourseID"].ToString());
         objBCourseAdmin.BGetSelectedCourseDetails(objBECourseAdmin);
         if (objBECourseAdmin.DtResult != null && objBECourseAdmin.DtResult.Rows.Count > 0)
         {
             lblCourseID.Text   = objBECourseAdmin.DtResult.Rows[0]["Course_ID"].ToString();
             lblCourseName.Text = objBECourseAdmin.DtResult.Rows[0]["CourseName"].ToString();
         }
     }
     catch (Exception Ex)
     {
         ErrorHandlers.ErrorLog.WriteError(Ex);
     }
 }
        //private void GetSelectedCourseDetails()
        //{
        //    try
        //    {
        //        BECourseAdmin objBECourseAdmin = new BECourseAdmin();
        //        BCourseAdmin objCourseAdmin = new BCourseAdmin();
        //        objBECourseAdmin.IntCourseID = Convert.ToInt32(Request.QueryString["CourseID"].ToString());
        //        objCourseAdmin.BGetSelectedCourseDetails(objBECourseAdmin);


        //        if (objBECourseAdmin.DsResult.Tables[0] != null && objBECourseAdmin.DsResult.Tables[0].Rows.Count > 0)
        //        {
        //            if (!Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["courseadmin"]))
        //            {
        //                TxtCourseID.ReadOnly = Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["Courseid"]);
        //                if (Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["Courseid"]))
        //                {
        //                    TxtCourseID.CssClass = "readonly";
        //                    RequiredFieldValidator1.Enabled = false;
        //                }

        //                txtCourseName.ReadOnly = Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["CourseName"]);
        //                if (Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["CourseName"]))
        //                {
        //                    txtCourseName.CssClass = "readonly";
        //                    RequiredFieldValidator2.Enabled = false;
        //                }
        //            }
        //        }


        //        if (objBECourseAdmin.DsResult.Tables[1] != null && objBECourseAdmin.DsResult.Tables[1].Rows.Count > 0)
        //        {
        //            TxtCourseID.Text = objBECourseAdmin.DsResult.Tables[1].Rows[0]["Course_ID"].ToString();
        //            txtCourseName.Text = objBECourseAdmin.DsResult.Tables[1].Rows[0]["CourseName"].ToString();
        //            ddlStatus.Items.FindItemByText(objBECourseAdmin.DsResult.Tables[1].Rows[0]["Status"].ToString()).Selected = true;
        //            lblCreatedDate.Text = objBECourseAdmin.DsResult.Tables[1].Rows[0]["CreatedDate"].ToString();
        //            lblCreatedDate1.Text = objBECourseAdmin.DsResult.Tables[1].Rows[0]["CreatedDate"].ToString();
        //            lblModifiedDate.Text = objBECourseAdmin.DsResult.Tables[1].Rows[0]["ModifiedDate"].ToString();
        //        }
        //    }
        //    catch (Exception Ex)
        //    {
        //        ErrorHandlers.ErrorLog.WriteError(Ex);
        //    }
        //}

        private void GetSelectedCourseDetails()
        {
            try
            {
                BECourseAdmin objBECourseAdmin = new BECourseAdmin();
                BCourseAdmin  objCourseAdmin   = new BCourseAdmin();
                objBECourseAdmin.IntCourseID = Convert.ToInt32(Request.QueryString["CourseID"].ToString());
                objCourseAdmin.BGetSelectedCourseDetails(objBECourseAdmin);


                //if (objBECourseAdmin.DsResult.Tables[0] != null && objBECourseAdmin.DsResult.Tables[0].Rows.Count > 0)
                //{
                //    if (!Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["courseadmin"]))
                //    {
                //        TxtCourseID.ReadOnly = Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["Courseid"]);
                //        if (Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["Courseid"]))
                //        {
                //            TxtCourseID.CssClass = "readonly";
                //            RequiredFieldValidator1.Enabled = false;
                //        }

                //        txtCourseName.ReadOnly = Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["CourseName"]);
                //        if (Convert.ToBoolean(objBECourseAdmin.DsResult.Tables[0].Rows[0]["CourseName"]))
                //        {
                //            txtCourseName.CssClass = "readonly";
                //            RequiredFieldValidator2.Enabled = false;
                //        }
                //    }
                //}


                if (objBECourseAdmin.DtResult != null && objBECourseAdmin.DtResult.Rows.Count > 0)
                {
                    TxtCourseID.Text   = objBECourseAdmin.DtResult.Rows[0]["Course_ID"].ToString();
                    txtCourseName.Text = objBECourseAdmin.DtResult.Rows[0]["CourseName"].ToString();
                    ddlStatus.Items.FindItemByText(objBECourseAdmin.DtResult.Rows[0]["Status"].ToString()).Selected = true;
                    lblCreatedDate.Text  = objBECourseAdmin.DtResult.Rows[0]["CreatedDate"].ToString();
                    lblCreatedDate1.Text = objBECourseAdmin.DtResult.Rows[0]["CreatedDate"].ToString();
                    lblModifiedDate.Text = objBECourseAdmin.DtResult.Rows[0]["ModifiedDate"].ToString();
                }


                BECommon objBECommon = new BECommon();
                BCommon  objBCommon  = new BCommon();
                objBECommon.iID = Convert.ToInt32(Request.QueryString["CourseID"].ToString());
                //to get course lms settings
                objBECommon.iTypeID = 2;

                objBCommon.BGetLMSSettings(objBECommon);

                if (objBECommon.DtResult != null && objBECommon.DtResult.Rows.Count > 0)
                {
                    if (!Convert.ToBoolean(objBECommon.DtResult.Rows[0]["courseadmin"]))
                    {
                        TxtCourseID.ReadOnly = Convert.ToBoolean(objBECommon.DtResult.Rows[0]["Courseid"]);
                        if (Convert.ToBoolean(objBECommon.DtResult.Rows[0]["Courseid"]))
                        {
                            TxtCourseID.CssClass            = "readonly";
                            RequiredFieldValidator1.Enabled = false;
                        }

                        txtCourseName.ReadOnly = Convert.ToBoolean(objBECommon.DtResult.Rows[0]["CourseName"]);
                        if (Convert.ToBoolean(objBECommon.DtResult.Rows[0]["CourseName"]))
                        {
                            txtCourseName.CssClass          = "readonly";
                            RequiredFieldValidator2.Enabled = false;
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                ErrorHandlers.ErrorLog.WriteError(Ex);
            }
        }