예제 #1
0
        private void getRMList()
        {
            DataTable dt = rmBLL.getAllRepairMen();

            ViewState["GridRMData"] = dt;
            GridRM.DataSource       = dt;
            GridRM.DataBind();
        }
예제 #2
0
        protected void btnQuery_Click(object sender, EventArgs e)
        {
            DataTable dt = rmBLL.getRMListByName(tbName.Text.Trim());

            ViewState["GridData"] = dt;
            GridRM.DataSource     = dt;
            GridRM.DataBind();
        }
예제 #3
0
        private void getGridData()
        {
            DataTable dt = rmBLL.getAllRepairMen(true);

            if (dt.Rows.Count > 0)
            {
                ViewState["GridData"] = dt;
                GridRM.DataSource     = dt;
                GridRM.DataBind();
            }
        }
예제 #4
0
 protected void GridRM_ItemCommand(object sender, GridCommandEventArgs e)
 {
     if (e.CommandName == "switchStatus")
     {
         GridDataItem gridItem     = e.Item as GridDataItem;
         int          rmID         = Convert.ToInt32(gridItem["repairmanID"].Text);
         int          deleteStatus = Convert.ToInt32(gridItem["deleteStatus"].Text);
         if (rmBLL.switchDeleteStatus(rmID, deleteStatus))
         {
             int       rowIndex = e.Item.ItemIndex + GridRM.CurrentPageIndex * GridRM.PageSize;
             DataTable dt       = ViewState["GridData"] as DataTable;
             dt.Rows[rowIndex]["deleteStatus"] = deleteStatus == 1 ? "0" : "1";
             ViewState["GridData"]             = dt;
         }
     }
     GridRM.Rebind();
 }