private void gvGafferList_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                if (e.Column.Caption == "Edit")
                {
                    Int64 nPartyID = 0;
                    var   row      = gvGafferList.GetFocusedDataRow();

                    nPartyID = Convert.ToInt64(row[1]);
                    frmMasterAddGaffer frmGaffer = new frmMasterAddGaffer(nPartyID);
                    frmGaffer.ShowDialog();
                    FillGafferMasterList();
                }
                if (e.Column.Caption == "Delete")
                {
                    var row = gvGafferList.GetFocusedDataRow();
                    int n   = Convert.ToString(gvGafferList.GetRowCellValue(e.RowHandle, "IsUsed")) == "" || Convert.ToString(gvGafferList.GetRowCellValue(e.RowHandle, "IsUsed")) == "0" ? 0 : 1;

                    if (n == 1)
                    {
                        return;
                    }
                    if (MessageBox.Show("Do you want to delete?", clsGlobal._sMessageboxCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                    clsGeneral oclsGeneral = new clsGeneral();
                    if (oclsGeneral.GetDeleteMasterType(MainMasterType.Gaffer.GetHashCode(), Convert.ToInt64(row[1])) > 0)
                    {
                        MessageBox.Show("Gaffer details deleted successfully.", clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    if (oclsGeneral != null)
                    {
                        oclsGeneral.Dispose();
                        oclsGeneral = null;
                    }
                    //clsMasters oclsMaster = new clsMasters();
                    //oclsMaster.nMasterID = Convert.ToInt64(row[1]);
                    //oclsMaster.MasterType = this.MasterType;
                    //oclsMaster.DeleteMaster();
                    FillGafferMasterList();
                }
            }
            catch (Exception ex)
            {
            }
        }
示例#2
0
        private void btnAddGafferMaster_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmMasterAddGaffer ofrmMasterAddGaffer = new frmMasterAddGaffer();

            ofrmMasterAddGaffer.ShowDialog();
        }