Example #1
0
        private void cboProject_EditValueChanged(object sender, EventArgs e)
        {
            DataTable dtLand = new DataTable();

            if (Convert.ToInt32(cboProject.EditValue) > 0)
            {
                m_iCCId = Convert.ToInt32(cboProject.EditValue);
                dtLand  = LeadBL.GetBusinessType(m_iCCId);
                if (dtLand.Rows.Count > 0)
                {
                    m_sBussinessType = CommFun.IsNullCheck(dtLand.Rows[0]["BusinessType"], CommFun.datatypes.vartypestring).ToString();
                    m_iLandId        = Convert.ToInt32(CommFun.IsNullCheck(dtLand.Rows[0]["LandId"], CommFun.datatypes.vartypenumeric));
                    if (m_sBussinessType == "B")
                    {
                        lblProject.Text = "Project - Apartment";
                    }
                    else if (m_sBussinessType == "L")
                    {
                        lblProject.Text = "Project - Plot";
                    }
                }
                PopulateLead();
                PopulateFlat();
            }
        }
Example #2
0
        private void cboProj_EditValueChanged(object sender, EventArgs e)
        {
            DataTable dtLand = new DataTable();

            if (Convert.ToInt32(cboProj.EditValue) > 0)
            {
                dtLand = LeadBL.GetBusinessType(Convert.ToInt32(cboProj.EditValue));
                if (dtLand.Rows.Count > 0)
                {
                    m_sBussinessType = CommFun.IsNullCheck(dtLand.Rows[0]["BusinessType"], CommFun.datatypes.vartypestring).ToString();
                    m_iLandId        = Convert.ToInt32(CommFun.IsNullCheck(dtLand.Rows[0]["LandId"], CommFun.datatypes.vartypenumeric));
                    if (m_sBussinessType == "B")
                    {
                        lblProject.Caption = "Project - Apartment";
                    }
                    else
                    {
                        lblProject.Caption = "Project - Plot";
                    }
                }
                FillGridMaster();
                FillGrid();
            }
            else
            {
                lblProject.Caption = "Project"; grdPBTrans.DataSource = null; grdPBReg.DataSource = null;
            }
        }
Example #3
0
        private void PopulateCustomerFeedback()
        {
            DataTable dt = new DataTable();

            dt = LeadBL.PopulateCustomerFeedback();

            gridControl1.DataSource = dt;
            gridControl1.ForceInitialize();
            gridView1.PopulateColumns();

            gridView1.Appearance.HeaderPanel.Font = new Font(gridView1.Appearance.HeaderPanel.Font, FontStyle.Bold);

            gridView1.Appearance.FocusedCell.BackColor = Color.Teal;
            gridView1.Appearance.FocusedCell.ForeColor = Color.HotPink;
            gridView1.Appearance.FocusedRow.ForeColor  = Color.Black;
            gridView1.Appearance.FocusedRow.BackColor  = Color.HotPink;

            gridView1.OptionsSelection.EnableAppearanceHideSelection = false;
        }
Example #4
0
        private void barEditItem1_EditValueChanged(object sender, EventArgs e)
        {
            DataTable dtLand = new DataTable();

            //if (BsfGlobal.FindPermission("Progress CheckList-View") == false)
            //{
            //    MessageBox.Show("You don't have Rights to Progress CheckList-View");
            //    return;
            //}
            if (m_bAns == false)
            {
                return;
            }
            dtLand = LeadBL.GetBusinessType(Convert.ToInt32(barcboProject.EditValue));
            if (dtLand.Rows.Count > 0)
            {
                m_sBussinessType = CommFun.IsNullCheck(dtLand.Rows[0]["BusinessType"], CommFun.datatypes.vartypestring).ToString();
                m_iLandId        = Convert.ToInt32(CommFun.IsNullCheck(dtLand.Rows[0]["LandId"], CommFun.datatypes.vartypenumeric));
            }
            PopulateFlatType();
            PopulateGrid();
        }
Example #5
0
        private void PopulateMandatoryFields()
        {
            string[] sFieldNames = new string[] { "Project", "Location", "Unit Type", "Cost Preference",
                                                  "Nature", "Call Type", "Next Call Date", "Mobile", "Email", "Remarks" };
            LeadBL.InsertLeadCheckList(sFieldNames);

            DataTable dt = new DataTable();

            dt = LeadBL.GetLeadCheckList();
            if (dt == null)
            {
                return;
            }

            gridControl1.DataSource = dt;
            gridControl1.ForceInitialize();
            gridView1.PopulateColumns();
            gridView1.Columns["FieldId"].Visible = false;
            gridView1.Columns["FieldId"].OptionsColumn.ShowInCustomizationForm = false;

            gridView1.Columns["FieldName"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["Sel"].OptionsColumn.AllowEdit       = true;
        }
Example #6
0
        private void cmdSend_Click(object sender, EventArgs e)
        {
            #region Send Mail Through SMTP

            DataTable dtCompDet = new DataTable();
            dtCompDet = LeadBL.GetCompanyMailDetails();
            if (dtCompDet.Rows.Count == 0)
            {
                return;
            }

            string sFrom       = "";
            string sCreUsrName = "";
            string sCrePwd     = "";
            string sHost       = "";
            int    iPortNo     = 0;
            string sMobileNo   = "";
            string sSubject    = "";
            int    iLeadId     = 0;
            string sEmail      = "";
            bool   bSSL        = true;
            if (dtCompDet.Rows.Count > 0)
            {
                sFrom       = dtCompDet.Rows[0]["Email"].ToString();
                sCreUsrName = dtCompDet.Rows[0]["Email"].ToString();
                sCrePwd     = dtCompDet.Rows[0]["Pwd"].ToString();
                sHost       = dtCompDet.Rows[0]["Host"].ToString();
                iPortNo     = Convert.ToInt32(dtCompDet.Rows[0]["PortNo"]);
                sGSM        = dtCompDet.Rows[0]["GSMPort"].ToString();
                sSMS        = dtCompDet.Rows[0]["SMSCNo"].ToString();
                bSSL        = Convert.ToBoolean(dtCompDet.Rows[0]["SSLConnection"]);
            }

            if (Convert.ToBoolean(chkMail.EditValue) == true)
            {
                if (grdViewMail.RowCount > 0)
                {
                    for (int i = 0; i < grdViewMail.RowCount; i++)
                    {
                        if (Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "To")) == true && grdViewMail.GetRowCellValue(i, "Email").ToString() != string.Empty)
                        {
                            To = To + grdViewMail.GetRowCellValue(i, "Email") + ";";
                        }
                        if (Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "CC")) == true && grdViewMail.GetRowCellValue(i, "Email").ToString() != string.Empty)
                        {
                            CC = CC + grdViewMail.GetRowCellValue(i, "Email") + ";";
                        }
                        if (Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "BCC")) == true && grdViewMail.GetRowCellValue(i, "Email").ToString() != string.Empty)
                        {
                            BCC = BCC + grdViewMail.GetRowCellValue(i, "Email") + ";";
                        }
                    }
                }

                SendMail(txtSub.Text, txtBody.Text, false, sFrom, To, CC, BCC, sHost, iPortNo, sCreUsrName, sCrePwd, bSSL);

                if (grdViewMail.RowCount > 0)
                {
                    for (int i = 0; i < grdViewMail.RowCount; i++)
                    {
                        sMobileNo = grdViewMail.GetRowCellValue(i, "Mobile").ToString();
                        iLeadId   = Convert.ToInt32(grdViewMail.GetRowCellValue(i, "LeadId"));
                        sSubject  = CommFun.IsNullCheck(txtSub.EditValue, CommFun.datatypes.vartypestring).ToString();
                        sEmail    = grdViewMail.GetRowCellValue(i, "Email").ToString();
                        if (sEmail != "" && Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "To")) == true)
                        {
                            LeadBL.InsertEmailSent(sEmail, sMobileNo, iLeadId, sSubject);
                        }
                    }
                }
            }

            SetCommParameters();

            if (Convert.ToBoolean(chkSMS.EditValue) == true)
            {
                if (objSMS.IsConnected == true)
                {
                    if (grdViewMail.RowCount > 0)
                    {
                        for (int i = 0; i < grdViewMail.RowCount; i++)
                        {
                            sMobileNo = grdViewMail.GetRowCellValue(i, "Mobile").ToString();
                            sSubject  = txtSub.EditValue.ToString();
                            if (sMobileNo != "" && Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "To")) == true)
                            {
                                SendMessage(sMobileNo, sSubject);
                            }
                        }
                    }
                }
            }
            ClearEntries();

            #endregion

            #region Send Mail Through Mandrill

            //string sSubject = CommFun.IsNullCheck(txtSub.EditValue, CommFun.datatypes.vartypestring).ToString();
            //string sContent = CommFun.IsNullCheck(txtBody.EditValue, CommFun.datatypes.vartypestring).ToString();

            //List<Mandrill.EmailAddress> ToAddress = new List<Mandrill.EmailAddress>();
            //List<Mandrill.EmailAddress> CCAddress = new List<Mandrill.EmailAddress>();
            //List<Mandrill.EmailAddress> BCCAddress = new List<Mandrill.EmailAddress>();
            //if (Convert.ToBoolean(chkMail.EditValue) == true)
            //{
            //    if (grdViewMail.RowCount > 0)
            //    {
            //        for (int i = 0; i < grdViewMail.RowCount; i++)
            //        {
            //            if (Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "To")) == true && grdViewMail.GetRowCellValue(i, "Email").ToString() != string.Empty)
            //            {
            //                ToAddress.Add(new Mandrill.EmailAddress()
            //                {
            //                    name = CommFun.IsNullCheck(grdViewMail.GetRowCellValue(i, "LeadName"), CommFun.datatypes.vartypestring).ToString(),
            //                    email = CommFun.IsNullCheck(grdViewMail.GetRowCellValue(i, "Email"), CommFun.datatypes.vartypestring).ToString()
            //                });
            //            }
            //            if (Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "CC")) == true && grdViewMail.GetRowCellValue(i, "Email").ToString() != string.Empty)
            //            {
            //                CCAddress.Add(new Mandrill.EmailAddress()
            //                {
            //                    name = CommFun.IsNullCheck(grdViewMail.GetRowCellValue(i, "LeadName"), CommFun.datatypes.vartypestring).ToString(),
            //                    email = CommFun.IsNullCheck(grdViewMail.GetRowCellValue(i, "Email"), CommFun.datatypes.vartypestring).ToString()
            //                });
            //            }
            //            if (Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "BCC")) == true && grdViewMail.GetRowCellValue(i, "Email").ToString() != string.Empty)
            //            {
            //                BCCAddress.Add(new Mandrill.EmailAddress()
            //                {
            //                    name = CommFun.IsNullCheck(grdViewMail.GetRowCellValue(i, "LeadName"), CommFun.datatypes.vartypestring).ToString(),
            //                    email = CommFun.IsNullCheck(grdViewMail.GetRowCellValue(i, "Email"), CommFun.datatypes.vartypestring).ToString()
            //                });
            //            }
            //        }
            //    }

            //    List<Mandrill.attachment> mailAttachment = new List<Mandrill.attachment>();
            //    mailAttachment.Add(new Mandrill.attachment() { name = "", content = "", type = "" });

            //    MandrillTemplate.SendBulkMail(ToAddress, sSubject, sContent, mailAttachment);


            //    if (grdViewMail.RowCount > 0)
            //    {
            //        for (int i = 0; i < grdViewMail.RowCount; i++)
            //        {
            //            string sMobileNo = grdViewMail.GetRowCellValue(i, "Mobile").ToString();
            //            int iLeadId = Convert.ToInt32(grdViewMail.GetRowCellValue(i, "LeadId"));
            //            string sEmail = grdViewMail.GetRowCellValue(i, "Email").ToString();
            //            if (sEmail != "" && Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "To")) == true)
            //            {
            //                LeadBL.InsertEmailSent(sEmail, sMobileNo, iLeadId, sSubject);
            //            }
            //        }
            //    }
            //}

            //SetCommParameters();

            //if (Convert.ToBoolean(chkSMS.EditValue) == true)
            //{
            //    if (objSMS.IsConnected == true)
            //    {
            //        if (grdViewMail.RowCount > 0)
            //        {
            //            for (int i = 0; i < grdViewMail.RowCount; i++)
            //            {
            //                string sMobileNo = grdViewMail.GetRowCellValue(i, "Mobile").ToString();
            //                if (sMobileNo != "" && Convert.ToBoolean(grdViewMail.GetRowCellValue(i, "To")) == true)
            //                {
            //                    SendMessage(sMobileNo, sSubject);
            //                }
            //            }
            //        }
            //    }
            //}
            //ClearEntries();

            #endregion
        }
Example #7
0
        private void PopulateData()
        {
            m_bLayOut = false;

            //dETo.EditValue = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            fromDate = Convert.ToDateTime(dEFrm.EditValue);
            if (dETo.EditValue == null)
            {
                dETo.EditValue = Convert.ToDateTime(DateTime.Now);
            }
            toDate = Convert.ToDateTime(dETo.EditValue);
            string fdate = string.Format("{0:dd MMM yyyy}", fromDate);
            string tdate = string.Format("{0:dd MMM yyyy}", toDate);//.AddDays(1));

            dt = new DataTable();
            dt = LeadBL.ShowLeadDate(fdate, tdate, Convert.ToBoolean(chkExec.EditValue));
            DGvTrans.DataSource = dt;
            DGvTrans.ForceInitialize();
            DGvTransView.PopulateColumns();
            DGvTransView.Columns["LeadId"].Visible        = false;
            DGvTransView.Columns["CostCentreId"].Visible  = false;
            DGvTransView.Columns["LeadDate"].Visible      = false;
            DGvTransView.Columns["Mobile"].Visible        = false;
            DGvTransView.Columns["Email"].Visible         = false;
            DGvTransView.Columns["CostCentre"].Visible    = false;
            DGvTransView.Columns["ExecutiveName"].Visible = false;

            DGvTransView.Columns["LeadName"].Width = 240;

            DGvTransView.Columns["LeadId"].OptionsColumn.ShowInCustomizationForm        = false;
            DGvTransView.Columns["CostCentreId"].OptionsColumn.ShowInCustomizationForm  = false;
            DGvTransView.Columns["Email"].OptionsColumn.ShowInCustomizationForm         = false;
            DGvTransView.Columns["CostCentre"].OptionsColumn.ShowInCustomizationForm    = false;
            DGvTransView.Columns["ExecutiveName"].OptionsColumn.ShowInCustomizationForm = false;

            DGvTransView.OptionsCustomization.AllowFilter       = true;
            DGvTransView.OptionsBehavior.AllowIncrementalSearch = true;
            DGvTransView.OptionsView.ShowAutoFilterRow          = true;
            DGvTransView.OptionsView.ShowViewCaption            = false;
            DGvTransView.OptionsView.ShowFooter           = true;
            DGvTransView.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
            DGvTransView.OptionsSelection.InvertSelection = false;
            DGvTransView.OptionsView.ColumnAutoWidth      = false;
            DGvTransView.Appearance.HeaderPanel.Font      = new Font(DGvTransView.Appearance.HeaderPanel.Font, FontStyle.Bold);
            DGvTransView.FocusedRowHandle = 0;
            DGvTransView.FocusedColumn    = DGvTransView.VisibleColumns[0];


            int m_LeadId = 0;

            panelLeadEntry.Controls.Clear();

            if (DGvTransView.FocusedRowHandle >= 0)
            {
                m_LeadId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("LeadId"));
                string      s_LeadName = DGvTransView.GetFocusedRowCellValue("LeadName").ToString();
                int         iCCId      = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CostCentreId"), CommFun.datatypes.vartypenumeric));
                frmLeadInfo LeadInfo   = new frmLeadInfo()
                {
                    TopLevel = false, FormBorderStyle = FormBorderStyle.None, Dock = DockStyle.Fill
                };
                panelLeadEntry.Controls.Add(LeadInfo);
                LeadInfo.Execute("E", m_LeadId, iCCId, "LeadReg");
            }

            DGvTransView.Appearance.HeaderPanel.Font = new Font(DGvTransView.Appearance.HeaderPanel.Font, FontStyle.Bold);

            DGvTransView.Appearance.FocusedCell.BackColor = Color.Teal;
            DGvTransView.Appearance.FocusedCell.ForeColor = Color.White;
            DGvTransView.Appearance.FocusedRow.ForeColor  = Color.Teal;
            DGvTransView.Appearance.FocusedRow.BackColor  = Color.White;

            DGvTransView.OptionsSelection.EnableAppearanceHideSelection = false;
            //DGvTransView.BestFitColumns();
            BsfGlobal.RestoreLayout("CRMLeadRegister", DGvTransView);
            m_bLayOut = true;
        }
Example #8
0
 private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     gridView1.FocusedRowHandle = gridView1.FocusedRowHandle + 1;
     LeadBL.UpdateLeadCheckList(gridControl1.DataSource as DataTable);
     Close();
 }