Exemplo n.º 1
0
 private void frmExecTargetReg_Load(object sender, EventArgs e)
 {
     CommFun.SetMyGraphics();
     if (BsfGlobal.g_sUnPermissionMode == "H" || BsfGlobal.g_sUnPermissionMode == "D")
     {
         CheckPermission();
     }
     deFrom.EditValue = Convert.ToDateTime(DateTime.Now.AddMonths(-1));
     deTo.EditValue   = Convert.ToDateTime(DateTime.Now);
     PopulateTargetReg();
 }
Exemplo n.º 2
0
 private void frmRentReceivable_Load(object sender, EventArgs e)
 {
     CommFun.m_sFuncName = BsfGlobal.GetFunctionalName("Flat");
     //if (BsfGlobal.FindPermission("Rent Receivable-View") == false)
     //{
     //    MessageBox.Show("You don't have Rights to Rent Receivable-View");
     //    return;
     //}
     CommFun.SetMyGraphics();
     FillGrid();
 }
Exemplo n.º 3
0
        public void GetComplaint()
        {
            string sql = string.Empty;

            sql = "Select ExtraItemTypeId,ExtraItemTypeName from ExtraItemTypeMaster";
            cboItemType.Properties.DataSource = CommFun.AddSelectToDataTable(CommFun.FillRecord(sql));
            cboItemType.Properties.PopulateColumns();
            cboItemType.Properties.DisplayMember = "ExtraItemTypeName";
            cboItemType.Properties.ValueMember   = "ExtraItemTypeId";
            cboItemType.Properties.Columns["ExtraItemTypeId"].Visible = false;
            cboItemType.ItemIndex = 0;
        }
Exemplo n.º 4
0
        private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                if (grdPBTransView.FocusedRowHandle >= 0)
                {
                    if (BsfGlobal.FindPermission("Progress Bill-Delete") == false)
                    {
                        MessageBox.Show("You don't have Rights to Progress Bill-Delete");
                        return;
                    }

                    string sApprove = CommFun.IsNullCheck(grdPBTransView.GetFocusedRowCellValue("Approve"), CommFun.datatypes.vartypestring).ToString();

                    if (sApprove == "P" || sApprove == "Y")
                    {
                        MessageBox.Show("Bill Approved, Do not Delete");
                        return;
                    }


                    DialogResult Result;
                    Result = MessageBox.Show("Do you Want to Delete?", "CRM", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (Result == DialogResult.Yes)
                    {
                        int iPBillId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "PBillId"));
                        int iCCId    = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "CostCentreId"));
                        if (m_sBussinessType == "B")
                        {
                            ProgBillBL.DeletePBill(iPBillId);

                            grdPBTransView.DeleteRow(grdPBTransView.FocusedRowHandle);

                            //CommFun.InsertLog(DateTime.Now, "Progress Bill-Delete", "D", "Progress Bill", BsfGlobal.g_lUserId, Convert.ToInt32(gridView1.GetFocusedRowCellValue("RegisterId")), Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId")), 0, BsfGlobal.g_sCRMDBName);
                            BsfGlobal.InsertLog(DateTime.Now, "Progress Bill-Delete", "D", "Progress Bill", iProgRegId, iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId, 0, 0);
                        }
                        else
                        {
                            ProgBillBL.DeletePlotPBill(iPBillId);

                            grdPBTransView.DeleteRow(grdPBTransView.FocusedRowHandle);

                            //CommFun.InsertLog(DateTime.Now, "Plot-Progress-Bill-Delete", "D", "Plot Progress Bill  ", BsfGlobal.g_lUserId, Convert.ToInt32(gridView1.GetFocusedRowCellValue("RegisterId")), Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId")), 0, BsfGlobal.g_sCRMDBName);
                            BsfGlobal.InsertLog(DateTime.Now, "Plot-Progress-Bill-Delete", "D", "Plot Progress Bill", iProgRegId, iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId, 0, 0);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        private void btnStatus_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (grdViewReceipt.GetFocusedRow() == null)
            {
                return;
            }
            int    iRegId = Convert.ToInt32(CommFun.IsNullCheck(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "ReceiptId"), CommFun.datatypes.vartypenumeric));
            string sRefNo = CommFun.IsNullCheck(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "ReceiptNo"), CommFun.datatypes.vartypestring).ToString();

            BsfForm.frmLogHistory frm = new BsfForm.frmLogHistory();
            frm.Execute(iRegId, "Buyer Receipt", "Buyer-Receipt-Approve", sRefNo, BsfGlobal.g_sCRMDBName);
        }
