Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if (CurrentSchedule != 0)
                {
                    //BindData();
                    DBLayer db = new DBLayer();
                    DataSet ds = new DataSet();
                    ds = db.GetSchedule(CurrentSchedule);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        uiDropDownListSection.SelectedValue = ds.Tables[0].Rows[0]["SectionID"].ToString();
                        uiTextBoxArDetails.Text = ds.Tables[0].Rows[0]["ARDetails"].ToString();
                        uiTextBoxEnDetails.Text = ds.Tables[0].Rows[0]["ENDetails"].ToString();
                    }
                    uiPanelCurrentSchedule.Visible = false;
                    uiPanelCurrent.Visible = true;
                }
                else
                {
                    uiPanelCurrentSchedule.Visible = true;
                    uiPanelCurrent.Visible = false;
                    LoadDDLs();
                    BindData();
                }
            }
        }
Пример #2
0
 protected void uiGridViewSchedule_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditSchedule")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentSchedule = id;
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetSchedule(id);
         if (ds.Tables[0].Rows.Count > 0)
         {
             uiDropDownListSection.SelectedValue = ds.Tables[0].Rows[0]["SectionID"].ToString();
             uiTextBoxArDetails.Text = ds.Tables[0].Rows[0]["ARDetails"].ToString();
             uiTextBoxEnDetails.Text = ds.Tables[0].Rows[0]["ENDetails"].ToString();
         }
         uiPanelCurrentSchedule.Visible = false;
         uiPanelCurrent.Visible = true;
     }
     else if (e.CommandName == "DeleteSchedule")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentSchedule = id;
         DBLayer db = new DBLayer();
         db.DeleteSchedule(id);
         uiPanelCurrentSchedule.Visible = true;
         uiPanelCurrent.Visible = false;
         BindData();
     }
 }