예제 #1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Employee_Details, clsFormRights.Operation.Delete) || clsUtility.IsAdmin)
     {
         DialogResult d = MessageBox.Show("Are you sure want to delete '" + txtName.Text + "' ? ", clsUtility.strProjectTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (d == DialogResult.Yes)
         {
             if (ObjDAL.DeleteData(clsUtility.DBName + ".dbo.EmployeeDetails", "EmpID='" + EmployeeID + "'") > 0)
             {
                 clsUtility.ShowInfoMessage("'" + txtName.Text + "' Employee has been deleted.  ", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpEmployee.Enabled = false;
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete);
             }
             else
             {
                 clsUtility.ShowErrorMessage("Failed to delete the employee. ", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
예제 #2
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Store_Master, clsFormRights.Operation.Delete) || clsUtility.IsAdmin)
     {
         DialogResult d = MessageBox.Show("Are you sure want to delete '" + txtStoreName.Text + "' Store ", clsUtility.strProjectTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (d == DialogResult.Yes)
         {
             if (ObjDAL.DeleteData(clsUtility.DBName + ".dbo.StoreMaster", "StoreID=" + ID) > 0)
             {
                 clsUtility.ShowInfoMessage("'" + txtStoreName.Text + "' Store is deleted  ", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpStore.Enabled = false;
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete);
             }
             else
             {
                 clsUtility.ShowErrorMessage("'" + txtStoreName.Text + "' Store is not deleted  ", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
예제 #3
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.frmOtherSetting, clsFormRights.Operation.Delete) || clsUtility.IsAdmin)
     {
         DialogResult d = MessageBox.Show("Are you sure want to delete '" + cmbSelectPC.Text + "' Machine ", clsUtility.strProjectTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (d == DialogResult.Yes)
         {
             if (ObjDAL.DeleteData(clsUtility.DBName + ".dbo.tblPC_Store_Mapping", "PC_Store_ID = " + ID) > 0)
             {
                 clsUtility.ShowInfoMessage("'" + cmbSelectPC.Text + "' Machine has been deleted  ", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 groupBox1.Enabled = false;
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete);
             }
             else
             {
                 clsUtility.ShowErrorMessage("'" + cmbSelectPC.Text + "' Machine is not deleted  ", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
예제 #4
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Purchase_Invoice, clsFormRights.Operation.Delete) || clsUtility.IsAdmin)
     {
         DialogResult d = MessageBox.Show("Are you sure want to delete Supplier Bill No. '" + txtSupplierBillNo.Text + "'", clsUtility.strProjectTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (d == DialogResult.Yes)
         {
             if (ObjDAL.DeleteData(clsUtility.DBName + ".dbo.PurchaseInvoice", "PurchaseInvoiceID=" + ID + "") > 0)
             {
                 clsUtility.ShowInfoMessage("Supplier Bill No. '" + txtSupplierBillNo.Text + "' is deleted", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpPurchaseInvoice.Enabled = false;
                 //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete, clsUtility.IsAdmin);
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete);
             }
             else
             {
                 clsUtility.ShowInfoMessage("Supplier Bill No. '" + txtSupplierBillNo.Text + "' is not deleted", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Currency_Value_Settings, clsFormRights.Operation.Delete) || clsUtility.IsAdmin)
     {
         DialogResult d = MessageBox.Show("Are you sure want to delete?", clsUtility.strProjectTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (d == DialogResult.Yes)
         {
             if (ObjDAL.DeleteData(clsUtility.DBName + ".dbo.CurrencyRateSetting", "CurrencyRateID=" + ID) > 0)
             {
                 clsUtility.ShowInfoMessage("Currency Rate for '" + cmbCountry.Text + "' is Deleted  ", clsUtility.strProjectTitle);
                 ClearAll();
                 LoadData();
                 grpCurrencyValue.Enabled = false;
                 ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete, clsUtility.IsAdmin);
             }
             else
             {
                 clsUtility.ShowErrorMessage("Currency Rate for '" + cmbCountry.Text + "' is not Deleted  ", clsUtility.strProjectTitle);
                 ObjDAL.ResetData();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
예제 #6
0
        private void UserDeleted()
        {
            bool b = clsUtility.ShowQuestionMessage("Are you sure want to delete '" + txtUserName.Text + "' user ");

            if (b)
            {
                if (ObjDAL.DeleteData(DBName + ".dbo.UserManagement", "UserID=" + ID) > 0)
                {
                    clsUtility.ShowInfoMessage("'" + txtUserName.Text + "' user is deleted  ", clsUtility.strProjectTitle);
                    ClearAll();
                    LoadData();
                    EnableDisable(false);
                    ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete, admin);
                }
                else
                {
                    clsUtility.ShowErrorMessage("'" + txtUserName.Text + "' user is not deleted  ", clsUtility.strProjectTitle);
                    ObjDAL.ResetData();
                }
            }
        }
예제 #7
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            DialogResult d = MessageBox.Show("Are you sure want to delete '" + txtCategoryName.Text + "' Category ", clsUtility.strProjectTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (d == DialogResult.Yes)
            {
                if (ObjDAL.DeleteData(clsUtility.DBName + ".dbo.CategoryMaster", "CategoryName='" + txtCategoryName.Text.Trim() + "'") > 0)
                {
                    clsUtility.ShowInfoMessage("'" + txtCategoryName.Text + "' Category is deleted  ", clsUtility.strProjectTitle);
                    ClearAll();
                    LoadData();
                    grpCategory.Enabled = false;
                    //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete, clsUtility.IsAdmin);
                    ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterDelete);
                }
                else
                {
                    clsUtility.ShowErrorMessage("'" + txtCategoryName.Text + "' Category is not deleted  ", clsUtility.strProjectTitle);
                    ObjDAL.ResetData();
                }
            }
        }