Exemplo n.º 6
0
 private void frmExtraBillReg_Load(object sender, EventArgs e)
 {
     CommFun.SetMyGraphics();
     if (BsfGlobal.g_sUnPermissionMode == "H" || BsfGlobal.g_sUnPermissionMode == "D")
     {
         CheckPermission();
     }
     t_panel = panelControl1;
     dtpFrmDate.EditValue = Convert.ToDateTime(DateTime.Now.AddMonths(-1));
     dtpToDate.EditValue  = Convert.ToDateTime(DateTime.Now);
     PopulateData();
 }
Exemplo n.º 7
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);
            }
        }
Exemplo n.º 8
0
        private void PopulateProsAndBuyer()
        {
            if (b_FormLoad == true)
            {
                return;
            }

            int iLCCId = Convert.ToInt32(CommFun.IsNullCheck(cboPCostCentre.EditValue, CommFun.datatypes.vartypenumeric));
            int iBCCId = Convert.ToInt32(CommFun.IsNullCheck(cboBCostCentre.EditValue, CommFun.datatypes.vartypenumeric));

            DataSet ds = ClientBL.GetProsAndBuyer(iLCCId, iBCCId, m_sCCTransId);

            if (ds == null)
            {
                return;
            }

            grdPros.DataSource = ds.Tables[0];
            ProsView.PopulateColumns();
            ProsView.Columns["LeadId"].Visible   = false;
            ProsView.Columns["LeadType"].Visible = false;
            ProsView.Columns["LeadId"].OptionsColumn.ShowInCustomizationForm   = false;
            ProsView.Columns["LeadType"].OptionsColumn.ShowInCustomizationForm = false;

            ProsView.Appearance.HeaderPanel.Font      = new Font(ProsView.Appearance.HeaderPanel.Font, FontStyle.Bold);
            ProsView.OptionsSelection.InvertSelection = true;
            ProsView.OptionsSelection.EnableAppearanceHideSelection = false;
            ProsView.Appearance.FocusedRow.ForeColor = Color.White;
            ProsView.Appearance.FocusedRow.BackColor = Color.Teal;
            ProsView.FocusedRowHandle = 0;
            ProsView.Focus();

            grdBuyer.DataSource = ds.Tables[1];
            BuyerView.PopulateColumns();
            BuyerView.Columns["LeadId"].Visible       = false;
            BuyerView.Columns["FlatId"].Visible       = false;
            BuyerView.Columns["LeadType"].Visible     = false;
            BuyerView.Columns["CostCentreId"].Visible = false;
            BuyerView.Columns["LeadId"].OptionsColumn.ShowInCustomizationForm   = false;
            BuyerView.Columns["FlatId"].OptionsColumn.ShowInCustomizationForm   = false;
            BuyerView.Columns["LeadType"].OptionsColumn.ShowInCustomizationForm = false;

            BuyerView.Columns["Name"].Group();
            BuyerView.ExpandAllGroups();

            BuyerView.Appearance.HeaderPanel.Font      = new Font(BuyerView.Appearance.HeaderPanel.Font, FontStyle.Bold);
            BuyerView.OptionsSelection.InvertSelection = true;
            BuyerView.OptionsSelection.EnableAppearanceHideSelection = false;
            BuyerView.Appearance.FocusedRow.BackColor = Color.Teal;
            BuyerView.Appearance.FocusedRow.ForeColor = Color.White;
            BuyerView.FocusedRowHandle = 0;
        }
Exemplo n.º 9
0
        private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Extra Bill-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Extra Bill-Delete");
                return;
            }
            try
            {
                int iCCId      = Convert.ToInt32(CommFun.IsNullCheck(grdBillView.GetFocusedRowCellValue("CostCentreId"), CommFun.datatypes.vartypenumeric));
                int iBillRegId = Convert.ToInt32(CommFun.IsNullCheck(grdBillView.GetFocusedRowCellValue("BillRegId"), CommFun.datatypes.vartypenumeric));

                BsfGlobal.OpenCRMDB();
                string     sSql    = String.Format("Select COUNT(*) FROM dbo.ReceiptTrans WHERE BillRegId={0} AND CostCentreId={1}", iBillRegId, iCCId);
                SqlCommand cmd     = new SqlCommand(sSql, BsfGlobal.g_CRMDB);
                int        i_Count = Convert.ToInt32(CommFun.IsNullCheck(cmd.ExecuteScalar(), CommFun.datatypes.vartypenumeric));
                cmd.Dispose();
                BsfGlobal.g_CRMDB.Close();

                if (i_Count > 0)
                {
                    MessageBox.Show("Receipt Raised, Couldnot Delete", "CRM", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    sSql = String.Format("DELETE FROM ExtraBillRegister WHERE BillRegId={0}", iBillRegId);
                    CommFun.CRMExecute(sSql);

                    sSql = String.Format("DELETE FROM ExtraBillTrans WHERE BillRegId={0}", iBillRegId);
                    CommFun.CRMExecute(sSql);

                    sSql = String.Format("DELETE FROM ExtraBillRateQ WHERE BillRegId={0}", iBillRegId);
                    CommFun.CRMExecute(sSql);

                    sSql = String.Format("DELETE FROM ExtraBillRateQAbs WHERE BillRegId={0}", iBillRegId);
                    CommFun.CRMExecute(sSql);

                    grdBillView.DeleteRow(grdBillView.FocusedRowHandle);
                    BsfGlobal.InsertLog(DateTime.Now, "ExtraBill-Delete", "D", "Delete ExtraBill Register",
                                        Convert.ToInt32(CommFun.IsNullCheck(grdBillView.GetFocusedRowCellValue("BillRegId"), CommFun.datatypes.vartypenumeric)),
                                        iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);

                    MessageBox.Show("Deleted", "CRM", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 10
0
        private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
        {
            int iFieldId = Convert.ToInt32(CommFun.IsNullCheck(gridView1.GetFocusedRowCellValue("FieldId"), CommFun.datatypes.vartypenumeric));

            if (iFieldId == 1 || iFieldId == 2 || iFieldId == 3)
            {
                e.Cancel = true;
            }
            else
            {
                e.Cancel = false;
            }
        }
Exemplo n.º 11
0
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (grdCancelView.GetFocusedRow() == null)
            {
                return;
            }

            int    iRegId = Convert.ToInt32(CommFun.IsNullCheck(grdCancelView.GetRowCellValue(grdCancelView.FocusedRowHandle, "CancelId"), CommFun.datatypes.vartypenumeric));
            string sRefNo = CommFun.IsNullCheck(grdCancelView.GetRowCellValue(grdCancelView.FocusedRowHandle, "FlatNo"), CommFun.datatypes.vartypestring).ToString();

            BsfForm.frmLogHistory frm = new BsfForm.frmLogHistory();
            frm.Execute(iRegId, "Flat-Cancellation", "Flat-Cancellation-Create", sRefNo, BsfGlobal.g_sCRMDBName);
        }
Exemplo n.º 12
0
 private void grdCarView_CustomDrawCardFieldValue(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     if (Convert.ToInt32(CommFun.IsNullCheck(grdChartView.GetRowCellValue(e.RowHandle, "FlatId"), CommFun.datatypes.vartypenumeric)) > 0)
     {
         e.Appearance.BackColor = System.Drawing.Color.ForestGreen;
         e.Appearance.ForeColor = System.Drawing.Color.White;
     }
     else
     {
         e.Appearance.BackColor = System.Drawing.Color.PaleGoldenrod;
         e.Appearance.ForeColor = System.Drawing.Color.Maroon;
     }
 }
Exemplo n.º 13
0
 private void frmProjReceivable_Load(object sender, EventArgs e)
 {
     //if (BsfGlobal.FindPermission("ProjwiseReceivable-View") == false)
     //{
     //    MessageBox.Show("You don't have Rights to ProjwiseReceivable-View");
     //    return;
     //}
     CommFun.SetMyGraphics();
     //SetMyGraphics();
     dxDate.EditValue = Convert.ToDateTime(DateTime.Today);
     dtAson           = Convert.ToDateTime(dxDate.EditValue.ToString());
     Fill_Project_Receivable();
 }
Exemplo n.º 14
0
        private void grdCarView_DoubleClick(object sender, EventArgs e)
        {
            iBlockId = Convert.ToInt32(CommFun.IsNullCheck(cboBlock.EditValue, CommFun.datatypes.vartypenumeric));
            iTypeId  = Convert.ToInt32(CommFun.IsNullCheck(cboType.EditValue, CommFun.datatypes.vartypenumeric));
            int iSlotNo          = Convert.ToInt32(CommFun.IsNullCheck(grdChartView.GetFocusedRowCellValue("SlotNo"), CommFun.datatypes.vartypenumeric));
            int iFlatId          = Convert.ToInt32(CommFun.IsNullCheck(grdChartView.GetFocusedRowCellValue("FlatId"), CommFun.datatypes.vartypenumeric));
            frmFlatSelection frm = new frmFlatSelection();

            if (frm.Execute(m_iCCId, iBlockId, iTypeId, iSlotNo, iFlatId) == true)
            {
                PopulateGrid();
            }
        }
Exemplo n.º 15
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();
        }
Exemplo n.º 16
0
 private void btnAddStageLevel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     using (frmStagePickList frm = new frmStagePickList()
     {
         StartPosition = FormStartPosition.CenterScreen
     })
     {
         i_LevelId = Convert.ToInt32(CommFun.IsNullCheck(grdLevelView.GetRowCellValue(grdLevelView.FocusedRowHandle, "LevelId"), CommFun.datatypes.vartypenumeric));
         frm.Exe(0, i_LevelId, m_icostCentreId);
         frm.ShowDialog();
         FillStageLevel();
     }
 }
Exemplo n.º 17
0
        void txtAmtEdit_DoubleClick(object sender, EventArgs e)
        {
            int        iTempId    = Convert.ToInt32(grdViewPayFlat.GetRowCellValue(grdViewPayFlat.FocusedRowHandle, "PaymentSchId").ToString());
            int        iPayTypeId = m_iPayTypeId;
            string     sType      = grdViewPayFlat.GetRowCellValue(grdViewPayFlat.FocusedRowHandle, "SchType").ToString();
            DateTime   dSchDate   = Convert.ToDateTime(CommFun.IsNullCheck(grdViewPayFlat.GetRowCellValue(grdViewPayFlat.FocusedRowHandle, "SchDate"), CommFun.datatypes.VarTypeDate));
            decimal    dAmt       = Convert.ToDecimal(grdViewPayFlat.GetRowCellValue(grdViewPayFlat.FocusedRowHandle, "Amount").ToString());
            decimal    dNetAmt    = Convert.ToDecimal(grdViewPayFlat.GetRowCellValue(grdViewPayFlat.FocusedRowHandle, "NetAmount").ToString());
            frmRecType frm        = new frmRecType();

            dNetAmt = frm.Execute(iTempId, "F", iPayTypeId, m_iCCId, sType, dSchDate, dAmt, dNetAmt, m_iFlatId, 0, "", false, 0);
            grdViewPayFlat.SetRowCellValue(grdViewPayFlat.FocusedRowHandle, "NetAmount", dNetAmt);
        }
Exemplo n.º 18
0
        void txtDEdit_DoubleClick(object sender, EventArgs e)
        {
            int          iPaySchId = Convert.ToInt32(CommFun.IsNullCheck(grdViewPayFlat.GetFocusedRowCellValue("PaymentSchId"), CommFun.datatypes.vartypenumeric));
            int          iTempId   = Convert.ToInt32(CommFun.IsNullCheck(grdViewPayFlat.GetFocusedRowCellValue("TemplateId"), CommFun.datatypes.vartypenumeric));
            int          i         = grdViewPayFlat.FocusedRowHandle;
            frmDatePList frm       = new frmDatePList();

            if (frm.Execute(iTempId, iPaySchId, m_iCCId, m_iFlatId, "PayFlat") == true)
            {
                PopulatePaySchFlat();
                grdViewPayFlat.FocusedRowHandle = i;
            }
        }
Exemplo n.º 19
0
 private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (BsfGlobal.FindPermission("Project UOM-Add") == false)
     {
         MessageBox.Show("You don't have Rights to Project UOM-Add");
         return;
     }
     if (Convert.ToInt32(CommFun.IsNullCheck(cboUOM.EditValue, CommFun.datatypes.vartypenumeric)) > 0)
     {
         UnitDirBL.UpdateUOM(m_iCCId, Convert.ToInt32(cboUOM.EditValue));
     }
     Close();
 }
Exemplo n.º 20
0
 void btnView_Click(object sender, EventArgs e)
 {
     try
     {
         string sFileName = "";
         sFileName = CommFun.IsNullCheck(grdViewTemp.GetRowCellValue(grdViewTemp.FocusedRowHandle, "DocPath"), CommFun.datatypes.vartypestring).ToString();
         System.Diagnostics.Process.Start(sFileName);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 21
0
        private void PopulateFlat()
        {
            DataTable dtF = new DataTable();

            dtF = PMSReceiptBL.GetFlat(Convert.ToInt32(cboCostCentre.EditValue));
            cboFlatNo.Properties.DataSource    = CommFun.AddSelectToDataTable(dtF);
            cboFlatNo.Properties.DisplayMember = "FlatNo";
            cboFlatNo.Properties.ValueMember   = "FlatId";
            cboFlatNo.Properties.PopulateColumns();
            cboFlatNo.Properties.Columns["FlatId"].Visible = false;
            cboFlatNo.Properties.ShowHeader = false;
            cboFlatNo.Properties.ShowFooter = false;
        }
Exemplo n.º 22
0
        void txtAmtEdit_DoubleClick(object sender, EventArgs e)
        {
            bool b_Ans = false;
            frmCarParkDescription frm = new frmCarParkDescription();

            frm.iSlots = Convert.ToInt32(CommFun.IsNullCheck(grdViewCar.GetFocusedRowCellValue("NoOfSlots"), CommFun.datatypes.vartypenumeric));
            frm.Execute(m_iCCId, Convert.ToInt32(grdViewCar.GetFocusedRowCellValue("BlockId")), m_iTypeId);
            if (b_Ans = frm.b_OK == true)
            {
                int iNoOfSlots = frm.iSlots;
                grdViewCar.SetRowCellValue(grdViewCar.FocusedRowHandle, "NoOfSlots", iNoOfSlots);
            }
        }
Exemplo n.º 23
0
 private void frmTargetRegister_Load(object sender, EventArgs e)
 {
     CommFun.SetMyGraphics();
     if (BsfGlobal.g_sUnPermissionMode == "H" || BsfGlobal.g_sUnPermissionMode == "D")
     {
         CheckPermission();
     }
     t_panel              = panelTargetReg;
     deTo.EditValue       = Convert.ToDateTime(DateTime.Now.ToShortDateString());
     barTargetReg.Visible = true;
     PopulateTargetReg();
     FormClosed += new FormClosedEventHandler(frmTargetRegister_FormClosed);
 }
Exemplo n.º 24
0
        private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //string sMsg = PaymentScheduleBL.GetPaySchFlatValidate(m_iCCId, m_iFlatId);
            //if (sMsg == "Land") { MessageBox.Show("Mismatch Land Value"); return; }
            //if (sMsg == "Base") { MessageBox.Show("Mismatch Construction Value"); return; }
            //if (sMsg == "OtherCost") { MessageBox.Show("Mismatch OtherCost Value"); return; }

            //for (int x = 0; x < dtPaySchFlat.Rows.Count; x++)
            //{
            //    for (int i = 0; i < dtFlat.Rows.Count; i++)
            //    {
            //        if (Convert.ToInt32(dtFlat.Rows[i]["TemplateId"]) == Convert.ToInt32(dtPaySchFlat.Rows[x]["TemplateId"]))
            //        {
            //            dtFlat.Rows[i]["FlatId"] = m_iFlatId;
            //            dtFlat.Rows[i]["SchDate"] = dtPaySchFlat.Rows[x]["SchDate"];
            //            dtFlat.Rows[i]["SchPercent"] = dtPaySchFlat.Rows[x]["SchPercent"];
            //            dTotal = dTotal + Convert.ToDecimal(dtFlat.Rows[i]["SchPercent"]);
            //        }
            //    }
            //}

            Cursor.Current = Cursors.WaitCursor;
            grdViewPayFlat.FocusedRowHandle = grdViewPayFlat.FocusedRowHandle + 1;

            decimal dTotal = Convert.ToDecimal(CommFun.IsNullCheck(grdViewPayFlat.Columns["SchPercent"].SummaryText, CommFun.datatypes.vartypenumeric));

            if (dTotal != 100)
            {
                MessageBox.Show("Percentage should be 100"); return;
            }

            dtFlat = new DataTable();
            dtFlat = PaymentScheduleBL.GetCommPaySchFlat(m_iCCId, m_iFlatId, m_iPayTypeId);

            if (bCheckBill == false)
            {
                if (m_bPayTypewise == true)
                {
                    PaymentScheduleBL.UpdateFlatSchedule(m_iFlatId, dtFlat);
                }
                else
                {
                    PaymentScheduleBL.UpdateFlatScheduleQual(m_iFlatId, dtFlat);
                }
            }
            //PaymentScheduleBL.UpdateFlatSchedule(m_iFlatId, dtFlat);
            PopulatePaySchFlat();

            Close();
            Cursor.Current = Cursors.Default;
        }
Exemplo n.º 25
0
        private void DGvTransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            bool m_bAns = false;

            if (m_bAns == true)
            {
                DGvTransView.CancelUpdateCurrentRow(); return;
            }


            if (BsfGlobal.FindPermission("Followup Setup-Modify") == false)
            {
                MessageBox.Show("You don't have Rights to Followup Setup-Modify");
                return;
            }

            if (CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue(DGvTransView.Columns[1].FieldName).ToString(), CommFun.datatypes.vartypestring).ToString().Trim() == "")
            {
                DGvTransView.CancelUpdateCurrentRow();
                return;
            }

            m_bAns = true;
            if (DGvTransView.FocusedRowHandle >= 0)
            {
                int i = Convert.ToInt32(e.RowHandle.ToString()) + 1;
                if (Convert.ToBoolean(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("SysDefault"), CommFun.datatypes.varTypeBoolean)) == true)
                {
                    DGvTransView.CancelUpdateCurrentRow(); return;
                }
                string s  = CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue(DGvTransView.Columns[1].FieldName).ToString(), CommFun.datatypes.vartypestring).ToString();
                int    id = Convert.ToInt16(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue(DGvTransView.Columns[0].FieldName).ToString(), CommFun.datatypes.vartypenumeric));


                //UpdateData(m_sType, CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue(DGvTransView.Columns[1].FieldName).ToString(), CommFun.datatypes.vartypestring).ToString(), Convert.ToInt16(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue(DGvTransView.Columns[0].FieldName).ToString(), CommFun.datatypes.vartypenumeric)), i);


                UpdateData(m_sType, s, id, i);
            }
            else
            {
                int i = 0;// Convert.ToInt16(GetPrevVisibleRow) + 1;
                if (Convert.ToBoolean(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("SysDefault"), CommFun.datatypes.varTypeBoolean)) == true)
                {
                    DGvTransView.CancelUpdateCurrentRow(); return;
                }
                UpdateData(m_sType, DGvTransView.GetFocusedRowCellValue(DGvTransView.Columns[1].FieldName).ToString(), 0, i);
            }
            m_bAns = false;
        }
