Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ODS_TicSummary.Select();
         string strTicID = Request.QueryString["TicId"].ToString();
         lblTicID.Text = strTicID;
         BusinessObjects bo = new BusinessObjects();
         DataSet         ds = bo.GetStudTic_details(strTicID);
         if (ds.Tables[0].Rows.Count > 0)
         {
             lblTitle.Text = ds.Tables[0].Rows[0]["Ticket_Title"].ToString();
             //lblInst.Text = ds.Tables[0].Rows[0]["Instructor_ID"].ToString();
             ViewState["InstID"] = ds.Tables[0].Rows[0]["Instructor_ID"].ToString();
         }
         if (gv_TicSummary.Rows.Count == 0)
         {
             btnRespond.Visible = false;
         }
         else
         {
             btnRespond.Visible = true;
         }
         if (Request.QueryString["AllTics"] != null)
         {
             string strAllTics = Request.QueryString["AllTics"].ToString();
             if (strAllTics == "Yes")
             {
                 btnRespond.Visible = false;
             }
         }
         string strCurUser = Convert.ToString(Session["CurrentUser"]);
         if (strCurUser.ToUpper() == "ADMIN")
         {
             btnRespond.Visible = false;
             gv_TicSummary.Columns[4].Visible = true;
         }
         lblLoggedID.Text = strCurUser;
     }
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ODS_TicSummary.Select();
         string strTicID = Request.QueryString["TicId"].ToString();
         lblTicID.Text = strTicID;
         BusinessObjects bo            = new BusinessObjects();
         DataSet         ds            = bo.GetStudTic_details(strTicID);
         string          strViewStatus = "";
         string          strSubType    = "";
         if (ds.Tables[0].Rows.Count > 0)
         {
             lblTitle.Text = ds.Tables[0].Rows[0]["Ticket_Title"].ToString();
             //lblInst.Text = ds.Tables[0].Rows[0]["Instructor_ID"].ToString();
             ViewState["InstID"] = ds.Tables[0].Rows[0]["Instructor_ID"].ToString();
             // ViewState["ViewStatus"] = ds.Tables[0].Rows[0]["View_Status"].ToString();
             strViewStatus = ds.Tables[0].Rows[0]["View_Status"].ToString();
             //ViewState["SubType"] = ds.Tables[0].Rows[0]["Subject_Type"].ToString();
             strSubType = ds.Tables[0].Rows[0]["Subject_Type"].ToString();
         }
         string strRole = Convert.ToString(Session["Role"]);
         if (strRole.ToUpper() == "STUDENT")
         {
             lblViewStatus.Visible    = false;
             lblVS.Visible            = false;
             lnkSave1.Visible         = false;
             ddlTicViewStatus.Visible = false;
             lblSubType.Visible       = false;
             lblST.Visible            = false;
             lnkSave2.Visible         = false;
             ddlSubType.Visible       = false;
         }
         else
         {
             if (strViewStatus != null && strViewStatus != "")
             {
                 lblVS.Visible = true;
                 lblVS.Text    = strViewStatus;
                 lnkSave1.Text = "[Edit]";
                 ddlTicViewStatus.SelectedValue = strViewStatus;
                 ddlTicViewStatus.Visible       = false;
             }
             else
             {
                 lblVS.Visible                  = false;
                 lblVS.Text                     = "";
                 lnkSave1.Text                  = "[Save]";
                 ddlTicViewStatus.Visible       = true;
                 ddlTicViewStatus.SelectedValue = "Select";
             }
             if (strSubType != null && strSubType != "")
             {
                 lblST.Visible            = true;
                 lblST.Text               = strSubType;
                 lnkSave2.Text            = "[Edit]";
                 ddlSubType.SelectedValue = strSubType;
                 ddlSubType.Visible       = false;
             }
             else
             {
                 lblST.Visible            = false;
                 lblST.Text               = "";
                 lnkSave2.Text            = "[Save]";
                 ddlSubType.Visible       = true;
                 ddlSubType.SelectedValue = "Select";
             }
         }
         if (gv_TicSummary.Rows.Count == 0)
         {
             btnRespond.Visible = false;
         }
         else
         {
             btnRespond.Visible = true;
         }
         if (Request.QueryString["AllTics"] != null)
         {
             string strAllTics = Request.QueryString["AllTics"].ToString();
             if (strAllTics == "Yes")
             {
                 btnRespond.Visible = false;
             }
         }
         string strCurUser = Convert.ToString(Session["CurrentUser"]);
         if (strCurUser.ToUpper() == "ADMIN")
         {
             btnRespond.Visible = false;
             gv_TicSummary.Columns[4].Visible = true;
         }
         lblLoggedID.Text = strCurUser;
     }
 }