예제 #1
0
        private void lookUpCity_EditValueChanged(object sender, EventArgs e)
        {
            DataTable dtPlace;

            if (lookUpCity.ItemIndex != 0)
            {
                dtPlace = new DataTable();
                dtPlace = TenantDetBL.Fill_CityDet(Convert.ToInt32(lookUpCity.EditValue));
                if (dtPlace.Rows.Count > 0)
                {
                    txtState.Text = dtPlace.Rows[0]["StateName"].ToString();
                    txtState.Tag  = dtPlace.Rows[0]["StateID"].ToString();
                    txtState.Properties.ReadOnly = true;
                    txtCountry.Text = dtPlace.Rows[0]["CountryName"].ToString();
                    txtCountry.Tag  = dtPlace.Rows[0]["CountryId"].ToString();
                    txtCountry.Properties.ReadOnly = true;
                    dtPlace.Dispose();
                }
                else
                {
                    txtState.Text   = "";
                    txtCountry.Text = "";
                }
            }
        }
예제 #2
0
        public void Getdatalist()
        {
            try
            {
                DataTable dtNcom = new DataTable();
                dtNcom = TenantDetBL.PopulateCostcentre(BsfGlobal.g_lUserId);

                lookUpPro.Properties.DataSource = CommFun.AddSelectToDataTable(dtNcom);
                lookUpPro.Properties.PopulateColumns();
                lookUpPro.Properties.DisplayMember = "CostCentreName";
                lookUpPro.Properties.ValueMember   = "CostCentreId";
                lookUpPro.Properties.Columns["CostCentreId"].Visible = false;
                lookUpPro.Properties.ShowHeader = false;
                lookUpPro.Properties.ShowFooter = false;
                lookUpPro.ItemIndex             = 0;

                DataTable dtct = new DataTable();
                dtct = TenantDetBL.PopulateCity();
                lookUpCity.Properties.DataSource = CommFun.AddSelectToDataTable(dtct);
                lookUpCity.Properties.PopulateColumns();
                //lookUpCity.Properties.ForceInitialize();
                lookUpCity.Properties.DisplayMember             = "CityName";
                lookUpCity.Properties.ValueMember               = "CityId";
                lookUpCity.Properties.Columns["CityId"].Visible = false;
                lookUpCity.Properties.ShowHeader = false;
                lookUpCity.Properties.ShowFooter = false;
                lookUpCity.ItemIndex             = 0;
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
예제 #3
0
        public void UpdateTenant()
        {
            try
            {
                oTtBO = new TenantDetBO();
                TenantDetBO.TenantId     = m_iTenantId;
                TenantDetBO.TenantName   = CommFun.IsNullCheck(txtBrName.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Address1     = CommFun.IsNullCheck(txtAdd1.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Address2     = CommFun.IsNullCheck(txtAdd2.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.City         = Convert.ToInt32(CommFun.IsNullCheck(lookUpCity.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.State        = Convert.ToInt32(CommFun.IsNullCheck(txtState.Tag, CommFun.datatypes.vartypenumeric));
                TenantDetBO.Country      = Convert.ToInt32(CommFun.IsNullCheck(txtCountry.Tag, CommFun.datatypes.vartypenumeric));
                TenantDetBO.Pincode      = CommFun.IsNullCheck(txtPin.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Mobile       = CommFun.IsNullCheck(txtMobile.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.PhoneRes     = CommFun.IsNullCheck(txtPhoneRes.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Email        = CommFun.IsNullCheck(txtEmail.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.EmpPlace     = CommFun.IsNullCheck(textEmployment.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Designation  = CommFun.IsNullCheck(txtjob.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.OffAddress   = CommFun.IsNullCheck(txtOfficeAdd.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.OffPhone     = CommFun.IsNullCheck(txtOfficePh.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.OffEmail     = CommFun.IsNullCheck(txtOfficeEmail.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Commands     = CommFun.IsNullCheck(txtCmd.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.CostCentreId = Convert.ToInt32(CommFun.IsNullCheck(lookUpPro.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.BlockId      = Convert.ToInt32(CommFun.IsNullCheck(lookUpBlock.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.FlatId       = Convert.ToInt32(CommFun.IsNullCheck(lookUpUnit.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.TransDate    = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtCompDate.EditValue, CommFun.datatypes.VarTypeDate));
                TenantDetBO.RefNo        = CommFun.IsNullCheck(txtRefNo.Text, CommFun.datatypes.vartypestring).ToString();

                if (m_iTenantId == 0)
                {
                    bSuccess = TenantDetBL.InsertTenantDetails();
                    BsfGlobal.UpdateMaxNo(26, oVType, 0, 0);
                }
                else
                {
                    if (Convert.ToDateTime(ComplaintDetBO.TransDate) != Convert.ToDateTime(dtCompDate.EditValue))
                    {
                        oVType = new BsfGlobal.VoucherType();
                        if (oVType.PeriodWise == true)
                        {
                            if (BsfGlobal.CheckPeriodChange(Convert.ToDateTime(TenantDetBO.TransDate), Convert.ToDateTime(dtCompDate.EditValue)) == true)
                            {
                                oVType        = BsfGlobal.GetVoucherNo(26, Convert.ToDateTime(dtCompDate.EditValue), 0, 0);
                                txtRefNo.Text = oVType.VoucherNo;
                                BsfGlobal.UpdateMaxNo(26, oVType, 0, 0);
                            }
                        }
                    }
                    bSuccess = TenantDetBL.UpdateTenantDetails();
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
예제 #4
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);
            }
        }
예제 #5
0
 private void lookUpPro_EditValueChanged(object sender, EventArgs e)
 {
     //string sql;
     if (Convert.ToInt32(lookUpPro.EditValue.ToString()) != 0)
     {
         DataTable dt = new DataTable();
         dt = TenantDetBL.PopulateBlock(Convert.ToInt32(lookUpPro.EditValue));
         //sql = "SELECT BlockId,BlockName FROM BlockMaster Where CostCentreId = " + Convert.ToInt32(lookUpPro.EditValue) + "  ORDER BY BlockName";
         lookUpBlock.Properties.DataSource = CommFun.AddSelectToDataTable(dt);
         lookUpBlock.Properties.PopulateColumns();
         lookUpBlock.Properties.DisplayMember = "BlockName";
         lookUpBlock.Properties.ValueMember   = "BlockId";
         lookUpBlock.Properties.Columns["BlockId"].Visible = false;
         lookUpBlock.Properties.ShowHeader = false;
         lookUpBlock.Properties.ShowFooter = false;
         lookUpBlock.EditValue             = 0;
     }
 }
예제 #6
0
        public void FillData()
        {
            try
            {
                m_dt = new DataTable();
                m_dt = TenantDetBL.Fill_TenantDet(m_iTenantId);
                if (m_dt.Rows.Count > 0)
                {
                    txtBrName.Text       = m_dt.Rows[0]["TenantName"].ToString();
                    dtCompDate.EditValue = Convert.ToDateTime(m_dt.Rows[0]["TransDate"].ToString());
                    m_dOldDate           = Convert.ToDateTime(dtCompDate.EditValue);
                    txtRefNo.Text        = m_dt.Rows[0]["RefNo"].ToString();
                    txtAdd1.Text         = m_dt.Rows[0]["Address1"].ToString();
                    txtAdd2.Text         = m_dt.Rows[0]["Address2"].ToString();
                    lookUpCity.EditValue = Convert.ToInt32(m_dt.Rows[0]["CityId"].ToString());
                    txtPin.Text          = m_dt.Rows[0]["Pincode"].ToString();
                    txtMobile.Text       = m_dt.Rows[0]["Mobile"].ToString();
                    txtPhoneRes.Text     = m_dt.Rows[0]["PhoneRes"].ToString();
                    txtEmail.Text        = m_dt.Rows[0]["Email"].ToString();
                    textEmployment.Text  = m_dt.Rows[0]["EmpPlace"].ToString();
                    txtjob.Text          = m_dt.Rows[0]["Designation"].ToString();
                    txtOfficeAdd.Text    = m_dt.Rows[0]["OffAddress"].ToString();
                    txtOfficePh.Text     = m_dt.Rows[0]["OffPhone"].ToString();
                    txtOfficeEmail.Text  = m_dt.Rows[0]["OffEmail"].ToString();
                    txtCmd.Text          = m_dt.Rows[0]["Commands"].ToString();
                    bStatus = false;

                    lookUpPro.EditValue   = Convert.ToInt32(m_dt.Rows[0]["CostCentreId"].ToString());
                    lookUpBlock.EditValue = Convert.ToInt32(m_dt.Rows[0]["BlockId"].ToString());
                    lookUpUnit.EditValue  = Convert.ToInt32(m_dt.Rows[0]["FlatId"].ToString());
                    if (m_dt.Rows[0]["Approve"].ToString() == "Y")
                    {
                        btnSave.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
예제 #7
0
        private void ChangeGridValue(int argEntryId)
        {
            DataTable dt = new DataTable();

            dt = TenantDetBL.Fill_TenantDetChange(argEntryId);
            int iRowId = frmTenantReg.m_oGridMasterView.FocusedRowHandle;

            if (dt.Rows.Count > 0)
            {
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "TransDate", Convert.ToDateTime(CommFun.IsNullCheck(dt.Rows[0]["TransDate"], CommFun.datatypes.VarTypeDate)).ToString("dd/MM/yyyy"));
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "RefNo", CommFun.IsNullCheck(dt.Rows[0]["RefNo"], CommFun.datatypes.vartypestring).ToString());
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "CostCentreName", CommFun.IsNullCheck(dt.Rows[0]["CostCentreName"], CommFun.datatypes.vartypestring).ToString());
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "FlatNo", CommFun.IsNullCheck(dt.Rows[0]["FlatNo"], CommFun.datatypes.vartypestring).ToString());
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "TenantName", CommFun.IsNullCheck(dt.Rows[0]["TenantName"], CommFun.datatypes.vartypestring).ToString());
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "CityName", CommFun.IsNullCheck(dt.Rows[0]["CityName"], CommFun.datatypes.vartypestring).ToString());
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "Mobile", CommFun.IsNullCheck(dt.Rows[0]["Mobile"], CommFun.datatypes.vartypestring).ToString());
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "Email", CommFun.IsNullCheck(dt.Rows[0]["Email"], CommFun.datatypes.vartypestring).ToString());
                frmTenantReg.m_oGridMasterView.SetRowCellValue(iRowId, "Approve", CommFun.IsNullCheck(dt.Rows[0]["Approve"], CommFun.datatypes.vartypestring).ToString());
            }
            dt.Dispose();
        }
예제 #8
0
 private void lookUpBlock_EditValueChanged(object sender, EventArgs e)
 {
     //string sql;
     if (bStatus == true)
     {
         if (lookUpPro.ItemIndex != 0 && lookUpBlock.ItemIndex != 0)
         {
             DataTable dtF = new DataTable();
             dtF = TenantDetBL.PopulateFlat(Convert.ToInt32(lookUpPro.EditValue), Convert.ToInt32(lookUpBlock.EditValue));
             ////sql = "Select FlatId,FlatNo FROM FlatDetails WHERE CostCentreId=" + lookUpPro.EditValue + " and BlockId=" + lookUpBlock.EditValue + " and Status in('S','R') ORDER BY FlatNo";
             //sql = "SELECT A.FlatId,A.FlatNo  FROM FlatDetails A LEFT OUTER JOIN  TenantRegister B on A.FlatId=B.FlatId where B.FlatId IS NULL and A.CostCentreId=" + lookUpPro.EditValue + " and A.BlockId=" + lookUpBlock.EditValue + " and A.Status in('S','R') ORDER BY A.FlatNo ";
             lookUpUnit.Properties.DataSource = CommFun.AddSelectToDataTable(dtF);
             lookUpUnit.Properties.PopulateColumns();
             lookUpUnit.Properties.DisplayMember             = "FlatNo";
             lookUpUnit.Properties.ValueMember               = "FlatId";
             lookUpUnit.Properties.Columns["FlatId"].Visible = false;
             lookUpUnit.Properties.ShowHeader = false;
             lookUpUnit.Properties.ShowFooter = false;
             lookUpUnit.EditValue             = 0;
         }
     }
     else
     {
         if (lookUpPro.ItemIndex != 0 && lookUpBlock.ItemIndex != 0)
         {
             DataTable dtF = new DataTable();
             dtF = TenantDetBL.PopulateFlatSt(Convert.ToInt32(lookUpPro.EditValue), Convert.ToInt32(lookUpBlock.EditValue));
             //sql = "Select FlatId,FlatNo FROM FlatDetails WHERE CostCentreId=" + lookUpPro.EditValue + " and BlockId=" + lookUpBlock.EditValue + " and Status in('S','R') ORDER BY FlatNo";
             lookUpUnit.Properties.DataSource = CommFun.AddSelectToDataTable(dtF);
             lookUpUnit.Properties.PopulateColumns();
             lookUpUnit.Properties.DisplayMember             = "FlatNo";
             lookUpUnit.Properties.ValueMember               = "FlatId";
             lookUpUnit.Properties.Columns["FlatId"].Visible = false;
             lookUpUnit.Properties.ShowHeader = false;
             lookUpUnit.Properties.ShowFooter = false;
             lookUpUnit.EditValue             = 0;
         }
     }
 }
예제 #9
0
 public frmTenantEntry()
 {
     oTtBL = new TenantDetBL();
     InitializeComponent();
 }
예제 #10
0
        public void FillData()
        {
            try
            {
                m_dt = new DataTable();
                m_dt = TenantDetBL.Fill_Tenantregister(Convert.ToDateTime(dtpFrmDate.EditValue), Convert.ToDateTime(dtpToDate.EditValue));
                DGvTrans.DataSource = null;
                DGvTrans.DataSource = m_dt;
                DGvTransView.Columns["TenantId"].Visible   = false;
                DGvTransView.Columns["TenantName"].Visible = true;

                DGvTransView.Columns["CityName"].Visible       = true;
                DGvTransView.Columns["Mobile"].Visible         = true;
                DGvTransView.Columns["Email"].Visible          = true;
                DGvTransView.Columns["CostCentreName"].Visible = true;
                DGvTransView.Columns["FlatNo"].Visible         = true;
                DGvTransView.Columns["FlatNo"].Caption         = CommFun.m_sFuncName + " No";

                DGvTransView.Columns["RefNo"].Width          = 75;
                DGvTransView.Columns["TenantName"].Width     = 100;
                DGvTransView.Columns["CityName"].Width       = 100;
                DGvTransView.Columns["Mobile"].Width         = 80;
                DGvTransView.Columns["Email"].Width          = 100;
                DGvTransView.Columns["CostCentreName"].Width = 100;
                DGvTransView.Columns["FlatNo"].Width         = 70;

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

                DGvTransView.Columns["RefNo"].AppearanceHeader.TextOptions.HAlignment     = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["RefNo"].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["Mobile"].AppearanceHeader.TextOptions.HAlignment    = DevExpress.Utils.HorzAlignment.Center;
                DGvTransView.Columns["Mobile"].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["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);
            }
        }