Exemplo n.º 26
0
        private void FillExec()
        {
            DataTable dt = new DataTable();

            dt = CommFun.LoadExecutive();

            cboExec.Properties.DataSource = dt;
            cboExec.Properties.PopulateColumns();
            cboExec.Properties.DisplayMember             = "ExecName";
            cboExec.Properties.ValueMember               = "ExecId";
            cboExec.Properties.ShowHeader                = false;
            cboExec.Properties.ShowFooter                = false;
            cboExec.Properties.Columns["ExecId"].Visible = false;
        }
Exemplo n.º 27
0
        private void FillBranch()
        {
            DataTable dt = new DataTable();

            dt = BankBL.getBranchName();

            cboBranch.Properties.DataSource = CommFun.AddAllToDataTable(dt);
            cboBranch.Properties.PopulateColumns();
            cboBranch.Properties.DisplayMember = "BranchName";
            cboBranch.Properties.ValueMember   = "BranchId";
            cboBranch.Properties.Columns["BranchId"].Visible = false;
            cboBranch.Properties.ShowFooter = false;
            cboBranch.Properties.ShowHeader = false;
        }
Exemplo n.º 28
0
        public void GetData()
        {
            try
            {
                GetComplaint();

                DataTable dtPpro = new DataTable();
                dtPpro = ComplaintDetBL.PopulateProject(BsfGlobal.g_lUserId);
                cboProj.Properties.DataSource = CommFun.AddSelectToDataTable(dtPpro);

                cboProj.Properties.ForceInitialize();
                cboProj.Properties.PopulateColumns();
                cboProj.Properties.DisplayMember = "CostCentreName";
                cboProj.Properties.ValueMember   = "CostCentreId";
                cboProj.Properties.Columns["CostCentreId"].Visible = false;
                cboProj.Properties.ShowFooter = false;
                cboProj.Properties.ShowHeader = false;
                cboProj.ItemIndex             = 0;

                DataTable dtExe = new DataTable();
                dtExe = ComplaintDetBL.PopulateExecutive();
                cboExec.Properties.DataSource = CommFun.AddSelectToDataTable(dtExe);

                cboExec.Properties.PopulateColumns();
                cboExec.Properties.DisplayMember             = "ExecName";
                cboExec.Properties.ValueMember               = "ExecId";
                cboExec.Properties.Columns["ExecId"].Visible = false;
                cboExec.Properties.Columns["Sel"].Visible    = false;
                cboExec.Properties.ShowFooter = false;
                cboExec.Properties.ShowHeader = false;
                cboExec.ItemIndex             = 0;

                DataTable dtEmp = new DataTable();
                dtEmp = ComplaintDetBL.PopulateEmployee();
                cboAttnExec.Properties.DataSource = CommFun.AddSelectToDataTable(dtEmp);

                cboAttnExec.Properties.PopulateColumns();
                cboAttnExec.Properties.DisplayMember             = "ExecName";
                cboAttnExec.Properties.ValueMember               = "ExecId";
                cboAttnExec.Properties.Columns["ExecId"].Visible = false;
                cboAttnExec.Properties.Columns["Sel"].Visible    = false;
                cboAttnExec.Properties.ShowFooter = false;
                cboAttnExec.Properties.ShowHeader = false;
                cboAttnExec.ItemIndex             = 0;
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Exemplo n.º 29
0
        private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Buyer-Receipt-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Buyer-Receipt-Delete");
                return;
            }
            if (Convert.ToInt32(grdViewReceipt.FocusedRowHandle) < 0)
            {
                return;
            }
            int iRepceiptId = Convert.ToInt32(CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("ReceiptId"), CommFun.datatypes.vartypenumeric));

            string sAppr = ReceiptDetailBL.GetApprove(iRepceiptId);

            if (sAppr == "P" || sAppr == "Y")
            {
                MessageBox.Show("Approved Receipt should not be Deleted"); return;
            }

            bool bCheckValidate = ReceiptDetailBL.Check_ReceiptDet(iRepceiptId);

            if (bCheckValidate == true)
            {
                MessageBox.Show("Cannot Delete, Schedule raised to Bill"); return;
            }

            try
            {
                if (grdViewReceipt.FocusedRowHandle >= 0)
                {
                    if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        ReceiptDetailBL.DeleteReceiptDetails(Convert.ToInt32(grdViewReceipt.GetFocusedRowCellValue("ReceiptId")),
                                                             grdViewReceipt.GetFocusedRowCellValue("PaymentAgainst").ToString());

                        grdViewReceipt.DeleteRow(grdViewReceipt.FocusedRowHandle);
                        int     iCCId  = Convert.ToInt32(CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("CostCentreId"), CommFun.datatypes.vartypenumeric));
                        string  sRecNo = CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("ReceiptNo"), CommFun.datatypes.vartypestring).ToString();
                        decimal dAmt   = Convert.ToInt32(CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("Amount"), CommFun.datatypes.vartypenumeric));
                        //CommFun.InsertLog(DateTime.Now, "Receipt Register-Delete", "D", "Delete Receipt Register", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                        //BsfGlobal.InsertLog(DateTime.Now, "Buyer-Receipt-Delete", "D", "Delete Receipt Register", Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("ReceiptId")), iCCId, 0, BsfGlobal.g_sCRMDBName, sRecNo, BsfGlobal.g_lUserId, dAmt, 0);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 30
