Exemplo n.º 1
0
        public static DataTable GetCCId(int argLeadID)
        {
            DataTable dt = new DataTable();

            try
            {
                string sSql = "Select CostCentreId From dbo.LeadProjectInfo Where LeadId=" + argLeadID + " And ExecutiveId=0";
                BsfGlobal.OpenCRMDB();
                SqlDataAdapter da = new SqlDataAdapter(sSql, BsfGlobal.g_CRMDB);
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_CRMDB.Close();
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
            return(dt);
        }
Exemplo n.º 2
0
        public DataTable GetCertificate()
        {
            DataTable dt = null;

            try
            {
                string         sSql = "SELECT CertificateId,CerDescription from dbo.CertificateMaster Order by  CerDescription";
                SqlDataAdapter da   = new SqlDataAdapter(sSql, BsfGlobal.OpenVendorAnalDB());
                dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_VendorDB.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }
Exemplo n.º 3
0
        public static DataTable GetPaySchFlat(int argFlatId)
        {
            DataTable dt = new DataTable();

            try
            {
                string sSql = "SELECT * FROM dbo.PaymentScheduleFlat WHERE FlatId=" + argFlatId + "";
                BsfGlobal.OpenCRMDB();
                SqlDataAdapter da = new SqlDataAdapter(sSql, BsfGlobal.g_CRMDB);
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_CRMDB.Close();
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
            return(dt);
        }
Exemplo n.º 4
0
        internal static void InsertFlatCheckList(DataTable dt, int argCheckListId, int argFlatTypeId)
        {
            SqlConnection conn = new SqlConnection();
            SqlCommand    cmd;

            conn = BsfGlobal.OpenCRMDB();
            using (SqlTransaction tran = conn.BeginTransaction())
            {
                string sSql = "";
                try
                {
                    sSql = string.Format("Delete From dbo.FlatChecklist Where FlatId in (Select FlatId from dbo.FlatDetails Where FlatTypeId={0})" +
                                         " AND CheckListId={1}", argFlatTypeId, argCheckListId);
                    cmd = new SqlCommand(sSql, conn, tran);
                    cmd.ExecuteNonQuery();
                    cmd.Dispose();

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        sSql = "INSERT INTO dbo.FlatChecklist (FlatId,CheckListId,ExpCompletionDate,CompletionDate,ExecutiveId,Status,Remarks) VALUES" +
                               " (" + dt.Rows[i]["FlatId"] + "," + argCheckListId + "," +
                               "'" + Convert.ToDateTime(CommFun.IsNullCheck(dt.Rows[i]["ExpCompletionDate"], CommFun.datatypes.VarTypeDate)).ToString("dd-MMM-yyyy") + "'," +
                               "'" + Convert.ToDateTime(CommFun.IsNullCheck(dt.Rows[i]["CompletionDate"], CommFun.datatypes.VarTypeDate)).ToString("dd-MMM-yyyy") + "'," +
                               "" + CommFun.IsNullCheck(dt.Rows[i]["ExecutiveId"], CommFun.datatypes.vartypenumeric) + ",1,'" + dt.Rows[i]["Remarks"] + "')";
                        cmd = new SqlCommand(sSql, conn, tran);
                        cmd.ExecuteNonQuery();
                        cmd.Dispose();
                    }

                    tran.Commit();
                }
                catch (Exception ex)
                {
                    tran.Rollback();
                    BsfGlobal.CustomException(ex.Message, ex.StackTrace);
                }
                finally
                {
                    conn.Close();
                    conn.Dispose();
                }
            }
        }
Exemplo n.º 5
0
        public void FillData()
        {
            try
            {
                m_dtComp = new DataTable();
                m_dtComp = ComplaintDetBL.Fill_ComplaintRegister(m_iComplaintId);
                if (m_dtComp.Rows.Count > 0)
                {
                    cboProj.EditValue            = Convert.ToInt32(m_dtComp.Rows[0]["CostCentreId"].ToString());
                    cboFlatNo.EditValue          = Convert.ToInt32(m_dtComp.Rows[0]["FlatId"].ToString());
                    cboExec.EditValue            = Convert.ToInt32(m_dtComp.Rows[0]["ExecutiveId"].ToString());
                    cboNature.EditValue          = Convert.ToInt32(m_dtComp.Rows[0]["NatureId"].ToString());
                    txtBuyer.Properties.ReadOnly = true;
                    txtBuyer.Tag                  = Convert.ToInt32(m_dtComp.Rows[0]["LeadId"].ToString());
                    txtRemarks.Text               = m_dtComp.Rows[0]["Remarks"].ToString();
                    dtCompDate.EditValue          = Convert.ToDateTime(m_dtComp.Rows[0]["TransDate"].ToString());
                    m_dOldDate                    = Convert.ToDateTime(dtCompDate.EditValue);
                    textCmpNo.Text                = m_dtComp.Rows[0]["complaintNo"].ToString();
                    textCmpNo.Properties.ReadOnly = true;
                    dtAttendDate.EditValue        = Convert.ToDateTime(m_dtComp.Rows[0]["AttDate"].ToString());

                    cboAttnExec.EditValue = Convert.ToInt32(m_dtComp.Rows[0]["ExeAttnId"].ToString());
                    txtAttnRemark.Text    = m_dtComp.Rows[0]["AttnRemarks"].ToString();
                    m_sExtracharge        = m_dtComp.Rows[0]["ChargeType"].ToString();
                    if (m_sExtracharge == "N")
                    {
                        radioGroup1.SelectedIndex = 0;
                    }
                    else
                    {
                        radioGroup1.SelectedIndex = 1;
                    }
                    if (m_dtComp.Rows[0]["Approve"].ToString() == "Y")
                    {
                        btnSave.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Exemplo n.º 6
0
        public DataTable GetCompany()
        {
            DataTable      dt = null;
            SqlDataAdapter sda;
            string         sSql;

            try
            {
                sSql = "SELECT CompanyId,CompanyName from dbo.CompanyMaster";
                sda  = new SqlDataAdapter(sSql, BsfGlobal.OpenWorkFlowDB());
                dt   = new DataTable();
                sda.Fill(dt);
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
            return(dt);
        }
Exemplo n.º 7
0
        public DataTable GetFaCC(string CompanyName)
        {
            DataTable      dt = null;
            SqlDataAdapter sda;
            string         sSql;

            try
            {
                sSql = "select CostCentreId,CostCentreName from dbo.CostCentre";
                sda  = new SqlDataAdapter(sSql, BsfGlobal.OpenWorkFlowDB());
                dt   = new DataTable();
                sda.Fill(dt);
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
            return(dt);
        }
Exemplo n.º 8
0
        public void InsertVendorTemp(string sSql)
        {
            SqlConnection conn;

            conn = new SqlConnection();
            SqlDataAdapter sda;
            DataTable      dt;

            conn = BsfGlobal.OpenVendorAnalDB();
            SqlTransaction tran  = conn.BeginTransaction();
            string         sTSql = "";

            try
            {
                sTSql = "Truncate Table TmpVendor";
                SqlCommand cmd = new SqlCommand(sTSql, conn, tran);
                cmd.ExecuteNonQuery();
                cmd.Dispose();
                dt  = new DataTable();
                sda = new SqlDataAdapter(sSql, BsfGlobal.OpenVendorAnalDB());
                sda.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        sTSql = "Insert Into TmpVendor (VendorId) Values (" + Convert.ToInt16(dt.Rows[i]["VendorId"]) + ")";
                        cmd   = new SqlCommand(sTSql, conn, tran);
                        cmd.ExecuteNonQuery();
                        cmd.Dispose();
                    }
                }
                tran.Commit();
            }
            catch
            {
                tran.Rollback();
            }
            finally
            {
                conn.Close();
                BsfGlobal.g_VendorDB.Close();
            }
        }
Exemplo n.º 9
0
        public DataTable GetStateData(int argID)
        {
            DataTable dt = null;

            try
            {
                string         sSql = "SELECT StateName,CountryId from dbo.StateMaster Where StateID = " + argID;
                SqlDataAdapter da   = new SqlDataAdapter(sSql, BsfGlobal.OpenWorkFlowDB());
                dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_WorkFlowDB.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }
Exemplo n.º 10
0
        public DataTable GetCountryList()
        {
            DataTable dt = null;

            try
            {
                string         sSql = "SELECT CountryId,CountryName from dbo.CountryMaster Order by CountryName";
                SqlDataAdapter da   = new SqlDataAdapter(sSql, BsfGlobal.OpenWorkFlowDB());
                dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_WorkFlowDB.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }
Exemplo n.º 11
0
        public static bool InsertTenantDetails()
        {
            int           iFTypeId = 0;
            bool          bUpdate;
            SqlConnection conn = new SqlConnection();
            SqlCommand    cmd;

            conn = BsfGlobal.OpenCRMDB();
            using (SqlTransaction tran = conn.BeginTransaction())
            {
                try
                {
                    string sSql = String.Format("INSERT INTO TenantRegister(TenantName,Address1,Address2,CityId,StateId,CountryId,Pincode,Mobile,PhoneRes,Email, EmpPlace,Designation,OffAddress,OffPhone,OffEmail,Commands,CostCentreId,BlockId,FlatId,TransDate,RefNo) VALUES('{0}', '{1}', '{2}','{3}','{4}', '{5}','{6}','{7}','{8}', '{9}','{10}','{11}', '{12}','{13}','{14}','{15}',{16},{17},{18},'{19}','{20}' ) SELECT SCOPE_IDENTITY()", TenantDetBO.TenantName, TenantDetBO.Address1, TenantDetBO.Address2, TenantDetBO.City, TenantDetBO.State, TenantDetBO.Country, TenantDetBO.Pincode, TenantDetBO.Mobile, TenantDetBO.PhoneRes, TenantDetBO.Email, TenantDetBO.EmpPlace, TenantDetBO.Designation, TenantDetBO.OffAddress, TenantDetBO.OffPhone, TenantDetBO.OffEmail, TenantDetBO.Commands, TenantDetBO.CostCentreId, TenantDetBO.BlockId, TenantDetBO.FlatId, TenantDetBO.TransDate, TenantDetBO.RefNo);
                    cmd      = new SqlCommand(sSql, conn, tran);
                    iFTypeId = int.Parse(cmd.ExecuteScalar().ToString());
                    cmd.Dispose();

                    //sSql1 = "INSERT INTO TenantTrans(CostCentreId,BlockId,UnitId,TenantId) values( " + TenantDetBO.CostCentreId + ", " + TenantDetBO.BlockId + ", " + TenantDetBO.UnitId + ", " + iFTypeId + ")";
                    //        //CommFun.CRMExecute(sSql);
                    //        cmd = new SqlCommand(sSql1, conn, tran);
                    //        cmd.ExecuteNonQuery();
                    //        cmd.Dispose();


                    tran.Commit();
                    bUpdate = true;
                    BsfGlobal.InsertLog(DateTime.Now, "Tenant-Add", "N", "Tenant", iFTypeId, TenantDetBO.CostCentreId, 0, BsfGlobal.g_sCRMDBName, TenantDetBO.RefNo, BsfGlobal.g_lUserId);
                }
                catch (Exception ex)
                {
                    tran.Rollback();
                    bUpdate = false;
                    System.Windows.Forms.MessageBox.Show(ex.Message, "PMS", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                    BsfGlobal.CustomException(ex.Message, ex.StackTrace);
                }
                finally
                {
                    conn.Close();
                    conn.Dispose();
                }
            }
            return(bUpdate);
        }
Exemplo n.º 12
0
        public void FillExecutive(SqlConnection Con, int argExecId)
        {
            SqlDataAdapter sd;
            DataTable      dt;

            try
            {
                sd = new SqlDataAdapter("FillExec", Con);
                sd.SelectCommand.CommandType = CommandType.StoredProcedure;
                sd.SelectCommand.Parameters.Clear();
                sd.SelectCommand.Parameters.AddWithValue("@ExecId", argExecId);
                dt = new DataTable();
                sd.Fill(dt);
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Exemplo n.º 13
0
        private void AddNewEntry()
        {
            try
            {
                if (m_dtComPList.Columns.Count > 0)
                {
                }
                else
                {
                    m_dtComPList.Columns.Add("ServiceId");
                    m_dtComPList.Columns.Add("Description", typeof(string));
                    m_dtComPList.Columns.Add("Amount", typeof(double));
                }
                grdService.DataSource = m_dtComPList;
                grdViewService.PopulateColumns();

                RepositoryItemButtonEdit btnSpc = new RepositoryItemButtonEdit();
                btnSpc.LookAndFeel.SkinName = "Blue";
                btnSpc.LookAndFeel.UseDefaultLookAndFeel = false;
                btnSpc.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
                grdViewService.Columns["Description"].ColumnEdit = btnSpc;

                RepositoryItemTextEdit txtEditAmt = new RepositoryItemTextEdit();
                txtEditAmt.LookAndFeel.UseDefaultLookAndFeel = false;
                txtEditAmt.Mask.EditMask = BsfGlobal.g_sDigitFormat;
                txtEditAmt.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                txtEditAmt.Mask.UseMaskAsDisplayFormat = true;
                txtEditAmt.Validating += txtEditAmt_Validating;
                txtEditAmt.Spin       += new DevExpress.XtraEditors.Controls.SpinEventHandler(txtEditAmt_Spin);
                txtEditAmt.KeyDown    += txtEditAmt_KeyDown;
                grdViewService.Columns["Amount"].ColumnEdit = txtEditAmt;
                grdViewService.Columns["ServiceId"].Visible = false;
                grdViewService.Columns["Description"].Width = 460;
                grdViewService.Columns["Amount"].Width      = 100;

                grdViewService.OptionsView.ColumnAutoWidth = true;
                grdViewService.Appearance.HeaderPanel.Font = new Font(grdViewService.Appearance.HeaderPanel.Font, FontStyle.Bold);
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Exemplo n.º 14
0
        public DataTable GetVendorList()
        {
            DataTable dt = null;

            try
            {
                string         sSql = "Select VendorId,VendorName,Supply,Contract,Service from VendorMaster Order by VendorName";
                SqlDataAdapter da   = new SqlDataAdapter(sSql, BsfGlobal.OpenVendorAnalDB());
                dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_VendorDB.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }
Exemplo n.º 15
0
        public DataTable GetGuestHouse(SqlConnection Con)
        {
            DataTable      dtguestHouse = null;
            SqlDataAdapter sda;

            try
            {
                sda          = new SqlDataAdapter("SELECT GuestHouseId as Id,Description FROM dbo.GuestHouse Order By Description", Con);
                dtguestHouse = new DataTable();
                sda.Fill(dtguestHouse);
                dtguestHouse.Dispose();
            }

            catch (Exception e)
            {
                BsfGlobal.CustomException(e.Message, e.StackTrace);
            }
            return(dtguestHouse);
        }
Exemplo n.º 16
0
        internal static int InsertIncGen(string argMode, IncentiveBO IncGenBO)
        {
            BsfGlobal.OpenCRMDB();
            string     ssql = "";
            SqlCommand scmd;
            string     s_Date     = "";
            string     s_From     = "";
            string     s_To       = "";
            int        i_IncGenId = 0;

            try
            {
                s_Date = string.Format("{0:dd/MMM/yyyy}", IncGenBO.DE_Date);
                s_From = string.Format("{0:dd/MMM/yyyy}", IncGenBO.DE_From);
                s_To   = string.Format("{0:dd/MMM/yyyy}", IncGenBO.DE_To);

                if (argMode == "A")
                {
                    ssql                = String.Format("Insert Into dbo.IncentiveRegister(IDate, IRefNo, FDate, TDate, TotalAmount, Narration) Values('{0}', '{1}', '{2}', '{3}', {4}, '{5}') SELECT SCOPE_IDENTITY();", s_Date, IncGenBO.s_RefNo, s_From, s_To, IncGenBO.d_TotalAmount, IncGenBO.s_Narration);
                    scmd                = new SqlCommand(ssql, BsfGlobal.g_CRMDB);
                    i_IncGenId          = Convert.ToInt32(scmd.ExecuteScalar().ToString());
                    IncGenBO.i_IncGenId = i_IncGenId;
                    scmd.Dispose();
                }
                else
                {
                    ssql = String.Format("Update dbo.IncentiveRegister set IDate='{0}', IRefNo='{1}', FDate='{2}', TDate='{3}', TotalAmount={4}, Narration='{5}' Where IncentiveId={6}", s_Date, IncGenBO.s_RefNo, s_From, s_To, IncGenBO.d_TotalAmount, IncGenBO.s_Narration, IncGenBO.i_IncGenId);
                    scmd = new SqlCommand(ssql, BsfGlobal.g_CRMDB);
                    scmd.ExecuteNonQuery();
                    scmd.Dispose();
                }
            }
            catch (Exception e)
            {
                BsfGlobal.CustomException(e.Message, e.StackTrace);
            }
            finally
            {
                BsfGlobal.g_CRMDB.Close();
            }
            return(i_IncGenId);
        }
Exemplo n.º 17
0
        public void InsertVendorContact(Vendor.BusinessLayer.ContactBL argContact)
        {
            SqlConnection conn;

            conn = new SqlConnection();
            conn = BsfGlobal.OpenVendorAnalDB();
            SqlTransaction tran = conn.BeginTransaction();

            try
            {
                SqlCommand Command = new SqlCommand("Insert_Vendor_Contact", conn, tran);
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();
                Command.Parameters.AddWithValue("@VendorId", argContact.VendorId);
                Command.Parameters.AddWithValue("@CAddress", argContact.Address);
                Command.Parameters.AddWithValue("@Phone1", argContact.Phone1);
                Command.Parameters.AddWithValue("@Phone2", argContact.Phone2);
                Command.Parameters.AddWithValue("@Fax1", argContact.Fax1);
                Command.Parameters.AddWithValue("@Fax2", argContact.Fax2);
                Command.Parameters.AddWithValue("@Mobile1", argContact.Mobile1);
                Command.Parameters.AddWithValue("@Mobile2", argContact.Mobile2);
                Command.Parameters.AddWithValue("@CPerson1", argContact.CPerson1);
                Command.Parameters.AddWithValue("@CPerson2", argContact.CPerson2);
                Command.Parameters.AddWithValue("@CDesignation1", argContact.CDesignation1);
                Command.Parameters.AddWithValue("@CDesignation2", argContact.CDesignation2);
                Command.Parameters.AddWithValue("@ContactNo1", argContact.ContactNo1);
                Command.Parameters.AddWithValue("@ContactNo2", argContact.ContactNo2);
                Command.Parameters.AddWithValue("@Email1", argContact.Email1);
                Command.Parameters.AddWithValue("@Email2", argContact.Email2);
                Command.Parameters.AddWithValue("@WebName", argContact.Web);
                Command.ExecuteNonQuery();
                tran.Commit();
            }
            catch
            {
                tran.Rollback();
            }
            finally
            {
                conn.Close();
            }
        }
Exemplo n.º 18
0
        public void CheckPermission()
        {
            if (BsfGlobal.g_sUnPermissionMode == "H")
            {
                if (BsfGlobal.FindPermission("Extra Item-Add") == false)
                {
                    btnAdd.Visibility = BarItemVisibility.Never;
                }
                if (BsfGlobal.FindPermission("Extra Item-Modify") == false)
                {
                    btnEdit.Visibility = BarItemVisibility.Never;
                }
                if (BsfGlobal.FindPermission("Extra Item-Delete") == false)
                {
                    btnDelete.Visibility = BarItemVisibility.Never;
                }
                if (BsfGlobal.FindPermission("Extra Item-Print") == false)
                {
                    barButtonItem1.Visibility = BarItemVisibility.Never;
                }

                else if (BsfGlobal.g_sUnPermissionMode == "D")
                {
                    if (BsfGlobal.FindPermission("Extra Item-Add") == false)
                    {
                        btnAdd.Enabled = false;
                    }
                }
                if (BsfGlobal.FindPermission("Extra Item-Modify") == false)
                {
                    btnEdit.Enabled = false;
                }
                if (BsfGlobal.FindPermission("Extra Item-Delete") == false)
                {
                    btnDelete.Enabled = false;
                }
                if (BsfGlobal.FindPermission("Extra Item-Print") == false)
                {
                    barButtonItem1.Enabled = false;
                }
            }
        }
Exemplo n.º 19
0
        public static DataTable GetSoldUnits(int argExecId, int argCCId, DateTime argAsOnDate, DateTime argFromDate, DateTime argToDate, string argType)
        {
            DataTable ds   = new DataTable();
            string    sSql = "";

            ////sSql = "Select A.FlatNo,C.LeadName,EmployeeName ExecName,C.LeadType,A.BaseAmt From FlatDetails A Inner Join BuyerDetail B On A.FlatId=B.FlatId" +
            ////        " Inner Join LeadRegister C On A.LeadId=C.LeadId " +
            ////        " Left Join [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.Users D On D.UserId=B.ExecutiveId" +
            ////        " Left Join [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.Position E on E.PositionId=D.PositionId Where E.PositionType='M' And" +
            ////        " C.ExecutiveId=" + argExecId + " And A.CostCentreId=" + argCCId + "";
            if (argType == "AsOn")
            {
                sSql = "Select A.FlatNo,C.LeadName,Case When D.EmployeeName='' Then D.UserName Else D.EmployeeName End As ExecName,C.LeadType,A.BaseAmt From dbo.FlatDetails A " +
                       " Inner Join dbo.BuyerDetail B On A.LeadId=B.LeadId " + //A.FlatId=B.FlatId " +
                       " Inner Join dbo.LeadRegister C On A.LeadId=C.LeadId  " +
                       " Left Join [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.Users D On D.UserId=B.ExecutiveId " +
                       " Left Join [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.Position E " +
                       " On E.PositionId=D.PositionId Inner Join dbo.LeadExecutiveInfo F On F.LeadId=C.LeadId" +
                       " Where E.PositionType='M' And F.ExecutiveId=" + argExecId + " And A.CostCentreId=" + argCCId + " " +
                       " And FinaliseDate <= '" + argAsOnDate.ToString("dd-MMM-yyyy") + "' ";
            }
            else
            {
                sSql = "Select A.FlatNo,C.LeadName,Case When D.EmployeeName='' Then D.UserName Else D.EmployeeName End As ExecName,C.LeadType,A.BaseAmt From dbo.FlatDetails A " +
                       " Inner Join dbo.BuyerDetail B On A.LeadId=B.LeadId " +//A.FlatId=B.FlatId " +
                       " Inner Join dbo.LeadRegister C On A.LeadId=C.LeadId  " +
                       " Left Join [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.Users D On D.UserId=B.ExecutiveId " +
                       " Left Join [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.Position E " +
                       " On E.PositionId=D.PositionId Inner Join dbo.LeadExecutiveInfo F On F.LeadId=C.LeadId" +
                       " Where E.PositionType='M' And F.ExecutiveId=" + argExecId + " And A.CostCentreId=" + argCCId + " " +
                       " And FinaliseDate Between '" + argFromDate.ToString("dd-MMM-yyyy") + "' And '" + argToDate.ToString("dd-MMM-yyyy") + "' ";
            }
            BsfGlobal.OpenCRMDB();
            SqlDataAdapter da = new SqlDataAdapter(sSql, BsfGlobal.g_CRMDB);

            da.Fill(ds);
            da.Dispose();

            BsfGlobal.g_CRMDB.Close();

            return(ds);
        }
Exemplo n.º 20
0
        public void UpdateVendorMaster(Vendor.BusinessLayer.VendorBL argVendor)
        {
            SqlConnection conn;

            conn = new SqlConnection();
            conn = BsfGlobal.OpenVendorAnalDB();
            SqlTransaction tran = conn.BeginTransaction();

            try
            {
                SqlCommand Command = new SqlCommand("Update_VendorMaster", conn, tran);
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();
                Command.Parameters.AddWithValue("@VendorId", argVendor.VendorId);
                Command.Parameters.AddWithValue("@VendorName", argVendor.VendorName);
                Command.Parameters.AddWithValue("@Supply", argVendor.Supply);
                Command.Parameters.AddWithValue("@Contract", argVendor.Contract);
                Command.Parameters.AddWithValue("@Service", argVendor.Service);
                Command.Parameters.AddWithValue("@Address", argVendor.RegAddress);
                Command.Parameters.AddWithValue("@CityId", argVendor.CityId);
                Command.Parameters.AddWithValue("@Pin", argVendor.PinNo);
                Command.Parameters.AddWithValue("@STypeId", argVendor.STypeId);
                Command.Parameters.AddWithValue("@Company", argVendor.iCompany);
                Command.Parameters.AddWithValue("@SuppTypeId", argVendor.SuppTypeId);
                Command.Parameters.AddWithValue("@ChequeNo", argVendor.ChequeNo);
                Command.Parameters.AddWithValue("@Code", argVendor.Code);
                Command.ExecuteNonQuery();
                tran.Commit();
                if (BsfGlobal.g_bFADB == true)
                {
                    BsfGlobal.RefreshSubLedger(1);
                }
            }
            catch
            {
                tran.Rollback();
            }
            finally
            {
                conn.Close();
            }
        }
Exemplo n.º 21
0
 public static void UpdateCheckList(CheckListBO argObject)
 {
     try
     {
         SqlCommand cmd;
         string     sSql = "Update dbo.CheckListMaster set CheckListName='" + argObject.CheckListName + "',TypeName='" + argObject.TypeName + "' Where CheckListId=" + argObject.CheckListId + "";
         BsfGlobal.OpenCRMDB();
         cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB);
         cmd.ExecuteNonQuery();
         cmd.Dispose();
     }
     catch (Exception ex)
     {
         BsfGlobal.CustomException(ex.Message, ex.StackTrace);
     }
     finally
     {
         BsfGlobal.g_CRMDB.Close();
     }
 }
Exemplo n.º 22
0
        public DataTable GetLogistics(int argVendorId)
        {
            DataTable dt = null;

            try
            {
                string sSql = "SELECT VendorId,TransportArrange,TransportMode,Delivery,Insurance,Unload " +
                              "from Logistics Where VendorId= " + argVendorId;
                SqlDataAdapter da = new SqlDataAdapter(sSql, BsfGlobal.OpenVendorAnalDB());
                dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_VendorDB.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }
Exemplo n.º 23
0
        public DataTable GetCostCentre()
        {
            DataTable      dtCC = null;
            SqlDataAdapter sda;

            try
            {
                sda  = new SqlDataAdapter("SELECT CostCentreId as [Id],CostCentreName as Description,Cast(0 as Bit) as Sel FROM [" + BsfGlobal.g_sWorkFlowDBName + "].dbo.OperationalCostCentre Order By CostCentreName", BsfGlobal.OpenCRMDB());
                dtCC = new DataTable();
                sda.Fill(dtCC);
                dtCC.AcceptChanges();
                dtCC.Dispose();
            }

            catch (Exception e)
            {
                BsfGlobal.CustomException(e.Message, e.StackTrace);
            }
            return(dtCC);
        }
Exemplo n.º 24
0
        public DataTable GetVendorMasterInfo(int argVendorId)
        {
            DataTable dt = null;

            try
            {
                string sSql = "Select VendorId,VendorName,Supply,Contract,Service,RegAddress,CityId,PinCode,ChequeNo,Code From VendorMaster " +
                              "Where VendorId= " + argVendorId;
                SqlDataAdapter da = new SqlDataAdapter(sSql, BsfGlobal.OpenVendorAnalDB());
                dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_VendorDB.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }
Exemplo n.º 25
0
        public static void InsertFlatTypeMaster(string argDesc)
        {
            BsfGlobal.OpenCRMDB();
            string     sSql = "";
            SqlCommand cmd  = null;

            try
            {
                sSql = "Insert Into dbo.FlatTypeMaster(FlatTypeName)Values('" + argDesc + "')";
                cmd  = new SqlCommand(sSql, BsfGlobal.g_CRMDB);
                cmd.ExecuteNonQuery();
                cmd.Dispose();

                BsfGlobal.g_CRMDB.Close();
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Exemplo n.º 26
0
        public static void DeleteFlatTypeMaster(int argCompId)
        {
            BsfGlobal.OpenCRMDB();
            string     sSql = "";
            SqlCommand cmd  = null;

            try
            {
                sSql = "Delete From dbo.FlatTypeMaster Where FlatTypeId = " + argCompId;
                cmd  = new SqlCommand(sSql, BsfGlobal.g_CRMDB);
                cmd.ExecuteNonQuery();
                cmd.Dispose();

                BsfGlobal.g_CRMDB.Close();
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Exemplo n.º 27
0
 public static void UpdatePanel(bool argAddr, bool argLive, int argUserId)
 {
     try
     {
         SqlCommand cmd;
         string     sSql = "Update dbo.UserLogin Set EditAddress='" + argAddr + "',Live='" + argLive + "' Where UserId=" + argUserId + "";
         BsfGlobal.OpenCRMDB();
         cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB);
         cmd.ExecuteNonQuery();
         cmd.Dispose();
     }
     catch (Exception ex)
     {
         BsfGlobal.CustomException(ex.Message, ex.StackTrace);
     }
     finally
     {
         BsfGlobal.g_CRMDB.Close();
     }
 }
Exemplo n.º 28
0
        public static void UpdateCompetitorMaster(int argCompId, string argCompName)
        {
            BsfGlobal.OpenCRMDB();
            string     sSql = "";
            SqlCommand cmd  = null;

            try
            {
                sSql = "Update dbo.CompetitorMaster Set CompetitorName= '" + argCompName + "' Where CompetitorId = " + argCompId;
                cmd  = new SqlCommand(sSql, BsfGlobal.g_CRMDB);
                cmd.ExecuteNonQuery();
                cmd.Dispose();

                BsfGlobal.g_CRMDB.Close();
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Exemplo n.º 29
0
        private void VendorView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (e.FocusedRowHandle < 0)
            {
                return;
            }
            int iVendorId = Convert.ToInt32(VendorView.GetRowCellValue(e.FocusedRowHandle, "VendorId").ToString());

            lblVendor.Text = VendorView.GetRowCellValue(e.FocusedRowHandle, "VendorName").ToString();
            VendorName     = VendorView.GetFocusedRowCellValue("VendorName").ToString();
            PopulateRegDetails(iVendorId);
            GetGradeDetails();
            GetValidToDate();
            PopulateVendorGeneral(iVendorId);
            BsfGlobal.ClearUserUsage("Vendor-Master-Edit", iVendorId, BsfGlobal.g_sVendorDBName);
            //GetGradeDetails();
            //if (m_tSupplyGrade == null) txtGSupplier.Text = "";
            //if (m_tContractGrade == null) txtGContractor.Text = "";
            //if (m_tServiceGrade == null) txtGService.Text = "";
        }
Exemplo n.º 30
0
        public DataTable GetExperience(int argVendorId)
        {
            DataTable dt = null;

            try
            {
                string sSql = "Select ExperienceId,VendorId,WorkDescription,ClientName,Value,Period,Type " +
                              "from dbo.VendorExperience Where VendorId = " + argVendorId;
                SqlDataAdapter da = new SqlDataAdapter(sSql, BsfGlobal.OpenVendorAnalDB());
                dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                BsfGlobal.g_VendorDB.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }