Пример #1
0
        protected void gvBoardDates_Sorting(object sender, GridViewSortEventArgs e)
        {
            SortExpression = e.SortExpression;
            DataTable dt = BoarddatesData.GetBoardDates();

            SortDireaction = CommonHelper.GridSorting(gvBoardDates, dt, SortExpression, SortDireaction);
        }
Пример #2
0
 protected void BindBoardDates()
 {
     try
     {
         gvBoardDates.DataSource = BoarddatesData.GetBoardDates();
         gvBoardDates.DataBind();
         txtBDate.Text = "";
         txtMType.Text = "";
     }
     catch (Exception ex)
     {
         lblErrorMsg.Text = ex.Message;
     }
 }
Пример #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime dt = Convert.ToDateTime(txtBDate.Text);
                BoarddatesData.AddBoardDate(txtMType.Text, dt);

                txtBDate.Text          = "";
                txtMType.Text          = "";
                gvBoardDates.PageIndex = 0;
                BindBoardDates();
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = ex.Message;
            }
        }
Пример #4
0
        protected void gvBoardDates_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                int      rowIndex = e.RowIndex;
                int      typeId   = Convert.ToInt32(((Label)gvBoardDates.Rows[rowIndex].FindControl("lblTypeId")).Text);
                string   mType    = ((TextBox)gvBoardDates.Rows[rowIndex].FindControl("txtMeetType")).Text;
                DateTime bDate    = Convert.ToDateTime(((TextBox)gvBoardDates.Rows[rowIndex].FindControl("txtBoardDate")).Text);

                BoarddatesData.UpdateBoardDates(mType, bDate, typeId);
                gvBoardDates.EditIndex = -1;
                BindBoardDates();
                lblErrorMsg.Text = "Board details updated successfully";
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text    = "Error updating the Board deatils: " + ex.Message;
                lblErrorMsg.Visible = true;
            }
        }
Пример #5
0
        protected void BindSortedGrid()
        {
            DataTable dt = BoarddatesData.GetBoardDates();

            SortDireaction = CommonHelper.GridSorting(gvBoardDates, dt, SortExpression, SortDireaction != "" ? ViewState["SortDireaction"].ToString() : SortDireaction);
        }