Beispiel #1
0
 private void DGvTransView_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (m_sType == "C")
     {
         if (dt.Rows.Count > 0)
         {
             //for (int i = 0; i < dt.Rows.Count; i++)
             //{
             if (Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("CallTypeId")) == 1 || Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("CallTypeId")) == 2 || Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("CallTypeId")) == 3 || Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("CallTypeId")) == 4)
             {
                 DGvTransView.Columns["Description"].OptionsColumn.AllowEdit = false;
                 DGvTransView.Columns["Description"].OptionsColumn.ReadOnly  = true;
             }
             else
             {
                 DGvTransView.Columns["Description"].OptionsColumn.AllowEdit = true;
                 DGvTransView.Columns["Description"].OptionsColumn.ReadOnly  = false;
             }
             //}
         }
     }
     else
     {
         DGvTransView.Columns["Description"].OptionsColumn.AllowEdit = true;
         DGvTransView.Columns["Description"].OptionsColumn.ReadOnly  = false;
     }
 }
Beispiel #2
0
        private void btnEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }

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

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

            //frmBank.Execute(iBranchId, "E");
            //fillData();
            if (frmBank.Execute(iBranchId) == true)
            {
                dt = BankBL.GetBankBranchReg(iBranchId);
                if (dt.Rows.Count > 0)
                {
                    DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "BankName", dt.Rows[0]["BankName"].ToString());
                    DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "Branch", dt.Rows[0]["Branch"].ToString());
                    DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "IFSCCode", dt.Rows[0]["IFSCCode"].ToString());
                    DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "IntRate", dt.Rows[0]["IntRate"].ToString());
                }
                dt.Dispose();
            }
        }
Beispiel #3
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;
            }
        }
Beispiel #4
0
        private void DGvTransView_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            if (m_sType == "C")
            {
                if (dt.Rows.Count > 0)
                {
                    if (Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CallTypeId"), CommFun.datatypes.vartypenumeric)) == 1 || Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CallTypeId"), CommFun.datatypes.vartypenumeric)) == 2 || Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CallTypeId"), CommFun.datatypes.vartypenumeric)) == 3 || Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CallTypeId"), CommFun.datatypes.vartypenumeric)) == 4)
                    {
                        DGvTransView.Columns["Description"].OptionsColumn.AllowEdit = false;
                        DGvTransView.Columns["Description"].OptionsColumn.ReadOnly  = true;
                    }

                    else
                    {
                        DGvTransView.Columns["Description"].OptionsColumn.AllowEdit = true;
                        DGvTransView.Columns["Description"].OptionsColumn.ReadOnly  = false;
                    }
                }
            }
            else
            {
                DGvTransView.Columns["Description"].OptionsColumn.AllowEdit = true;
                DGvTransView.Columns["Description"].OptionsColumn.ReadOnly  = false;
            }
        }
Beispiel #5
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;
     }
 }
Beispiel #6
0
        private void FillOtherExecregPost()
        {
            //deTo.EditValue = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            string fdate = string.Format("{0:dd MMM yyyy}", Convert.ToDateTime(deFrom.EditValue));

            if (deTo.EditValue == null)
            {
                deTo.EditValue = Convert.ToDateTime(DateTime.Now);
            }
            string tdate = string.Format("{0:dd MMM yyyy}", Convert.ToDateTime(deTo.EditValue));//.AddDays(1));

            dtCallSht           = new DataTable();
            dtCallSht           = CallSheetEntryBL.GetOtherReportPost(fdate, tdate, Convert.ToBoolean(ChkExec.EditValue));
            DGvTrans.DataSource = dtCallSht;
            DGvTransView.PopulateColumns();
            DGvTransView.Columns["ExecName"].Group();
            DGvTransView.Columns["NextCallDate"].Group();
            DGvTransView.ExpandAllGroups();

            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;
        }
