Ejemplo n.º 1
0
        private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.FindPermission("Bank-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Bank-Delete");
                return;
            }

            int iBranchId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("BranchId"));

            if (BankBL.BankFound(iBranchId) == false)
            {
                if (MessageBox.Show("Do You want to Delete?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    BankBL.DeleteBankBranch(iBranchId);
                    DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                    //CommFun.InsertLog(DateTime.Now, "Bank Master-Delete", "D", "Delete Bank Master", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                    BsfGlobal.InsertLog(DateTime.Now, "Bank Master-Delete", "D", "Delete Bank Master", iBranchId, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                }
            }
            else
            {
                MessageBox.Show("Bank Details Used, Can't Delete Row", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
        }
Ejemplo n.º 2
0
 private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (BsfGlobal.FindPermission("Lead-Delete") == false)
     {
         MessageBox.Show("You don't have Rights to Lead-Delete");
         return;
     }
     try
     {
         if (DGvTransView.FocusedRowHandle >= 0)
         {
             if (Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("LeadId")) == 0)
             {
                 string sql = string.Empty;
                 sql = "DELETE FROM LeadRegister WHERE LeadId=" + Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("LeadId")) + " ";
                 CommFun.CRMExecute(sql);
                 DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                 //CommFun.InsertLog(DateTime.Now, "Lead Details-Delete", "D", "Delete Lead Details", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                 BsfGlobal.InsertLog(DateTime.Now, "Lead Details-Delete", "D", "Delete Lead Details", Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("LeadId")), 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
             }
             else
             {
                 MessageBox.Show("Already Converted Can't Delete", "CRM");
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
        private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.FindPermission("Tenant-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to TenantRegister-Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            try
            {
                if (DGvTransView.FocusedRowHandle >= 0)
                {
                    DataTable dtTen = new DataTable();

                    int    i_RegId  = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "TenantId"), CommFun.datatypes.vartypenumeric));
                    int    m_iCCId1 = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "CostCentreId"), CommFun.datatypes.vartypenumeric));
                    string Apv      = "";
                    string m_sIssNo = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RefNo"), CommFun.datatypes.vartypestring));
                    Apv = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "Approve"), CommFun.datatypes.vartypestring));
                    if (Apv == "Y")
                    {
                        MessageBox.Show("Already Approved, Do Not Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }
                    dtTen = TenantDetBL.CheckTenant(i_RegId);
                    if (dtTen.Rows.Count > 0)
                    {
                        MessageBox.Show("Do Not Delete. Tenant Already Used.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }
                    else
                    {
                        if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            if (TenantDetBL.DeleteTenantRegister(i_RegId, m_iCCId1, m_sIssNo) == true)
                            {
                                DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                            }
                            //CommFun.InsertLog(DateTime.Now, "TenantRegister-Delete", "D", "Delete TenantRegister", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Ejemplo n.º 4
0
 private void DGvTransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     if (DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "NatureComplaint").ToString() != string.Empty)
     {
         System.Data.DataRow dr = DGvTransView.GetDataRow(DGvTransView.FocusedRowHandle); //("Total");
         if (DGvTransView.GetFocusedRowCellValue("ComplaintId") == DBNull.Value)
         {
             if (CommFun.CheckData("Nature_Complaint", "NatureComplaint", DGvTransView.GetFocusedRowCellValue("NatureComplaint").ToString(), "Nature Of Complaint") == false)
             {
                 dr["NatureComplaint"]       = string.Empty;
                 DGvTransView.NewItemRowText = string.Empty;
                 DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
             }
         }
     }
 }
Ejemplo n.º 5
0
 private void tsDel_Click(object sender, EventArgs e)
 {
     if (DGvTransView.FocusedRowHandle >= 0)
     {
         if (DGvTransView.GetFocusedRowCellValue("ReminderId").ToString() == String.Empty)
         {
             //DGVTrans.Rows.RemoveAt(DGVTrans.CurrentRow.Index);
             DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
         }
         else
         {
             BL.Delete(Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("ReminderId")));
             //DGVTrans.Rows.RemoveAt(DGVTrans.CurrentRow.Index);
             DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
         }
     }
 }
Ejemplo n.º 6
0
 private void DGvTransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     //if (DGvTransView.Columns[e.ColumnIndex].Name == "ReminderName")
     if (DGvTransView.FocusedColumn.FieldName == "ReminderName")
     {
         if (DGvTransView.GetFocusedRowCellValue("ReminderName").ToString() != null)
         {
             if (DGvTransView.GetFocusedRowCellValue("ReminderName").ToString() != string.Empty)
             {
                 if (CommFun.CheckData("Reminder", "ReminderName", DGvTransView.GetFocusedRowCellValue("ReminderName").ToString(), "Reminder Name") == false)
                 {
                     //DGVTrans.Rows.Remove(DGVTrans.CurrentRow);
                     DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                     //DGVTrans.CurrentRow.Cells["LevelName"].Value = string.Empty;
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
        private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.FindPermission("CRM-ServiceBill-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Service Quote Bill-Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            try
            {
                int    i_RegId  = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RegBillId"), CommFun.datatypes.vartypenumeric));
                string m_sIssNo = "";
                int    m_iCCId1 = 0;
                string Apv      = "";
                m_iCCId1 = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "CostcentreID"), CommFun.datatypes.vartypenumeric));
                m_sIssNo = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "BillRefNo"), CommFun.datatypes.vartypestring));
                Apv      = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "Approve"), CommFun.datatypes.vartypestring));
                if (Apv == "Y")
                {
                    MessageBox.Show("Already Approved, Do Not Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }

                if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    if (ServiceOrderBillBL.DeleteSerOrderBillRegister(i_RegId, m_iCCId1, m_sIssNo) == true)
                    {
                        DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                    }
                    //CommFun.InsertLog(DateTime.Now, "Service Quote Bill-Delete", "D", "Delete Service Quote Bill Reg", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Ejemplo n.º 8
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.FindPermission("CRM-Maintenance-Bill-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to CRM-Maintenance-Bill-Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            try
            {
                int i_RegId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "MaintenanceId"), CommFun.datatypes.vartypenumeric));

                string m_sIssNo = "";
                int    m_iCCId1 = 0;
                string Apv      = "";
                m_iCCId1 = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "CostCentreId"), CommFun.datatypes.vartypenumeric));
                m_sIssNo = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RefNo"), CommFun.datatypes.vartypestring));
                Apv      = Convert.ToString(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "Approve"), CommFun.datatypes.vartypestring));
                if (Apv == "Y")
                {
                    MessageBox.Show("Already Approved, Do Not Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }
                if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    if (MaintenanceBL.DeleteRegister(i_RegId, m_iCCId1, m_sIssNo) == true)
                    {
                        DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 9
0
        private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }

            if (BsfGlobal.FindPermission("Followup Setup-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Followup Setup-Delete");
                return;
            }
            else
            {
                string sSql = ""; SqlCommand cmd;
                RepositoryItemLookUpEdit cboCallType = barEditItem1.Edit as RepositoryItemLookUpEdit;
                string sType = Convert.ToString(barEditItem1.EditValue);
                if (m_sType == "C")
                {
                    if (Convert.ToBoolean(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("SysDefault"), CommFun.datatypes.varTypeBoolean)) == true)
                    {
                        MessageBox.Show("Do not Delete, This is Default Value"); return;
                    }

                    else
                    {
                        int  iTypeId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CallTypeId"), CommFun.datatypes.vartypenumeric));
                        bool bAns    = false;
                        sSql = "Select CallTypeID From CallSheet Where CallTypeID= " + iTypeId + " " +
                               "Union All " +
                               "Select CallTypeID From LeadRegister Where CallTypeID = " + iTypeId;
                        DataTable      dt  = new DataTable();
                        SqlDataAdapter sda = new SqlDataAdapter(sSql, BsfGlobal.OpenCRMDB());
                        sda.Fill(dt);
                        if (dt.Rows.Count > 0)
                        {
                            bAns = true;
                        }
                        dt.Dispose();
                        sda.Dispose();
                        BsfGlobal.g_CRMDB.Close();
                        if (bAns == true)
                        {
                            MessageBox.Show("Do not Delete, Call Type Already Used"); return;
                        }

                        DialogResult result1 = MessageBox.Show("Do you want to Delete", "CallType Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                        if (result1 == DialogResult.Yes)
                        {
                            sSql = String.Format("DELETE FROM CallType WHERE CallTypeId={0}", Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CallTypeId"), CommFun.datatypes.vartypenumeric)));
                            cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                            cmd.ExecuteNonQuery();
                            BsfGlobal.g_CRMDB.Close();

                            DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                        }
                    }
                }
                else if (m_sType == "N")
                {
                    if (Convert.ToBoolean(DGvTransView.GetFocusedRowCellValue("SysDefault")) == true)
                    {
                        MessageBox.Show("Do not Delete, This is Default Value"); return;
                    }

                    int  iTypeId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("NatureId"), CommFun.datatypes.vartypenumeric));
                    bool bAns    = false;
                    sSql = "Select NatureID From CallSheet Where NatureID= " + iTypeId;
                    DataTable      dt  = new DataTable();
                    SqlDataAdapter sda = new SqlDataAdapter(sSql, BsfGlobal.OpenCRMDB());
                    sda.Fill(dt);
                    if (dt.Rows.Count > 0)
                    {
                        bAns = true;
                    }
                    dt.Dispose();
                    sda.Dispose();
                    BsfGlobal.g_CRMDB.Close();
                    if (bAns == true)
                    {
                        MessageBox.Show("Do not Delete, Nature Already Used"); return;
                    }

                    DialogResult result1 = MessageBox.Show("Do you want to Delete", "Nature Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result1 == DialogResult.Yes)
                    {
                        sSql = String.Format("DELETE FROM NatureMaster WHERE NatureId={0}", CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("NatureId"), CommFun.datatypes.vartypenumeric));
                        cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                        cmd.ExecuteNonQuery();
                        BsfGlobal.g_CRMDB.Close();

                        DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                    }
                }
                else if (m_sType == "S")
                {
                    if (Convert.ToBoolean(DGvTransView.GetFocusedRowCellValue("SysDefault")) == true)
                    {
                        MessageBox.Show("Do not Delete, This is Default Value"); return;
                    }

                    int  iTypeId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("StatusId"), CommFun.datatypes.vartypenumeric));
                    bool bAns    = false;
                    sSql = "Select StatusId From CallSheet Where StatusId= " + iTypeId;
                    DataTable      dt  = new DataTable();
                    SqlDataAdapter sda = new SqlDataAdapter(sSql, BsfGlobal.OpenCRMDB());
                    sda.Fill(dt);
                    if (dt.Rows.Count > 0)
                    {
                        bAns = true;
                    }
                    dt.Dispose();
                    sda.Dispose();
                    BsfGlobal.g_CRMDB.Close();
                    if (bAns == true)
                    {
                        MessageBox.Show("Do not Delete, Status Already Used"); return;
                    }

                    DialogResult result1 = MessageBox.Show("Do you want to Delete", "Status Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result1 == DialogResult.Yes)
                    {
                        sSql = String.Format("DELETE FROM StatusMaster WHERE StatusId={0}", CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("StatusId"), CommFun.datatypes.vartypenumeric));
                        cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                        cmd.ExecuteNonQuery();
                        BsfGlobal.g_CRMDB.Close();

                        DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle);
                    }
                }
                //CommFun.InsertLog(DateTime.Now, "Followup Setup-Delete", "D", "Delete Followup Setup", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                BsfGlobal.InsertLog(DateTime.Now, "Followup Setup-Delete", "D", "Delete Followup Setup", Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("StatusId"), CommFun.datatypes.vartypenumeric)), 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
            }
        }