Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FillItemType();
            string IsProgram_Scheduled = null;
            Session["vsAttachmentData"]     = null;
            Session["vsAttachmentFileName"] = null;
            DataTable dtChapterItemList = new DataTable();
            dtChapterItemList.Columns.Add("ChapterItemId", typeof(int));
            dtChapterItemList.PrimaryKey   = new DataColumn[] { dtChapterItemList.Columns["ChapterItemId"] };
            ViewState["dtChapterItemList"] = dtChapterItemList;
            ViewState["Chapter_Id"]        = Request.QueryString["Chapter_Id"];
            UserAccessValidation();
            BindChapterItem();
            BindTrainerlist();
            DataTable dt = BLL_LMS_Training.Get_ProgramDescriptionbyId(Convert.ToInt32(Request.QueryString["Program_Id"]));
            if (dt.Rows.Count > 0)
            {
                lblProgramName.Text = dt.Rows[0]["PROGRAM_Name"].ToString();
                IsProgram_Scheduled = dt.Rows[0]["Program_Scheduled"].ToString();
            }

            if (UDFLib.ConvertIntegerToNull(ViewState["Chapter_Id"]) != null)
            {
                txtChapterName.Text = BLL_LMS_Training.Get_ChapterDescriptionbyId(Convert.ToInt32(ViewState["Chapter_Id"]));
                btnDelete.Enabled   = true;
            }

            else
            {
                btnDelete.Enabled = false;
            }

            if (IsProgram_Scheduled == "Y")
            {
                txtChapterName.Enabled = false;
                btnDelete.Enabled      = false;
                // btnAddNewItem.Enabled=false;
                // gvItemList.Enabled =false;
                gvTrainerRank.Enabled = false;
                //btnsaveandclose.Enabled =false;
                //btnCancel.Enabled = false;
            }
            if (UDFLib.ConvertIntegerToNull(Request.QueryString["ProgramCategory"]) == 4)
            {
                gvTrainerRank.Enabled = false;
            }
        }
    }