Beispiel #7
0
        public void FillData()
        {
            DGVTrans.DataSource = null;

            BsfGlobal.OpenCRMDB();
            string         sql = "SELECT OtherCostId,OtherCostName,SysDefault FROM OtherCostMaster Where Area=" + iArea + " ORDER BY OtherCostName";
            SqlDataAdapter sda = new SqlDataAdapter(sql, BsfGlobal.g_CRMDB);

            dt = new DataTable();
            sda.Fill(dt);
            sda.Dispose();
            BsfGlobal.g_CRMDB.Close();

            if (dt == null)
            {
                return;
            }

            DGVTrans.DataSource = dt;
            DGVTrans.ForceInitialize();
            DGvTransView.PopulateColumns();
            DGvTransView.Columns["OtherCostId"].Visible = false;
            DGvTransView.Columns["SysDefault"].Visible  = false;
            dt.GetChanges();

            DGvTransView.OptionsView.ShowFooter           = false;
            DGvTransView.OptionsSelection.InvertSelection = true;
            DGvTransView.OptionsSelection.EnableAppearanceHideSelection = false;
            DGvTransView.Appearance.FocusedRow.BackColor = Color.Teal;
            DGvTransView.Appearance.FocusedRow.ForeColor = Color.White;
        }
Beispiel #8
0
 private void DGvTransView_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (Convert.ToBoolean(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("SysDefault"), CommFun.datatypes.vartypenumeric)) == true)
     {
         e.Cancel = true;
     }
 }
Beispiel #9
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //if (BsfGlobal.FindPermission("CallType Master-Delete") == false)
            //{
            //    MessageBox.Show("You don't have Rights to Area Master-Delete");
            //    return;
            //}

            int  iCallTypeId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("CallTypeId"), CommFun.datatypes.vartypenumeric));
            bool bAns = false; bool bAns1 = false;

            bAns  = CallSheetEntryBL.CallTypeMasterFound(iCallTypeId);
            bAns1 = CallSheetEntryBL.CallTypeSysFound(iCallTypeId);
            if (bAns == true)
            {
                MessageBox.Show("Do not Delete, CallType Already Used"); return;
            }
            if (bAns1 == true)
            {
                MessageBox.Show("Do not Delete, Default CallType"); return;
            }

            DialogResult result1 = MessageBox.Show("Are you sure", "CallType Master Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result1 == DialogResult.Yes)
            {
                CallSheetEntryBL.DeleteCallTypeMaster(iCallTypeId);
                DGvTransView.DeleteSelectedRows();
            }
        }
Beispiel #10
0
 private void DGvTransView_RowClick(object sender, RowClickEventArgs e)
 {
     if (DGvTransView.FocusedRowHandle < 0)
     {
         return;
     }
     m_iRegId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("RentId"));
 }
Beispiel #11
0
 private void DGvTransView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     if (DGvTransView.FocusedRowHandle < 0)
     {
         return;
     }
     m_iRegId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("RentId"));
 }
Beispiel #12
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string sSql;

            if (BsfGlobal.FindPermission("OC Master-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to OC Template-Delete");
                return;
            }
            if (Convert.ToBoolean(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("SysDefault"), CommFun.datatypes.vartypenumeric)) == true)
            {
                MessageBox.Show("Do not Delete,Default OtherCost"); return;
            }
            else
            {
                int  iOCId = Convert.ToInt32(CommFun.IsNullCheck(DGvTransView.GetFocusedRowCellValue("OtherCostId"), CommFun.datatypes.vartypenumeric));
                bool bAns  = false;
                sSql = " Select OtherCostId From CCOtherCost Where OtherCostId= " + iOCId + " " +
                       " Union All " +
                       " Select OtherCostId From FlatTypeOtherCost Where OtherCostId= " + iOCId + " " +
                       " Union All " +
                       " Select OtherCostId From FlatOtherCost Where OtherCostId = " + iOCId + " " +
                       " Union All " +
                       " Select OtherCostId From PaymentSchedule Where OtherCostId = " + iOCId + " AND SchType IN('O') " +
                       " Union All " +
                       " Select OtherCostId From PaymentScheduleFlat Where OtherCostId = " + iOCId + " AND SchType IN('O') " +
                       " Union All " +
                       " Select StageId From StageDetails Where StageId = " + iOCId + " AND SchType IN('O') " +
                       " Union All " +
                       " Select StageId From ProgressBillRegister Where StageId = " + iOCId + " AND SchType IN('O') ";
                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, OtherCost Already Used"); return;
                }

                DialogResult result1 = MessageBox.Show("Are you sure", "OtherCost Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result1 == DialogResult.Yes)
                {
                    sSql = String.Format("DELETE FROM OtherCostMaster WHERE OtherCostId={0}", iOCId);
                    using (SqlCommand cmd = new SqlCommand(sSql, BsfGlobal.OpenCRMDB()))
                    {
                        cmd.ExecuteNonQuery();
                        DGvTransView.DeleteSelectedRows();
                    }
                }
            }
        }
Beispiel #13
0
 private void FillEnquiry()
 {
     dt = new DataTable();
     DGvTrans.DataSource = LeadDL.ShowLeadName();
     DGvTrans.ForceInitialize();
     DGvTransView.PopulateColumns();
     DGvTransView.Columns["LeadId"].Visible       = false;
     DGvTransView.Columns["CostCentreId"].Visible = false;
 }
Beispiel #14
0
        public void FillData()
        {
            try
            {
                m_dt = new DataTable();
                m_dt = ComplaintDetBL.Populate_ComplaintRegister(Convert.ToDateTime(dtpFrmDate.EditValue), Convert.ToDateTime(dtpToDate.EditValue));
                DGvTrans.DataSource = m_dt;
                DGvTransView.PopulateColumns();
                DGvTransView.Columns["ComplaintId"].Visible  = false;
                DGvTransView.Columns["CostCentreId"].Visible = false;

                DGvTransView.Columns["ComplaintNo"].Width    = 75;
                DGvTransView.Columns["CostCentreName"].Width = 100;
                DGvTransView.Columns["AttendedBy"].Width     = 100;
                DGvTransView.Columns["FlatNo"].Caption       = CommFun.m_sFuncName + " No";

                DGvTransView.Columns["TransDate"].OptionsColumn.AllowGroup    = DevExpress.Utils.DefaultBoolean.False;
                DGvTransView.Columns["DateAttented"].OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
                DGvTransView.Columns["Approve"].OptionsColumn.AllowGroup      = DevExpress.Utils.DefaultBoolean.False;

                DGvTransView.Columns["ComplaintNo"].AppearanceHeader.TextOptions.HAlignment  = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["ComplaintNo"].AppearanceCell.TextOptions.HAlignment    = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["FlatNo"].AppearanceHeader.TextOptions.HAlignment       = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["FlatNo"].AppearanceCell.TextOptions.HAlignment         = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["TransDate"].AppearanceHeader.TextOptions.HAlignment    = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["TransDate"].AppearanceCell.TextOptions.HAlignment      = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["DateAttented"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["DateAttented"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment      = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["Approve"].AppearanceCell.TextOptions.HAlignment        = DevExpress.Utils.HorzAlignment.Center;


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

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

                DGvTransView.OptionsSelection.EnableAppearanceHideSelection = false;
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Beispiel #15
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);
            }
        }
Beispiel #16
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();
        }
Beispiel #17
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;
        }
        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);
        }
Beispiel #19
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);
             }
         }
     }
 }
Beispiel #20
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);
         }
     }
 }
Beispiel #21
0
        private void btnFilter_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Lead-Filter") == false)
            {
                MessageBox.Show("You don't have Rights to Lead-Filter");
                return;
            }
            DataTable dt = new DataTable();

            m_Filter = "";
            frmFilter fFilter = new frmFilter();

            if (m_dtFil.Rows.Count > 0)
            {
                fFilter.Exe(m_dtFil, fromDate, toDate);
            }

            m_Filter = fFilter.Execute(fromDate, toDate);

            if (m_Filter != "")
            {
                m_dtFil = fFilter.m_dtFilter;

                dt = CommFun.FillRecord(m_Filter);
                DGvTrans.DataSource = dt;
                DGvTrans.ForceInitialize();
                DGvTransView.PopulateColumns();
                DGvTransView.Columns["LeadId"].Visible       = false;
                DGvTransView.Columns["CostCentreId"].Visible = false;

                panelLeadEntry.Controls.Clear();
                frmLeadInfo LeadInfo = new frmLeadInfo()
                {
                    TopLevel = false, FormBorderStyle = FormBorderStyle.None, Dock = DockStyle.Fill
                };
                panelLeadEntry.Controls.Add(LeadInfo);
                LeadInfo.Execute("E", Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("LeadId")), Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("CostCentreId")), "LeadReg");
            }
            else
            {
                m_dtFil.Clear();
                //FillEnquiry();
            }
            DGvTransView.FocusedRowHandle = i;
        }
Beispiel #22
0
        private void DGvTransView_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            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");
            }
        }
Beispiel #23
0
        private void DGvTransView_ColumnFilterChanged(object sender, EventArgs e)
        {
            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(DGvTransView.GetFocusedRowCellValue("CostCentreId"));
                frmLeadInfo LeadInfo   = new frmLeadInfo()
                {
                    TopLevel = false, FormBorderStyle = FormBorderStyle.None, Dock = DockStyle.Fill
                };
                panelLeadEntry.Controls.Add(LeadInfo);
                LeadInfo.Execute("E", m_LeadId, iCCId, "LeadReg");
            }
        }
Beispiel #24
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;
                 }
             }
         }
     }
 }
Beispiel #25
0
        private void btnClear_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Lead-Clear Filter") == false)
            {
                MessageBox.Show("You don't have Rights to Lead-Clear Filter");
                return;
            }
            m_dtFil.Clear();
            DGvTrans.DataSource = null;
            //FillEnquiry();
            PopulateData();

            panelLeadEntry.Controls.Clear();
            frmLeadInfo LeadInfo = new frmLeadInfo()
            {
                TopLevel = false, FormBorderStyle = FormBorderStyle.None, Dock = DockStyle.Fill
            };

            panelLeadEntry.Controls.Add(LeadInfo);
            LeadInfo.Execute("E", Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("LeadId")), Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("CostCentreId")), "LeadReg");
        }
        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);
            }
        }
Beispiel #27
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;
            }
        }
Beispiel #28
0
        public void fillData()
        {
            try
            {
                dt = new DataTable();
                dt = BankBL.GetBankRegister();
                DGvTrans.DataSource = dt;
                DGvTransView.PopulateColumns();
                DGvTransView.Columns["BankId"].Visible   = false;
                DGvTransView.Columns["BranchId"].Visible = false;
                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;
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Beispiel #29
0
        public void UpdateData(string sType, string argDesc, int argId, int rowno)
        {
            string     sSql = string.Empty;
            SqlCommand cmd;
            int        identity;

            if (sType == "C")
            {
                bool bAns = UnitDirBL.FoundCallType(argId, argDesc, sType);
                if (bAns == true)
                {
                    MessageBox.Show("Already Exists"); DGvTransView.CancelUpdateCurrentRow(); return;
                }
                if (argId == 0)
                {
                    sSql     = String.Format("INSERT INTO CallType(Description) Values('{0}') SELECT SCOPE_IDENTITY();", argDesc);
                    cmd      = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    identity = Convert.ToInt16(cmd.ExecuteScalar().ToString());
                    cmd.Dispose();

                    //DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "CallTypeId", identity);
                    //DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "SysDefault", false);


                    sSql = String.Format("Update CallType Set SortID={0} Where CallTypeId= {0}", identity);
                    cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    cmd.ExecuteNonQuery();
                    //CommFun.InsertLog(DateTime.Now, "Followup Setup-Add", "N", "Add Followup Setup", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                    BsfGlobal.InsertLog(DateTime.Now, "Followup Setup-Add", "N", "Add Followup Setup", identity, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                    getData("CallType");
                }

                else
                {
                    if (argId <= 4)
                    {
                        MessageBox.Show("Cant Changes"); return;
                    }
                    else
                    {
                        sSql = String.Format("Update CallType SET Description='{0}',SortId={1}  WHERE CallTypeId={2}", argDesc, rowno, argId);
                        cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                        cmd.ExecuteNonQuery();
                        //CommFun.InsertLog(DateTime.Now, "Followup Setup-Edit", "E", "Edit Followup Setup", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                        BsfGlobal.InsertLog(DateTime.Now, "Followup Setup-Edit", "E", "Edit Followup Setup", argId, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                    }
                }
            }
            else if (sType == "N")
            {
                bool bAns = UnitDirBL.FoundCallType(argId, argDesc, sType);
                if (bAns == true)
                {
                    MessageBox.Show("Already Exists"); DGvTransView.CancelUpdateCurrentRow(); return;
                }
                if (argId == 0)
                {
                    sSql     = String.Format("INSERT INTO NatureMaster(Description) Values('{0}') SELECT SCOPE_IDENTITY(); ", argDesc);
                    cmd      = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    identity = Convert.ToInt16(cmd.ExecuteScalar().ToString());
                    cmd.Dispose();

                    //DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "NatureId", identity);
                    //DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "SysDefault", false);

                    sSql = String.Format("Update NatureMaster Set SortId={0} Where NatureId= {0}", identity);
                    cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    cmd.ExecuteNonQuery();
                    //CommFun.InsertLog(DateTime.Now, "Followup Setup-Add", "N", "Add Followup Setup", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                    BsfGlobal.InsertLog(DateTime.Now, "Followup Setup-Add", "N", "Add Followup Setup", identity, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                    getData("Nature");
                }
                else
                {
                    sSql = String.Format("Update NatureMaster SET Description='{0}',SortId={1}   WHERE NatureId={2}", argDesc, rowno, argId);
                    cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    cmd.ExecuteNonQuery();
                    //CommFun.InsertLog(DateTime.Now, "Followup Setup-Edit", "E", "Edit Followup Setup", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                    BsfGlobal.InsertLog(DateTime.Now, "Followup Setup-Edit", "E", "Edit Followup Setup", argId, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                }
            }
            else if (sType == "S")
            {
                bool bAns = UnitDirBL.FoundCallType(argId, argDesc, sType);
                if (bAns == true)
                {
                    MessageBox.Show("Already Exists"); DGvTransView.CancelUpdateCurrentRow(); return;
                }
                if (argId == 0)
                {
                    sSql     = String.Format("INSERT INTO StatusMaster(Description) Values('{0}') SELECT SCOPE_IDENTITY();", argDesc);
                    cmd      = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    identity = Convert.ToInt16(cmd.ExecuteScalar().ToString());
                    cmd.Dispose();

                    //DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "StatusId", identity);
                    //DGvTransView.SetRowCellValue(DGvTransView.FocusedRowHandle, "SysDefault", false);

                    sSql = String.Format("Update StatusMaster Set SortId={0} Where StatusId= {0}", identity);
                    cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    cmd.ExecuteNonQuery();
                    //CommFun.InsertLog(DateTime.Now, "Followup Setup-Add", "N", "Add Followup Setup", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                    BsfGlobal.InsertLog(DateTime.Now, "Followup Setup-Add", "N", "Add Followup Setup", identity, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                    getData("Status");
                }
                else
                {
                    sSql = String.Format("Update StatusMaster SET Description='{0}',SortId={1}   WHERE StatusId={2}", argDesc, rowno, argId);
                    cmd  = new SqlCommand(sSql, BsfGlobal.OpenCRMDB());
                    cmd.ExecuteNonQuery();
                    //CommFun.InsertLog(DateTime.Now, "Followup Setup-Edit", "E", "Edit Followup Setup", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName);
                    BsfGlobal.InsertLog(DateTime.Now, "Followup Setup-Edit", "E", "Edit Followup Setup", argId, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                }
            }
        }
Beispiel #30
0
 private void DGvTransView_HiddenEditor(object sender, EventArgs e)
 {
     DGvTransView.UpdateCurrentRow();
 }