Пример #1
0
        private void SGView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            //int rowhandleva = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle);
            //m_oCountry.CountryName = cCName;//TransView.GetRowCellValue(rowhandleva, "CountryName").ToString();
            //if (TransView.IsNewItemRow(TransView.FocusedRowHandle) == true)
            //{
            //    int cId;
            //    cId = m_oCountry.InsertCountry(m_oCountry.CountryName);

            //    //TransView.SetRowCellValue(rowhandleva, "CountryId", cId);
            //    grdTrans.RefreshDataSource();
            //    //grdTrans.CurrentRow.Cells[0].Value = cId;
            //}
            //else
            //{
            //    m_oCountry.CountryId = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "CountryId"));
            //    m_oCountry.UpdateCountry(m_oCountry.CountryId, m_oCountry.CountryName);
            //}
            oService.m_oGroupName = SerName;
            if (SGView.IsNewItemRow(SGView.FocusedRowHandle) == true)
            {
                oService.InsertServiceGroup(oService.m_oGroupName);
            }
            else
            {
                oService.m_oGroupId = Convert.ToInt32(SGView.GetRowCellValue(SGView.FocusedRowHandle, "ServiceGroupId"));
                oService.UpdateServiceGroup(oService.m_oGroupId, oService.m_oGroupName);
            }
        }
Пример #2
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DialogResult reply = MessageBox.Show("Do you want Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (reply == DialogResult.Yes)
            {
                bool status = false;
                status = oService.DeleteServiceGroup(Convert.ToInt32(SGView.GetFocusedRowCellValue("ServiceGroupId")));
                if (status == false)
                {
                    MessageBox.Show("Already Used, Do Not Delete", "Vendor", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                PopulateGrid();
            }
        }