0
        public static void SendBulkMail(List <M.EmailAddress> argToAddress, string argSubject, string argContent, List <M.attachment> argAttachment)
        {
            try
            {
                //string activationLink = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/Register/Activation.aspx?id=" + argFromAddress;

                Cursor.Current = Cursors.WaitCursor;

                DataTable dt = new DataTable();
                dt = CommFun.GetMandrillSetting(3);
                if (dt == null)
                {
                    return;
                }
                if (dt.Rows.Count == 0)
                {
                    return;
                }

                string sFromName     = CommFun.IsNullCheck(dt.Rows[0]["FromName"], CommFun.datatypes.vartypestring).ToString();
                string sUserId       = CommFun.IsNullCheck(dt.Rows[0]["UserId"], CommFun.datatypes.vartypestring).ToString();
                string sKeyId        = CommFun.IsNullCheck(dt.Rows[0]["KeyId"], CommFun.datatypes.vartypestring).ToString();
                string sTemplateName = CommFun.IsNullCheck(dt.Rows[0]["TemplateId"], CommFun.datatypes.vartypestring).ToString();

                M.MandrillApi api = new M.MandrillApi(sKeyId, true);

                M.EmailMessage emailmsg = new M.EmailMessage();
                emailmsg.from_name   = sFromName;
                emailmsg.from_email  = sUserId;
                emailmsg.to          = argToAddress;
                emailmsg.attachments = argAttachment;
                emailmsg.merge       = true;
                emailmsg.AddGlobalVariable("SUBJECT", argSubject);
                emailmsg.AddGlobalVariable("BODY", argContent);

                List <M.TemplateContent> tempContent = new List <M.TemplateContent>();
                tempContent.Add(new M.TemplateContent()
                {
                    name = sTemplateName
                });

                List <M.EmailResult> errorMsg = api.SendMessage(emailmsg, sTemplateName, tempContent);

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }