Пример #1
0
        private void grdCheckView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (barEditItem1.EditValue.ToString() == "Finalisation" && m_sType == "Flat")
            {
                m_sCType = "F";

                int i_CheckListId = Convert.ToInt32(CommFun.IsNullCheck(grdCheckView.GetFocusedRowCellValue("CheckListId"), CommFun.datatypes.vartypenumeric));
                if (i_CheckListId == 1)
                {
                    panelBuyerDetails.Visible = true;

                    string s_Status = UnitDirBL.FlatRegCheckList(m_iId, m_sCType);
                    if (s_Status == "ND")
                    {
                        m_bRegAns = false;
                    }
                    else if (s_Status == "D")
                    {
                        m_bRegAns = true;
                    }
                    else if (s_Status == "CND")
                    {
                        m_bRegAns = false;
                    }

                    if (m_sType == "Flat" && m_bRegAns == true)
                    {
                        DataTable dt = new DataTable();
                        dt = UnitDirBL.FlatBuyer(m_iId);
                        if (dt == null)
                        {
                            return;
                        }
                        if (dt.Rows.Count > 0)
                        {
                            m_iLeadId = Convert.ToInt32(dt.Rows[0]["LeadId"]);
                            txtBuyerName.EditValue = CommFun.IsNullCheck(dt.Rows[0]["LeadName"], CommFun.datatypes.vartypestring).ToString();
                            txtCoAppli.EditValue   = CommFun.IsNullCheck(dt.Rows[0]["CoApplicantName"], CommFun.datatypes.vartypestring).ToString();
                        }
                    }

                    if (m_bRegAns == true)
                    {
                        txtBuyerName.Enabled = false;
                        txtCoAppli.Enabled   = false;
                    }
                    else
                    {
                        txtBuyerName.Enabled = true;
                        txtCoAppli.Enabled   = true;
                    }
                }
                else
                {
                    m_bRegAns = true;
                    panelBuyerDetails.Visible = false;
                }
            }
        }