private void UpdateStatus() { RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count > 0) { HBBLL hb = new HBBLL(); YPPT data = hb.GetYPPTByID(int.Parse(sm.SelectedRows[0].RecordID)); if (data.CreatePersonNumber == SessionBox.GetUserSession().PersonNumber) { btnDel.Disabled = false; btnDetail.Disabled = false; btnPlan.Disabled = false; } else { btnPlan.Disabled = true; btnDetail.Disabled = false; btnDel.Disabled = true; } } else { btnPlan.Disabled = true; btnDetail.Disabled = true; btnDel.Disabled = true; } }
private void UpdateStatus1() { RowSelectionModel sm = this.GridPanel2.SelectionModel.Primary as RowSelectionModel; HBBLL hb = new HBBLL(); var data = hb.GetYPPTByID(int.Parse(TID.Value.ToString())); if (data.CreatePersonNumber == SessionBox.GetUserSession().PersonNumber) { switch (sm.SelectedRows.Count) { case 0: btnPlaceUpdate.Disabled = true; btnPlaceDel.Disabled = true; btnDown.Disabled = true; btnUp.Disabled = true; break; case 1: btnPlaceUpdate.Disabled = false; btnPlaceDel.Disabled = false; btnDown.Disabled = false; btnUp.Disabled = false; break; default: btnPlaceUpdate.Disabled = true; btnPlaceDel.Disabled = false; btnDown.Disabled = true; btnUp.Disabled = true; break; } } else { btnPlaceAdd.Disabled = true; btnPlaceUpdate.Disabled = true; btnPlaceDel.Disabled = true; btnDown.Disabled = true; btnUp.Disabled = true; } }