Ejemplo n.º 1
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.º 2
0
        private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Complaint Master-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Complaint Master-Delete");
                return;
            }
            int i_RegId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "ComplaintId"), CommFun.datatypes.vartypenumeric));

            ComplaintDetBL.DeleteCompMaster(i_RegId);

            FillData();
        }
Ejemplo n.º 3
0
        private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.GetFocusedRow() == null)
            {
                return;
            }
            if (DGvTransView.FocusedRowHandle == -1)
            {
                return;
            }
            int    iRegId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RegBillId"), CommFun.datatypes.vartypenumeric));
            string sRefNo = CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "BillRefNo"), CommFun.datatypes.vartypestring).ToString();

            BsfForm.frmLogHistory frm = new BsfForm.frmLogHistory();
            frm.Execute(iRegId, "CRM-ServiceBill", "CRM-ServiceBill-Approval", sRefNo, BsfGlobal.g_sCRMDBName);
        }
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 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.º 6
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.º 7
0
        private void btnEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.FindPermission("CRM-ServiceBill-Edit") == false)
            {
                MessageBox.Show("You don't have Rights to Service Quote Bill-Modify", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            //bar1.Visible = false;
            if (DGvTransView.FocusedRowHandle >= 0)
            {
                int argWORegId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("RegBillId").ToString());

                string Approve = CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "Approve"), CommFun.datatypes.vartypestring).ToString();
                if (Approve != "Partial" && Approve != "Yes")
                {
                    string sUserName = BsfGlobal.CheckEntryUsed("CRM-ServiceBill-Edit", argWORegId, BsfGlobal.g_sCRMDBName);
                    if (sUserName != "")
                    {
                        string sMsg = "The Entry is already Used by " + sUserName;
                        sMsg = sMsg + ", Do not Edit";
                        MessageBox.Show(sMsg);
                        return;
                    }
                }

                frmServiceOrderBill frmProg = new frmServiceOrderBill()
                {
                    TopLevel = false, FormBorderStyle = System.Windows.Forms.FormBorderStyle.None, Dock = DockStyle.Fill
                };
                if (BsfGlobal.g_bWorkFlow == true)
                {
                    m_oGridMasterView = DGvTransView;
                    m_oGridMasterView.FocusedRowHandle = DGvTransView.FocusedRowHandle;
                    BsfGlobal.g_bTrans = true;
                    m_oDW = (Telerik.WinControls.UI.Docking.DocumentWindow)BsfGlobal.g_oDock.ActiveWindow;
                    m_oDW.Hide();
                    BsfGlobal.g_bTrans = false;
                    Cursor.Current     = Cursors.WaitCursor;
                    PanelControl oPanel = new PanelControl();
                    oPanel = BsfGlobal.GetPanel(frmProg, "Service Order Bill");
                    if ((oPanel == null))
                    {
                        return;
                    }
                    oPanel.Controls.Clear();
                    oPanel.Controls.Add(frmProg);
                    frmProg.Execute(argWORegId);
                    oPanel.Visible = true;
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    argWORegId = Convert.ToInt32(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RegBillId"));
                    CommFun.DW1.Hide();
                    frmProg          = new frmServiceOrderBill();
                    CommFun.DW2.Text = "Service Order Bill";
                    frmProg.TopLevel = false;
                    CommFun.RP2.Controls.Clear();
                    frmProg.FormBorderStyle = FormBorderStyle.None;
                    frmProg.Dock            = DockStyle.Fill;
                    CommFun.RP2.Controls.Add(frmProg);
                    frmProg.Execute(argWORegId);
                    CommFun.DW2.Show();
                }
                //if (BsfGlobal.g_bWorkFlow == true)
                //{
                //    BsfGlobal.g_bTrans = true;
                //    m_oDW = (Telerik.WinControls.UI.Docking.DocumentWindow)BsfGlobal.g_oDock.ActiveWindow;
                //    m_oDW.Hide();
                //    BsfGlobal.g_bTrans = false;
                //    Cursor.Current = Cursors.WaitCursor;
                //    PanelControl oPanel = new PanelControl();
                //    oPanel = BsfGlobal.GetPanel(frmService, "Service Order Bill");
                //    if ((oPanel == null))
                //        return;
                //    oPanel.Controls.Clear();
                //    oPanel.Controls.Add(frmService);
                //    frmService.Execute(argWORegId);
                //    oPanel.Visible = true;
                //    Cursor.Current = Cursors.Default;
                //}
                //else
                //{
                //    Cursor.Current = Cursors.WaitCursor;
                //    panelControl1.Controls.Clear();
                //    panelControl1.Controls.Add(frmService);
                //    frmService.Execute(argWORegId);
                //    Cursor.Current = Cursors.Default;
                //}
            }
        }
Ejemplo n.º 8
0
        private void barButtonItem5_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }
            int      p_FlatId = 0; DataTable dt = new DataTable();
            int      p_MaintanceId = 0;
            string   s = ""; frmReport objReport; ReportDocument cryRpt;
            decimal  dBillAmount = 0, dArrear = 0;
            DateTime dStartDate = DateTime.Today;; DateTime dEndDate = DateTime.Today;;

            string[] DataFiles;
            string   sHeader    = "";
            int      sMonth     = 0;
            int      sYear      = 0;
            DateTime sFifetDate = DateTime.Today;

            p_FlatId      = Convert.ToInt32(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "FlatId"));
            p_MaintanceId = Convert.ToInt32(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "MaintenanceId"));

            dt = MaintenanceBL.GetReport(p_FlatId, p_MaintanceId);

            if (dt.Rows.Count > 0)
            {
                dBillAmount = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["BillAmount"], CommFun.datatypes.vartypenumeric));
                dArrear     = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Arrear"], CommFun.datatypes.vartypenumeric));
                if (dArrear == 0)
                {
                    dStartDate = Convert.ToDateTime(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "StartDate"), CommFun.datatypes.VarTypeDate));
                    dEndDate   = Convert.ToDateTime(CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "EndDate"), CommFun.datatypes.VarTypeDate));
                    sMonth     = dStartDate.Month;
                    sYear      = dStartDate.Year;
                    sFifetDate = Convert.ToDateTime("15" + "/" + sMonth + "/" + sYear);
                }
                else
                {
                    dStartDate = Convert.ToDateTime(CommFun.IsNullCheck(dt.Rows[0]["FromDate"], CommFun.datatypes.VarTypeDate));
                    dEndDate   = Convert.ToDateTime(CommFun.IsNullCheck(dt.Rows[0]["ToDate"], CommFun.datatypes.VarTypeDate));
                    sMonth     = dEndDate.Month;
                    sYear      = dEndDate.Year;
                    sFifetDate = Convert.ToDateTime("15" + "/" + sMonth + "/" + sYear);
                }
                //dEndDate = Convert.ToDateTime(CommFun.IsNullCheck(dt.Rows[0]["ToDate"], CommFun.datatypes.VarTypeDate));
            }

            decimal dTotalPayAmt = Convert.ToDecimal(dBillAmount + dArrear);

            objReport = new frmReport();
            string strReportPath = Application.StartupPath + "\\Maintenance.Rpt";

            cryRpt = new ReportDocument();
            cryRpt.Load(strReportPath);
            s         = "{MaintenanceDet.FlatId}=" + p_FlatId + " ";
            DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName,
                                       BsfGlobal.g_sCRMDBName, BsfGlobal.g_sWorkFlowDBName,
                                       BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sCRMDBName };

            objReport.ReportConvert(cryRpt, DataFiles);
            if (s.Length > 0)
            {
                cryRpt.RecordSelectionFormula = s;
            }
            objReport.rptViewer.ReportSource     = null;
            objReport.rptViewer.SelectionFormula = s;
            objReport.rptViewer.ReportSource     = cryRpt;
            cryRpt.DataDefinition.FormulaFields["Decimal"].Text  = string.Format(CommFun.g_iCurrencyDigit.ToString());
            cryRpt.DataDefinition.FormulaFields["MainAmt"].Text  = "'" + string.Format(dBillAmount.ToString()) + "'";
            cryRpt.DataDefinition.FormulaFields["Arrear"].Text   = "'" + string.Format(dArrear.ToString()) + "'";
            cryRpt.DataDefinition.FormulaFields["TotalPay"].Text = "'" + string.Format(dTotalPayAmt.ToString()) + "'";
            if (dArrear == 0)
            {
                cryRpt.DataDefinition.FormulaFields["EndFiftenDate"].Text   = String.Format("'{0}'", sHeader = sHeader = String.Format(" {0} ", sFifetDate.ToString("dd-MMM-yyyy")));
                cryRpt.DataDefinition.FormulaFields["StartfiftenDate"].Text = String.Format("'{0}'", sHeader = sHeader = String.Format(" {0} ", sFifetDate.ToString("dd-MMM-yyyy")));
            }
            else
            {
                cryRpt.DataDefinition.FormulaFields["EndFiftenDate"].Text   = String.Format("'{0}'", sHeader = sHeader = String.Format(" {0} ", sFifetDate.ToString("dd-MMM-yyyy")));
                cryRpt.DataDefinition.FormulaFields["StartfiftenDate"].Text = String.Format("'{0}'", sHeader = sHeader = String.Format(" {0} ", sFifetDate.ToString("dd-MMM-yyyy")));
            }
            cryRpt.DataDefinition.FormulaFields["Period"].Text = String.Format("'{0}'", sHeader = sHeader = String.Format(" {0} to {1} ", dStartDate.ToString("dd-MMM-yyyy"), dEndDate.ToString("dd-MMM-yyyy")));
            objReport.WindowState = FormWindowState.Maximized;
            objReport.rptViewer.Refresh();
            objReport.Show();
        }