Beispiel #1
0
    //POPULATINGS
    protected void populate_DDL_Acq()
    {
        DropDownListAcquereurs.Items.Clear();
        DropDownListAcquereurs.Items.Add(new ListItem(" ", "0"));


        Membre member3 = (Membre)Session["Membre"];

        #region Peuplement de DropDownListAcquereurs
        //Peuplement des DropdownList à partir de la table table_types
        string requette = "select `id_acq`, `nom`, `prenom`, `adresse`, `ville`, `code_postal`, `tel`, `mail` from Acquereurs where `idclient`=" + member3.IDCLIENT + "AND `actif`='actif'";

        System.Data.DataSet ds = null;
        Connexion           c  = null;

        c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c = null;

        System.Data.DataRowCollection dr = ds.Tables[0].Rows;
        foreach (System.Data.DataRow ligne in dr)
        {
            if (ligne["nom"].ToString() != "null")
            {
                DropDownListAcquereurs.Items.Add(new ListItem(ligne["nom"].ToString() + " " + ligne["prenom"].ToString() + " " + ligne["adresse"].ToString() + " " + ligne["ville"].ToString() + " " + ligne["code_postal"].ToString() + " " + ligne["tel"].ToString() + " " + ligne["mail"].ToString(), ligne["id_acq"].ToString()));
            }
        }
        #endregion
    }
        private static void AddSaleToDatabase(
            int rowsCount,
            DataRowCollection rows,
            MSSQLContext context,
            Supermarket supermarket,
            DateTime saleDate)
        {
            const int startRow = 3;

            for (int i = startRow; i < rowsCount - 1; i++)
            {
                string productName = rows[i][1].ToString();
                int quantity = int.Parse(rows[i][2].ToString());
                decimal price = decimal.Parse(rows[i][3].ToString());

                Product product = context.Products.FirstOrDefault(p => p.Name == productName);

                var sale = new Sale()
                {
                    Supermarket = supermarket,
                    Product = product,
                    SaleDate = saleDate,
                    SalePrice = price,
                    Quantity = quantity
                };

                context.Sales.Add(sale);
                context.SaveChanges();
            }
        }
Beispiel #3
0
        public static Dictionary<Object, Object> creaDic(DataRowCollection drc)
        {
            //Agregamos
            List<Object> listas = new List<object>();
            Dictionary<Object, Object> Dicc = new Dictionary<Object, Object>();
            foreach (DataRow st in drc)
            {
                List<Object> lsTemp = new List<Object>();
                foreach (Object valor in st.ItemArray)
                {
                    lsTemp.Add(valor);
                }
                listas.Add(lsTemp);
            }

            foreach (List<Object> ls in listas)
            {
                foreach (Object obj in ls)
                {
                    Debug.WriteLine("valor: " + obj.ToString());
                }
                Debug.WriteLine(ls[0] + " : " + ls[1]);
                Debug.WriteLine("**termina lista");
                Dicc.Add(ls[0], ls[1]);
            }
            return Dicc;
        }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String idBien = (String)Session["idbien"];
        //String requete = "SELECT 'etat civil vendeur','nom vendeur','adresse vendeur','code postal vendeur','ville vendeur','prix de vente','net vendeur','adresse du bien','code postal du bien','ville du bien' from Biens where 'ref'='" + idBien + "'";
        String requete = "SELECT * from Biens where ref='" + idBien + "'";

        Connexion c2 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c2.Open();
        System.Data.DataSet ds2 = c2.exeRequette(requete);
        c2.Close();
        System.Data.DataRowCollection dr = ds2.Tables[0].Rows;
        dr = ds2.Tables[0].Rows;
        foreach (System.Data.DataRow ligne in dr)
        {
            firstRow.Text  = ligne["etat civil vendeur"] + " " + ligne["nom vendeur"] + "</br>";
            secondRow.Text = ligne["adresse vendeur"].ToString() + "</br>";

            thirdRow.Text = ligne["code postal vendeur"].ToString() + " " + ligne["ville vendeur"].ToString() + "</br>";

            fourthRow.Text = ligne["net vendeur"].ToString() + " ";

            fifthRow.Text   = ligne["etat civil vendeur"].ToString() + " " + ligne["nom vendeur"].ToString() + " ";
            sixthRow.Text   = ligne["adresse vendeur"].ToString() + " " + ligne["code postal vendeur"].ToString() + " " + ligne["ville vendeur"].ToString() + " ";
            seventhRow.Text = ligne["adresse du bien"].ToString() + " " + ligne["code postal du bien"].ToString() + " " + ligne["ville du bien"].ToString() + " ";
            eigthRow.Text   = ligne["prix de vente"].ToString() + " ";
            Label1.Text     = ligne["negociateur"].ToString();
        }
    }
Beispiel #5
0
        public static string GetURLFromData(Size size, DataRowCollection rows, string name_row, string data_row)
        {
            if (rows == null || String.IsNullOrEmpty (name_row) || String.IsNullOrEmpty (data_row))
                return null;

            // http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World

            StringBuilder labels = new StringBuilder ();
            labels.Append ("chl=");
            StringBuilder data = new StringBuilder ();
            data.Append ("chd=t:");
            int min = Int32.MaxValue;
            int max = Int32.MinValue;
            foreach (DataRow row in rows) {
                labels.AppendFormat ("{0}|", HttpUtility.UrlEncode (row [name_row].ToString ()));
                int val = Convert.ToInt32 (row [data_row]);
                data.AppendFormat ("{0},", val);
                if (val < min)
                    min = val;
                if (val > max)
                    max = val;
            }

            if (rows.Count > 0) {
                labels.Length--;
                data.Length--;
            }
            return String.Format ("http://chart.apis.google.com/chart?cht=p3&chs={2}x{3}&{0}&{1}&chds=0,{5}",
                            data.ToString (),
                            labels.ToString (),
                            size.Width, size.Height,
                            min, max);
        }
    protected String get_Freq_envoi(String Site)
    {
        String frequence = "0";

        c.Open();
        System.Data.DataSet ds = c.exeRequette("SELECT * FROM passerelle WHERE Site = '" + Site + "'");
        c.Close();
        System.Data.DataRowCollection dr = ds.Tables[0].Rows;

        if (dr[0]["Frequence"] != null)
        {
            frequence = dr[0]["Frequence"].ToString();
        }

        if (frequence == "0.5")
        {
            frequence = "demi";
        }
        if (frequence == "0.25")
        {
            frequence = "quart d'";
        }

        return(frequence);
    }
Beispiel #7
0
 public SpeechTyping()
 {
     InitializeComponent();
     txtBox1.ScrollBars = ScrollBars.Vertical;
     using (StringReader readerxmlpath1 = new StringReader(xmlpath1))
     { ds1.ReadXml(readerxmlpath1); }
     using (StringReader readerxmlpath2 = new StringReader(xmlpath2))
     { ds2.ReadXml(readerxmlpath2); }
     using (StringReader readerxmlpath3 = new StringReader(xmlpath3))
     { ds3.ReadXml(readerxmlpath3); }
     using (StringReader readerxmlpath4 = new StringReader(xmlpath4))
     {ds4.ReadXml(readerxmlpath4);}
     using (StringReader readerxmlpath5 = new StringReader(xmlpath5))
     { ds5.ReadXml(readerxmlpath5);}
     using (StringReader readerxmlpathPatSint = new StringReader(xmlpathPatSint))
     { dsPatSint.ReadXml(readerxmlpathPatSint);}
     using (StringReader readerxmlpath1000 = new StringReader(xmlpath1000))
     {  ds1000.ReadXml(readerxmlpath1000);}
     drc1 = ds1.Tables["short"].Rows;
     drc2 = ds2.Tables["short"].Rows;
     drc3 = ds3.Tables["short"].Rows;
     drc4=ds4.Tables["short"].Rows;
     drc5 = ds5.Tables["short"].Rows;
     drcPatSint = dsPatSint.Tables["short"].Rows;
     drc1000 = ds1000.Tables["short"].Rows;
    ht1000 = loadDataForHashTable(drc1000);
     dic1000 = GetDict(ds1000.Tables["short"]);
     dicPatSint=GetDict(dsPatSint.Tables["short"]);
     SoundPlayer start = new SoundPlayer(String.Format("{0}START{1}", @dir, fileformat));
     start.Play();
 }
        private void add_edges(DataRowCollection edge_rows, IVertexCollection oVertices, IEdgeCollection oEdges)
        {
            String from;
            String to;

            foreach (DataRow row in edge_rows)
            {
                //Notice: "EdgeFromid" and "EdgeToid" should be edited
                from = row["FromID"].ToString();
                to = row["ToID"].ToString();

                // Add an edge
                IVertex oFrom = null;
                IVertex oTo = null;

                foreach (IVertex oVertex in oVertices)
                {
                    if (oVertex.Tag.ToString() == from)
                    {
                        oFrom = oVertex;
                    }

                    if (oVertex.Tag.ToString() == to)
                    {
                        oTo = oVertex;
                    }
                }
                IEdge oEdge1 = oEdges.Add(oFrom, oTo, true);
            }
        }
 /// <summary>
 /// @author : TrungMT
 /// @CreateDate:04/07/2008
 /// @Description: retrieve many ScheduleDetail with workstation id and schedule date
 /// </summary>
 /// <param name="pintScheduleDetailID">int</param>
 //public DataSet CreateSchedule(ScheduleDetail pScheduleDetail)
 //{
 //    PrScheduleDetail ScheduleDetail = new PrScheduleDetail(Connection);
 //    try
 //    {
 //        Open();
 //        ScheduleDetail.CreateSchedule(pScheduleDetail);
 //        Commit();
 //        return ScheduleDetail.Search(pScheduleDetail.WorkstationId, pScheduleDetail.ScheduleDate);
 //    }
 //    catch (Exception exp)
 //    {
 //        Rollback();
 //        throw exp;
 //    }
 //    finally
 //    {
 //        Close();
 //    }
 //}
 /// <summary>
 /// @author : TrungMT
 /// @CreateDate:04/07/2008
 /// @Description: wrilte download log
 /// </summary>
 /// <param name="pintScheduleDetailID">int</param>
 public void CheckDownloaded(DataRowCollection pDataRowsColl, int pintWorkstationID, DateTime pdteDateTime)
 {
     PrScheduleDetail ScheduleDetail = new PrScheduleDetail(Connection);
     ScheduleDetail pScheduleDetail = new ScheduleDetail();
     pScheduleDetail.WorkstationId = pintWorkstationID;
     pScheduleDetail.ScheduleDate = pdteDateTime;
     try
     {
         Open();
         foreach (DataRow row in pDataRowsColl)
         {
             pScheduleDetail.ScheduleId = (int) row["SCHEDULE_ID"];
             pScheduleDetail.Downloaded = (byte) row["DOWNLOADED"];
             if (pScheduleDetail.Downloaded == 1)
                 ScheduleDetail.CheckDownloaded(pScheduleDetail);
         }
         Commit();
     }
     catch (Exception exp)
     {
         Rollback();
         throw exp;
     }
     finally
     {
         Close();
     }
 }
Beispiel #10
0
    protected void DropDownListAgence1_SelectedIndex(object sender, EventArgs e)
    {
        DataSet ds       = null;
        String  requette = "SELECT `lien_plan_google`,`num_agence`,`adresse_agence`, `code_postal_agence`, `ville_agence`, `telephone_agence`, `email_agence`, `telecopie_agence` FROM Agences WHERE  `num_agence`='001' ORDER BY Agences.[ville_agence]";

        Connexion c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c = null;


        System.Data.DataRowCollection dr = ds.Tables[0].Rows;



        foreach (System.Data.DataRow ligne in dr)
        {
            Session["adresse agence"]     = (string)ligne["adresse_agence"].ToString();
            Session["code postal agence"] = (string)ligne["code_postal_agence"].ToString();
            Session["ville agence"]       = (string)ligne["ville_agence"].ToString();
            Session["mail agence"]        = (string)ligne["email_agence"].ToString();
            Session["telephone agence"]   = (string)ligne["telephone_agence"].ToString();
            Session["telecopie agence"]   = (string)ligne["telecopie_agence"].ToString();
            Session["lien_plan_google"]   = (string)ligne["lien_plan_google"].ToString();
        }
    }
        public static bool CheckTarget(DataTransferTask dataTransferTask)
        {
            bool TargetIsExists = splSqlService.ObjectIsExist(dataTransferTask.TargetConnectionString, dataTransferTask.TargetTableName);

            if (!TargetIsExists)
            {
                System.Data.DataRowCollection SchemaRows = DataSchemaService.getSchemaRowsCollection(dataTransferTask.SourceConnectionString, dataTransferTask.SourceGetDataQuery);
                if (SchemaRows == null)
                {
                    return(false);
                }
                CreateTargetTable(dataTransferTask.TargetTableName, SchemaRows, dataTransferTask.TargetConnectionString, true);
                return(true);
            }
            else //check Source = Target
            {
                DataRowCollection SourceRows  = DataSchemaService.getSchemaRowsCollection(dataTransferTask.SourceConnectionString, dataTransferTask.SourceGetDataQuery);
                string            TargetQuery = $"select * from {dataTransferTask.TargetTableName}";
                DataRowCollection TargetRows  = DataSchemaService.getSchemaRowsCollection(dataTransferTask.TargetConnectionString, TargetQuery);
                if (DataSchemaService.DataRowsIsEqual(SourceRows, TargetRows))
                {
                    return(true);
                }
                else
                {
                    System.Data.DataRowCollection SchemaRows = DataSchemaService.getSchemaRowsCollection(dataTransferTask.SourceConnectionString, dataTransferTask.SourceGetDataQuery);
                    if (SchemaRows == null)
                    {
                        return(false);
                    }
                    CreateTargetTable(dataTransferTask.TargetTableName, SchemaRows, dataTransferTask.TargetConnectionString, true);
                    return(true);
                }
            }
        }
Beispiel #12
0
        public void Init(string strField, string strValue, bool bFindByNodeText, TreeView tree, SqlConnection conn,
            string[] catFields, string maintablename, string leafField, DataColumn[] primaryColumn, int modtabid)
        {
            if (FindField != strField || FindValue != strValue || FindByNodeText != bFindByNodeText || MainTableName != maintablename)
            {
                FindField = strField;
                FindValue = strValue;
                treeView = tree;
                Conn = conn;
                FindByNodeText = bFindByNodeText;
                MainTableName = maintablename;  
                CatFields = catFields;
                LeafField = leafField;
                PrimaryColumns = primaryColumn;
                ModTabId = modtabid;              


                CurIndex = -1;
                FindResultRows = null;
                arrRepeated.Clear();

                bHasErr = !ReInit();
            }            
        
        }    
Beispiel #13
0
 /// <summary>
 /// Creates a collection of rows.
 /// </summary>
 /// <param name="dataRowCollection"></param>
 public RowCollection(MarkThree.Table table, System.Data.DataRowCollection dataRowCollection)
 {
     // The purpose of this class is simply to provide a strongly typed list of the Row class from the original
     // DataRow version of the list.
     this.table             = table;
     this.dataRowCollection = dataRowCollection;
 }
Beispiel #14
0
		public DataTable()
		{
			Columns = new DataColumnCollection(this);
			Rows = new DataRowCollection(this);
			Locale = CultureInfo.CurrentCulture;
			DefaultView = new DataView(this);
		}
Beispiel #15
0
 /***
  * 统计计算
  * */
 public static DataTable[] calc(DataRowCollection rows)
 {
     //1、设置查询条件
     List<CheckCellCondition> condtionList = getConditionList();
     //2、获取验证通过的记录列表
     List<DataRow> rightRows = DataRowManager.findAllRightRows(rows, condtionList);
     //3、封装对象
     List<Student> studentList = StudentManager.rows2StudentList(rightRows);
     //4、根据分数由高到低排序
     studentList.Sort();
     //5、计算所有人的一个平均分,高分段和低分段,高分段人数,低分段人数
     float highScore = CoreService.calcSegScore(studentList,0.2f);
     float lowScore = CoreService.calcSegScore(studentList,0.8f);
     StatRecord mainRecord = CoreService.coreCalc(studentList, highScore, lowScore, "全年级");
     //6、获取不同班级人员列表
     List<List<Student>> groupList = groupByClazz(studentList);
     List<StatRecord> statRecordList = coreCalcGroup(groupList,highScore,lowScore);
     //7、获取高、低分明细table
     DataTable[] tablearr = renderScoreTable(statRecordList);
     DataTable highDataTable = tablearr[0];
     DataTable lowDataTable = tablearr[1];
     //8、获取渲染最终统计结果的table
     statRecordList.Add(mainRecord);
     DataTable mainStatTable = renderMainResultTable(statRecordList);
     return new DataTable[] { mainStatTable, highDataTable, lowDataTable };
 }
Beispiel #16
0
        /// <summary>
        /// @author : TrungMT
        /// @CreateDate:04/09/2008
        /// @Description: export to playlist
        /// </summary>
        public void ExportMediaFile(DataRowCollection pScheduleRows, String pstrClipColName, String pstrFileColName, String pstrFreqColName, String pstrMarkedUsingColName)
        {
            // check if no clip
            if (pScheduleRows.Count <= 0)
                return;

            // Init random
            DateTime date = DateTime.Now;
            Random random = new Random(date.Second * 10000000 + date.Minute * 100000 + date.Day * 1000 + date.DayOfYear);
            //int intRandomScope = pScheduleRows.Count - 1;

            // Caculate the total number of freq and restore MarkedUsingColName
            int intTolFreq = 0;
            foreach (DataRow row in pScheduleRows)
            {
                //intTolFreq += (byte)row[pstrFreqColName];
                intTolFreq += (byte)row[pstrFreqColName];
                row[pstrMarkedUsingColName] = (int)0;
            }

            // Exceute random
            bool blnStop = false;
            while (!blnStop)
            {
                // Generate 1 random value
                int randomValue = random.Next(0, pScheduleRows.Count);
                // if the freq display of the clip is not enough
                if (ExportClip(pScheduleRows[randomValue],
                                pstrClipColName,
                                pstrFileColName,
                                pstrFreqColName,
                                pstrMarkedUsingColName))
                    // next loop to another clip
                    continue;
                // but if enough, try the next clip in the list
                else
                {
                    int i = randomValue;
                    do
                    {
                        // try next by next clip,
                        i++;
                        if (i >= pScheduleRows.Count)
                            i = 0;
                        // if the freq display of the next clip is not enough
                        if (ExportClip(pScheduleRows[i],
                                        pstrClipColName,
                                        pstrFileColName,
                                        pstrFreqColName,
                                        pstrMarkedUsingColName))
                            // exit loop to another random clip
                            break;
                    } while (i != randomValue);
                    // if all clip is enought, stop hear
                    if (i == randomValue)
                        break;
                }
            }
        }
Beispiel #17
0
 /// <summary>
 /// @author : TrungMT
 /// @CreateDate:05/05/2008
 /// @Description: show form and play many clip
 /// </summary>
 public PlayClip(DataRowCollection pClipRows, TimeSpan ptServerLocalDelay)
 {
     mClipRows = pClipRows;
     InitializeComponent();
     //LoadArrayList();
     mtServerLocalDelay = ptServerLocalDelay;
     Show();
 }
Beispiel #18
0
        public GridFilter(GridView grid)
        {
            _GridView = grid;
            _RowCollection = ((DataView)_GridView.DataSource).Table.Rows;

            //event
            _Timer.Tick += Timer_Tick;
        }
Beispiel #19
0
 public DataObjectEx(DataRowCollection selectedItems, String baseFolder)
 {
     this.m_SelectedItems = new DataRow[selectedItems.Count];
       for (Int32 counter = 0; counter < selectedItems.Count; counter++) {
     this.m_SelectedItems[counter] = selectedItems[counter];
       }
       this.m_BaseFolder = baseFolder;
 }
Beispiel #20
0
 public static string getCollationSelect(string n, DataRowCollection collations)
 {
     sb = new StringBuilder();
     sb.Append("<select name=\"" + n + "\"><option />");
     for (int i = 0, l = collations.Count; i < l; i++) sb.Append("<option value=\"" + collations[i][0] + "\">" + collations[i][0] + "</option>");
     sb.Append("</select>");
     return sb.ToString();
 }
Beispiel #21
0
        public static List <System.Data.DataRow> ToList(this System.Data.DataRowCollection rows)
        {
            List <System.Data.DataRow> retour = new List <System.Data.DataRow>();

            foreach (System.Data.DataRow item in rows)
            {
                retour.Add(item);
            }
            return(retour);
        }
Beispiel #22
0
        private static List <T> GetEntityList <T>(System.Data.DataRowCollection rows)
        {
            List <T> list = new List <T>();

            foreach (System.Data.DataRow dr in rows)
            {
                list.Add(GetEntity <T>(dr));
            }
            return(list);
        }
        /// <summary>
        /// Validates the MConference Standard Cost Setup screen data.
        /// </summary>
        /// <param name="AContext">Context that describes where the data validation failed.</param>
        /// <param name="ARow">The <see cref="DataRow" /> which holds the the data against which the validation is run.</param>
        /// <param name="AVerificationResultCollection">Will be filled with any <see cref="TVerificationResult" /> items if
        /// data validation errors occur.</param>
        /// <param name="AValidationControlsDict">A <see cref="TValidationControlsDict" /> containing the Controls that
        /// display data that is about to be validated.</param>
        /// <param name="AGridData">A <see cref="TValidationControlsDict" />Contains all rows that are included in the grid</param>
        public static void ValidateConferenceStandardCost(object AContext, PcConferenceCostRow ARow,
            ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict,
            DataRowCollection AGridData)
        {
            // Don't validate deleted DataRows
            if (ARow.RowState == DataRowState.Deleted)
            {
                return;
            }

            // Check the row being validated is consistent with the rest of the data in the table
            PcConferenceCostRow ARowCompare = null;
            Boolean StandardCostInconsistency = false;
            string[] InconsistentRows = new string[2];  // used for the error message
            int i = 0;

            while (i < AGridData.Count)
            {
                ARowCompare = (PcConferenceCostRow)AGridData[i];

                if ((ARowCompare.RowState != DataRowState.Deleted) && (ARowCompare.OptionDays > ARow.OptionDays) && (ARowCompare.Charge < ARow.Charge))
                {
                    StandardCostInconsistency = true;
                    InconsistentRows[0] = ARow.OptionDays.ToString();
                    InconsistentRows[1] = ARowCompare.OptionDays.ToString();
                    break;
                }
                else if ((ARowCompare.RowState != DataRowState.Deleted) && (ARowCompare.OptionDays < ARow.OptionDays)
                         && (ARowCompare.Charge > ARow.Charge))
                {
                    StandardCostInconsistency = true;
                    InconsistentRows[0] = ARowCompare.OptionDays.ToString();
                    InconsistentRows[1] = ARow.OptionDays.ToString();
                    break;
                }

                i++;
            }

            // if an inconsistency is found
            if (StandardCostInconsistency == true)
            {
                TValidationControlsData ValidationControlsData;
                TScreenVerificationResult VerificationResult = null;
                DataColumn ValidationColumn = ARow.Table.Columns[PcConferenceCostTable.ColumnChargeId];

                // displays a warning message (non-critical error)
                VerificationResult = new TScreenVerificationResult(new TVerificationResult(AContext, ErrorCodes.GetErrorInfo(
                            PetraErrorCodes.ERR_STANDARD_COST_INCONSISTENCY, InconsistentRows)),
                    ValidationColumn, ValidationControlsData.ValidationControl);

                // Handle addition to/removal from TVerificationResultCollection
                AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
            }
        }
Beispiel #24
0
 /// <summary>
 /// @author : TrungMT
 /// @CreateDate:05/05/2008
 /// @Description: show form and play many clip
 /// </summary>
 public FrmClipView(DataRowCollection pClipRows, TimeSpan ptServerLocalDelay,QTC.Adv.DataModule.Single.Workstation workstation)
 {
     InitializeComponent();
     this.workstation = workstation;
     mClipRows = pClipRows;
     Stopped = true;
     InitTimmerList();
     mTimer.Enabled = true;
     mtServerLocalDelay = ptServerLocalDelay;
     mFullScreen = new FullScreen(this);
 }
Beispiel #25
0
 public static void ShowOrder(System.Data.DataRowCollection rows)
 {
     if (rows[0]["Response"].ToString() == "True")
     {
         Console.WriteLine($"Номер вашего заказа: {rows[0]["Order_ID"]}");
     }
     else
     {
         Console.WriteLine("Сожалеем, но товар распродан");
     }
 }
Beispiel #26
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ds">
        /// A <see cref="DataSet"/>
        /// </param>
        public ResultSet(DataSet ds)
        {
            if (ds != null && ds.Tables != null && ds.Tables.Count > 0) {
                DataTable dt = ds.Tables [0]; // only one table is returned with query results.
                Rows = dt.Rows;
                Columns = dt.Columns;
            }

            // Expose values as public properties to access them on json objects.
            PopulatingPublicProperties ();
        }
Beispiel #27
0
        public static void DrawTags(System.Data.DataRowCollection rows)
        {
            var formatString = string.Format("{{0, -5}}|{{1, -20}}");

            Console.WriteLine(formatString, "ID", "Категория");
            foreach (DataRow row in rows)
            {
                Console.WriteLine(formatString,
                                  row["ID"],
                                  row["Name"]);
            }
        }
Beispiel #28
0
        private bool ReInit()
        {
            string sql = string.Empty;
            DataTable dt = null;

            if (FindByNodeText)
            {
                findType = FindType.FindNodeText;

                sql = string.Format("select distinct [{0}] from {1} where [{0}] like '%{2}%' order by [{0}]", mapField, animation_npcTableName, FindValue);
                dt = GetDataTable(sql, Conn);
                if (dt == null)
                {
                    return false;
                }
                FindResultMapRows = dt.Rows;

                sql = string.Format("select [{0}], {1}, {2} from {3} where {1} like '%{4}%' order by [{0}], {1}", mapField, ModelField, RepresentIdField, npcTableName, FindValue);
                dt = GetDataTable(sql, Conn);
                if (dt == null)
                {
                    return false;
                }
                FindResultModelRows = dt.Rows;

            }
            else if (FindField.ToLower() == RepresentIdField.ToLower())
            {
                findType = FindType.FindRepresentId;

                sql = string.Format("select [{0}], {1} from {2} where {1} = {3} order by [{0}], {1} ", mapField, RepresentIdField, animation_npcTableName, FindValue);
                dt = GetDataTable(sql, Conn);
                if (dt == null)
                {
                    return false;
                }
                FindResultRows = dt.Rows;
            }
            else
            {
                findType = FindType.FindAnimationID;

                sql = string.Format("select [{0}], {1}, {2} from {3} where {2} = {4} order by [{0}], {1}, {2} ", mapField, RepresentIdField, AnimationIDField, animation_npcTableName, FindValue);
                dt = GetDataTable(sql, Conn);
                if (dt == null)
                {
                    return false;
                }
                FindResultRows = dt.Rows;
            }

            return true;
        }
Beispiel #29
0
    private void CreateFileInfoControls(DataRowCollection fileInfoRows)
    {
        foreach (DataRow fileInfo in fileInfoRows)
        {
            ASP.commandarea_controls_edituploadedfileinfo_ascx oEditUploadedFileInfo =
                (ASP.commandarea_controls_edituploadedfileinfo_ascx)
                    LoadControl(typeof(ASP.commandarea_controls_edituploadedfileinfo_ascx), null);

            oEditUploadedFileInfo.BindToRow(fileInfo);
            oFileInfoPlaceHolder.Controls.Add(oEditUploadedFileInfo);
        }
    }
Beispiel #30
0
 public static List<DataRow> findAllRightRows(DataRowCollection rows, List<CheckCellCondition> list)
 {
     if (null == rows || rows.Count == 0) return null;
     List<DataRow> dataRowList = new List<DataRow>();
     foreach (DataRow row in rows)
     {
         if (checkRow(row, list))
         {
             dataRowList.Add(row);
         }
     }
     return dataRowList;
 }
        private void ImportInDB(DataRowCollection firstTableRows, DateTime dateTimeOfReports)
        {
            using (NitrogenNewEntities dbConnection = new NitrogenNewEntities())
            {
                var nameOfPlace = firstTableRows[0].ItemArray[0].ToString();
                var idOfThePlace = dbConnection.Places.Where(p => p.Name == nameOfPlace).Select(p => p.PlaceId).FirstOrDefault();
                var idsOfProducts = dbConnection.Products.Select(x => x.ProductId).ToList();

                Place newPlace = new Place();
                if (idOfThePlace == 0)
                {
                    newPlace = dbConnection.Places.Add(new Place()
                    {
                        Name = nameOfPlace,
                        Address = "Undefined",
                    });
                }

                Sale theNewSale = new Sale();
                for (int i = 2; i < firstTableRows.Count; i++)
                {
                    theNewSale = new Sale();
                    var row = firstTableRows[i];
                    int reportProductId = int.Parse(row.ItemArray[0].ToString());

                    if (!idsOfProducts.Contains(reportProductId))
                    {
                        Console.WriteLine(
                            string.Format("The id: {0} is not contains in Products! Report cannot be processed.", reportProductId));
                        continue;
                    }

                    theNewSale.ProductId = reportProductId;
                    theNewSale.Quantity = int.Parse(row.ItemArray[1].ToString());
                    theNewSale.PricePerUnit = decimal.Parse(row.ItemArray[2].ToString());
                    theNewSale.Sum = decimal.Parse(row.ItemArray[3].ToString());
                    theNewSale.PlaceId = idOfThePlace != 0 ? idOfThePlace : newPlace.PlaceId;
                    theNewSale.Date = dateTimeOfReports;
                    dbConnection.Sales.Add(theNewSale);
                }

                try
                {
                    dbConnection.SaveChanges();
                }
                catch (Exception ex)
                {
                    this.ShowMessageException(ex);
                }
            }
        }
Beispiel #32
0
 protected string createDetails(DataRowCollection rows)
 {
     string XML = string.Empty;
     foreach (DataRow row in rows)
     {
         XML += "<LOAD>";
         foreach (string detail in this.__details)
         {
             XML += string.Format("<{0}>{1}</{0}>", detail.Trim(), row[detail].ToString().Trim());
         }
         XML += "</LOAD>";
     }
     return XML.ToUpper();
 }
 List<TransportType> GetRestPartsOfTransportType(DataRowCollection searchedRows)
 {
     if (searchedRows == null || searchedRows.Count == null)
         return null;
     List<TransportType> TransportType = new List<TransportType>();
     foreach (Tr_Tick_DBDataSet.TypeRow transportTypeRow in searchedRows)
     {
         TransportType transportType = new TransportType();
         transportType.ID = transportTypeRow.ttype_id;
         transportType.Name = transportTypeRow.ttype_name;
         TransportType.Add(transportType);
     }
     return TransportType;
 }
 private IEnumerable<PublisherStatus> CheckConceptIdInfo(DataRowCollection contentRows)
 {
     var status = new List<PublisherStatus>();
     using (var work = new UnitOfWork())
     {
         var treatyArticleMetaDataRepo = RepositoryContainer.GetRepository<TreetyArticleMetadata>(work);
         var metaInfo = contentRows[0];
         var conceptIdForocdeArt1 = metaInfo.ItemArray[1].ToString().Trim();
         var ocdeArt1 = treatyArticleMetaDataRepo.Filter(b => b.ConceptId == conceptIdForocdeArt1).FirstOrDefault();
         if(ocdeArt1 == null)
         {
             status.Add(new PublisherStatus
                     {
                         Status = false,
                         Message = "Article Id  " + metaInfo.ItemArray[1].ToString().Trim() + "Does Not Exist"
                     });
         }
         var conceptIdForocdeArt2 = metaInfo.ItemArray[2].ToString().Trim();
         var ocdeArt2 = treatyArticleMetaDataRepo.Filter(b => b.ConceptId == conceptIdForocdeArt2).FirstOrDefault();
         if (ocdeArt2 == null)
         {
             status.Add(new PublisherStatus
             {
                 Status = false,
                 Message = "Article Id  " + metaInfo.ItemArray[2].ToString().Trim() + "Does Not Exist"
             });
         }
         var conceptIdForReliefFromDouble = metaInfo.ItemArray[3].ToString().Trim();
         var reliefFromDouble = treatyArticleMetaDataRepo.Filter(b => b.ConceptId == conceptIdForReliefFromDouble).FirstOrDefault();
         if (reliefFromDouble == null)
         {
             status.Add(new PublisherStatus
             {
                 Status = false,
                 Message = "Article Id  " + metaInfo.ItemArray[3].ToString().Trim() + "Does Not Exist"
             });
         }
         var conceptIdForCompetentAuthority = metaInfo.ItemArray[4].ToString().Trim();
         var competentAuthority = treatyArticleMetaDataRepo.Filter(b => b.ConceptId == conceptIdForCompetentAuthority).FirstOrDefault();
         if (competentAuthority == null)
         {
             status.Add(new PublisherStatus
             {
                 Status = false,
                 Message = "Article Id  " + metaInfo.ItemArray[4].ToString().Trim() + "Does Not Exist"
             });
         }
     }
     return status;
 }
Beispiel #35
0
 public void PopulateCombo(ComboBox combo)
 {
     combo.Items.Clear();
     if (cursor.HasReader())
     {
         DataTable table = new DataTable();
         table.Load(cursor.Reader);
         System.Data.DataRowCollection rows = table.Rows;
         for (int r = 0; r < rows.Count; r++)
         {
             combo.Items.Add(rows[r][0]);
         }
     }
 }
        public void SetDetails(DataRowCollection allDataRows)
        {
            Debug.Assert(allDataRows != null, "allDataRows != null");

            this.CaptionText = String.Format("All test row details");

            StringBuilder sb = new StringBuilder();
            foreach (DataRow dataRow in allDataRows)
            {
                sb.Append(GetDocumentText(dataRow));
            }

            this.webBrowser1.DocumentText = sb.ToString();
        }
 List<Rate> GetRestPartsOfRate(DataRowCollection searchedRows)
 {
     if (searchedRows == null || searchedRows.Count == 0)
         return null;
     List<Rate> Rate = new List<Rate>();
     foreach (Tr_Tick_DBDataSet.RateRow rateRow in searchedRows)
     {
         Rate rate = new Rate();
         rate.ID = rateRow.rrate_id;
         rate.Name = rateRow.rrate_name;
         Rate.Add(rate);
     }
     return Rate;
 }
Beispiel #38
0
        public static void DrawOrder(System.Data.DataRowCollection rows)
        {
            var formatString = string.Format("{{0, -20}}|{{1, -20}}|{{2, -20}}|{{3, -20}}|{{4, -20}}");

            Console.WriteLine(formatString, "Название товара", "Поставщик", "Категория", "Цена", "Дата");
            foreach (DataRow row in rows)
            {
                Console.WriteLine(formatString,
                                  row["Name"],
                                  row["Supplier"],
                                  row["Tag"],
                                  row["Price"],
                                  row["Date"]);
            }
        }
Beispiel #39
0
 protected override string FormatRows(DataRowCollection rows, int[] keys, int maxFeatures)
 {
     StringBuilder sb = new StringBuilder();
     for (int k = 0; k < maxFeatures; k++)
     {
         string css = k % 2 == 0 ? CssEven : CssOdd;
         int key = keys[k];
         object[] arr = rows[key].ItemArray;
         sb.AppendFormat("<tr{0}>{1}", css, NewLine);
         foreach (object el in arr)
             sb.AppendFormat("<td>{0}</td>{1}", el, NewLine);
         sb.AppendFormat("</tr>{0}", NewLine);
     }
     return sb.ToString();
 }
Beispiel #40
0
 public static Patient ParsePatient(DataRowCollection dataRow,int index)
 {
     try{
         Patient patient = new Patient();
         patient.D_ID = Convert.ToInt16(dataRow[index]["d_id"].ToString());
         patient.Gender = dataRow[index]["gender"].ToString();
         patient.Old = Convert.ToInt16(dataRow[index]["old"]);
         patient.P_name = dataRow[index]["p_name"].ToString();
         patient.Pid = Convert.ToInt16(dataRow[index]["pid"]);
         patient.Tel = dataRow[index]["tel"].ToString();
         return patient;
     }catch(Exception exp){
         return null;
     }
 }
 List<Person> GetRestPartsOfPerson(DataRowCollection searchedRows)
 {
     if (searchedRows == null || searchedRows.Count == null)
         return null;
     List<Person> Person = new List<Person>();
     foreach (Tr_Tick_DBDataSet.PersonRow personRow in searchedRows)
     {
         Person person = new Person();
         person.ID = personRow.ppers_id;
         person.Name = personRow.name;
         person.date_begin_ed = personRow.date_begin_ed;
         person.date_end_ed = personRow.date_end_ed;
         Person.Add(person);
     }
     return Person;
 }
 public static void DrillDownAqbSqlContext(
     ActiveQueryBuilder.Core.SQLContext sc
     , System.Data.DataTable tbl
     , string dataStoreName
     )
 {
     ActiveQueryBuilder.Core.MetadataList items = sc.MetadataContainer.Items;
     //
     System.Collections.Generic.Stack <StackItem> stack = new System.Collections.Generic.Stack <StackItem>( );
     stack.Push(new StackItem {
         list = items, index = 0, parentID = -1, grandParentID = -1
     });
     do
     {
         StackItem si = stack.Pop( );
         ActiveQueryBuilder.Core.MetadataList actualMIList = si.list;
         int actualIndex    = si.index;
         int actualParentID = si.grandParentID; // IMPORTANT!!!
         for ( ; actualIndex < actualMIList.Count; actualIndex++)
         {
             System.Data.DataRow row = tbl.NewRow( );
             row["DataStoreName"] = dataStoreName;
             ExtractMetadataItem(row, actualMIList[actualIndex], actualParentID, tbl);
             tbl.Rows.Add(row);
             if (actualMIList[actualIndex].Items.Count > 0) // branch...
             {
                 int count = tbl.Rows.Count;
                 System.Data.DataRowCollection rows = tbl.Rows;
                 int parentId = (int)rows[count - 1]["ID"];
                 // Push the "next" Item...
                 stack.Push(new StackItem
                 {
                     list          = actualMIList,
                     index         = actualIndex + 1,
                     parentID      = parentId,
                     grandParentID = actualParentID
                 });
                 // Reset the loop to process the "actual" Item...
                 actualParentID = parentId;
                 actualMIList   = actualMIList[actualIndex].Items;
                 actualIndex    = -1;
             }
         } // for(;;)...
     } while(stack.Count > 0);
 }
Beispiel #43
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string requette = "SELECT * from environnement";

        System.Data.DataSet ds = null;
        Connexion           c  = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c = null;
        System.Data.DataRowCollection dr = ds.Tables[0].Rows;

        System.Data.DataRow ligne = dr[0];


        hote = ligne["IP"].ToString();
    }
Beispiel #44
0
 protected override string FormatRows(DataRowCollection rows, int[] keys, int maxFeatures)
 {
     StringBuilder sb = new StringBuilder();
     for (int k = 0; k < maxFeatures; k++)
     {
         int key = keys[k];
         object[] arr = rows[key].ItemArray;
         int length = arr.Length;
         for (int i = 0; i < length; i++)
         {
             string separator = (i == length - 1) ? String.Empty : " ";
             sb.AppendFormat("'{0}'{1}", arr[i], separator);
         }
         if ((k + 1) < maxFeatures)
             sb.AppendFormat(",{0}", NewLine);
     }
     return sb.ToString();
 }
        internal static void FilterForLoginUser(int login_user_role_id, System.Data.DataRowCollection drc)
        {
            List <DataRow> remove = new List <DataRow>();

            foreach (DataRow row in drc)
            {
                if (login_user_role_id == (int)UserRole.Supervisor)
                {
                    int role = Int32.Parse(row["user_role_id"].ToString());
                    if (role != (int)UserRole.Agent && role != (int)UserRole.Manager && role != (int)UserRole.User)
                    {
                        remove.Add(row);
                    }
                }
            }

            foreach (DataRow row in remove)
            {
                drc.Remove(row);
            }
        }
Beispiel #46
0
 public void PopulateCombo(ComboBox combo, TPCIndexField[] keys, int offsetkeys, int noKeys)
 {
     combo.Items.Clear();
     if (cursor.HasReader())
     {
         dataTableGrid.Table.Load(cursor.Reader);
         System.Data.DataRowCollection rows = dataTableGrid.Table.Rows;
         for (int r = 0; r < rows.Count; r++)
         {
             string text = "";
             string w    = "";
             for (int i = 0; i < noKeys; i++)
             {
                 int c = keys[i + offsetkeys].index;
                 text += w + rows[r][c];
                 w     = "|";
             }
             combo.Items.Add(text);
         }
     }
 }
Beispiel #47
0
        private void cb_dt_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            ComboBoxEdit comboBoxEdit = sender as ComboBoxEdit;
            string       text         = comboBoxEdit.SelectedItem.ToString();
            string       type         = this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "ft").ToString();

            if (text != null)
            {
                if (this.curtable != null)
                {
                    this.curtable.Rows.Clear();
                    this.curtable.Columns.Clear();
                }
                if (text == "值域型")
                {
                    this.curtable.Columns.Add(this.fieldMin, this.GetColumnTypeByString(type));
                    this.curtable.Columns.Add(this.fieldMax, this.GetColumnTypeByString(type));
                    System.Data.DataRowCollection arg_C5_0 = this.curtable.Rows;
                    object[] values = new object[2];
                    arg_C5_0.Add(values);
                }
                else
                {
                    if (text == "枚举型")
                    {
                        this.curtable.Columns.Add(this.fieldCode, typeof(string));
                        this.curtable.Columns.Add(this.fieldValue, this.GetColumnTypeByString(type));
                        for (int i = 0; i < 200; i++)
                        {
                            System.Data.DataRowCollection arg_143_0 = this.curtable.Rows;
                            object[] array = new object[2];
                            array[0] = "";
                            arg_143_0.Add(array);
                        }
                    }
                }
                this.gridView2.PopulateColumns(this.curtable);
            }
        }
        private static void CreateTargetTable(string TargetTableName, System.Data.DataRowCollection ColumnsDefinition, string TargetConnectionString, bool DropTable = false)
        {
            List <string> Columns = splSqlService.GetColumnsDefinitions(ColumnsDefinition);

            //generate Create table script
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.AppendLine($"IF(OBJECT_ID('{TargetTableName}') IS NOT NULL) DROP TABLE {TargetTableName};");
            sb.AppendLine($"CREATE TABLE {TargetTableName}(");
            int column_id = 0;

            foreach (string ColumnDefinition in Columns)
            {
                if (column_id > 0)
                {
                    sb.AppendLine(", ");
                }
                sb.Append(ColumnDefinition);
                column_id++;
            }
            sb.Append(")");

            //upply to server
            splSqlService.ExecuteSQL(TargetConnectionString, sb.ToString());
        }
Beispiel #49
0
        public string Query(string query)
        {
            string result = "[";

            cursor.Format(query, 0);
            if (ShowSQL)
            {
                LogDebug = query;
            }
            cursor.Run();
            if (cursor.HasReader())
            {
                DataTable   table  = new DataTable();
                IDataReader reader = cursor.Reader;
                table.Load(reader);
                System.Data.DataRowCollection rows = table.Rows;
                for (int r = 0; r < rows.Count; r++)
                {
                    if (r > 0)
                    {
                        result += ", ";
                    }
                    result += "{";
                    for (int c = 0; c < table.Columns.Count; c++)
                    {
                        if (c > 0)
                        {
                            result += ", ";
                        }
                        result += string.Format("'{0}':'{1}'", table.Columns[c].ColumnName, rows[r][c]);
                    }
                    result += "}";
                }
            }
            return(result + "]");
        }
Beispiel #50
0
    //CONSTRUCTION DU TABLEAU DES BIENS
    protected void fill_table(string whose)
    {
        //PRINCIPE : on déclare le strict minimum du tableau dans la page aspx.
        //On remplit le tableau en c#. On met dans une cellule du texte ou une checkbox rattachée à un event.
        // On peut aisément générer des ID dynamiquement.
        //On insère cette cellule dans une ligne. On ajoute cette ligne à une varaible tableau.
        //On rattache cette variable tableau au tableau déclaré dans la page aspx.


        TablePlanif.Rows.Clear();
        TableRow  tRow;
        TableCell tCell1;
        CheckBox  cb;
        int       j = 0; // indice pour l'alternance des couleurs

        // affichage du nom des colonnes
        tRow = new TableRow();

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Référence</strong>";
        tRow.Cells.Add(tCell1);

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Négociateur</strong>";
        tRow.Cells.Add(tCell1);

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Prix de vente</strong>";
        tRow.Cells.Add(tCell1);

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Type de bien</strong>";
        tRow.Cells.Add(tCell1);

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Date de dossier</strong>";
        tRow.Cells.Add(tCell1);

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Ville</strong>";
        tRow.Cells.Add(tCell1);

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Code postal</strong>";
        tRow.Cells.Add(tCell1);

        tCell1      = new TableCell();
        tCell1.Text = "<strong>Surface</strong>";
        tRow.Cells.Add(tCell1);

        tCell1 = new TableCell();


        tCell1             = new TableCell();
        cb                 = new CheckBox();
        cb.ID              = "CheckBoxGlobale";
        cb.AutoPostBack    = true;
        cb.CheckedChanged += new EventHandler(globale_cb_changed);


        tCell1.Controls.Add(cb);
        tRow.Cells.Add(tCell1);
        // tCell1.Text = "<strong>Visite</strong>";


        tRow.CssClass = "champs";
        TablePlanif.Rows.Add(tRow);

        // Cases de tri. Les fleches sont des liens vers la meme page en ajoutant des variables dans l'url
        tRow = new TableRow();

        // Cellule fleche ref
        tCell1 = new TableCell();

        Table       minitab   = new Table();
        TableRow    tMiniRow  = new TableRow();
        TableCell   tMiniCell = new TableCell();
        ImageButton fleche    = new ImageButton();

        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "refDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "refASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        // Cellule fleche nego
        tCell1 = new TableCell();

        minitab   = new Table();
        tMiniRow  = new TableRow();
        tMiniCell = new TableCell();

        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "negoDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "negoASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        // Cellule fleche prix de vente
        tCell1 = new TableCell();

        minitab         = new Table();
        tMiniRow        = new TableRow();
        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "prixDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "prixASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        // Cellule fleche type
        tCell1 = new TableCell();

        minitab         = new Table();
        tMiniRow        = new TableRow();
        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "typeDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "typeASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        // Cellule fleche date
        tCell1 = new TableCell();

        minitab         = new Table();
        tMiniRow        = new TableRow();
        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "dateDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "dateASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        // Cellule fleche ville
        tCell1 = new TableCell();

        minitab         = new Table();
        tMiniRow        = new TableRow();
        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "villeDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "villeASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        // Cellule fleche cp
        tCell1 = new TableCell();

        minitab         = new Table();
        tMiniRow        = new TableRow();
        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "cpDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "cpASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        // Cellule fleche type
        tCell1 = new TableCell();

        minitab         = new Table();
        tMiniRow        = new TableRow();
        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_bas.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "surfaceDESC";
        tMiniCell.Controls.Add(fleche);
        tMiniRow.Cells.Add(tMiniCell);

        tMiniCell       = new TableCell();
        fleche          = new ImageButton();
        fleche.ImageUrl = "../img_site/fleche_tri_haut.png";
        fleche.Click   += new ImageClickEventHandler(ImageButton_Click);
        fleche.ID       = "surfaceASC";
        tMiniCell.Controls.Add(fleche);

        tMiniRow.Cells.Add(tMiniCell);
        minitab.Rows.Add(tMiniRow);
        tCell1.Controls.Add(minitab);
        tRow.Cells.Add(tCell1);

        tRow.CssClass = "tritableaudebord";
        TablePlanif.Rows.Add(tRow);

        // Choix du tri. Variables récupérées dans l'url
        String Ordre   = "ASC";
        String OrderBy = "ref";

        // selon la variable récupérée, on forme le orderby pour la requette
        if (Session["type"] != null)
        {
            if (Session["type"].ToString() == "refASC")
            {
                OrderBy = "ref";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "refDESC")
            {
                OrderBy = "ref";
                Ordre   = "DESC";
            }
            else if (Session["type"].ToString() == "negoASC")
            {
                OrderBy = "negociateur";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "negoDESC")
            {
                OrderBy = "negociateur";
                Ordre   = "DESC";
            }
            else if (Session["type"].ToString() == "prixASC")
            {
                OrderBy = "prix de vente";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "prixDESC")
            {
                OrderBy = "prix de vente";
                Ordre   = "DESC";
            }
            else if (Session["type"].ToString() == "typeASC")
            {
                OrderBy = "type de bien";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "typeDESC")
            {
                OrderBy = "type de bien";
                Ordre   = "DESC";
            }
            else if (Session["type"].ToString() == "dateASC")
            {
                OrderBy = "date dossier";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "dateDESC")
            {
                OrderBy = "date dossier";
                Ordre   = "DESC";
            }
            else if (Session["type"].ToString() == "villeASC")
            {
                OrderBy = "ville du bien";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "villeDESC")
            {
                OrderBy = "ville du bien";
                Ordre   = "DESC";
            }
            else if (Session["type"].ToString() == "cpASC")
            {
                OrderBy = "code postal du bien";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "cpDESC")
            {
                OrderBy = "code postal du bien";
                Ordre   = "DESC";
            }
            else if (Session["type"].ToString() == "surfaceASC")
            {
                OrderBy = "surface habitable";
                Ordre   = "ASC";
            }
            else if (Session["type"].ToString() == "surfaceDESC")
            {
                OrderBy = "surface habitable";
                Ordre   = "DESC";
            }
        }

        Membre member1      = (Membre)Session["Membre"];
        int    idClientNego = member1.IDCLIENT;

        // On forme la requette sur la table bien suivant les biens ou tous les biens
        String requette = "";

        if (whose == "Mes biens")
        {
            requette = "select ref, `negociateur`, `loyer_cc`, `prix de vente`, `ville du bien`, `code postal du bien`, `type de bien`, `date dossier`, `surface habitable` from biens where `actif`='actif' AND `idclient`=" + idClientNego + " ORDER BY Biens.[" + OrderBy + "]" + Ordre;
        }
        else if (whose == "Tous les biens")
        {
            requette = "select ref, `negociateur`, `loyer_cc`, `prix de vente`, `ville du bien`, `code postal du bien`, `type de bien`, `date dossier`, `surface habitable` from biens where `actif`='actif' ORDER BY Biens.[" + OrderBy + "]" + Ordre;
        }
        else if (whose == "Mon agence")
        {
            requette = "select ref, `negociateur`, `loyer_cc`, `prix de vente`, `ville du bien`, `code postal du bien`, `type de bien`, `date dossier`, `surface habitable` from biens where `actif`='actif' AND `num`='" + member1.NUM_AGENCE + "' ORDER BY Biens.[" + OrderBy + "]" + Ordre;
        }


        System.Data.DataSet ds = null;
        Connexion           c  = null;

        c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c = null;

        // Boucle d'affichage des biens
        System.Data.DataRowCollection dr = ds.Tables[0].Rows;
        foreach (System.Data.DataRow ligne in dr)
        {
            tRow = new TableRow();

            tCell1          = new TableCell();
            tCell1.Text     = ((String)ligne["ref"].ToString());
            tCell1.CssClass = "centre";
            tRow.Cells.Add(tCell1);

            tCell1          = new TableCell();
            tCell1.Text     = ((String)ligne["negociateur"].ToString());
            tCell1.CssClass = "centre";
            tRow.Cells.Add(tCell1);

            tCell1 = new TableCell();
            if ((String)ligne["ref"].ToString().Substring(0, 1) == "V")
            {
                tCell1.Text = ((String)ligne["prix de vente"].ToString()) + " €";
            }
            else
            {
                tCell1.Text = ((String)ligne["loyer_cc"].ToString()) + " €";
            }
            tCell1.CssClass = "droite";
            tRow.Cells.Add(tCell1);

            tCell1          = new TableCell();
            tCell1.Text     = ((String)ligne["type de bien"].ToString());
            tCell1.CssClass = "centre";
            tRow.Cells.Add(tCell1);

            tCell1          = new TableCell();
            tCell1.Text     = ((String)ligne["date dossier"].ToString().Substring(0, 10));
            tCell1.CssClass = "centre";
            tRow.Cells.Add(tCell1);


            tCell1      = new TableCell();
            tCell1.Text = ((String)ligne["ville du bien"].ToString());
            tRow.Cells.Add(tCell1);

            tCell1          = new TableCell();
            tCell1.Text     = ((String)ligne["code postal du bien"].ToString());
            tCell1.CssClass = "centre";
            tRow.Cells.Add(tCell1);


            tCell1          = new TableCell();
            tCell1.Text     = ((String)ligne["surface habitable"].ToString());
            tCell1.CssClass = "centre";
            tRow.Cells.Add(tCell1);



            tCell1          = new TableCell();
            cb              = new CheckBox();
            cb.ID           = ((String)ligne["ref"]);
            cb.AutoPostBack = false;
            //cb.CheckedChanged += new EventHandler(cb_CheckedChanged);

            tCell1.Controls.Add(cb);
            tRow.Cells.Add(tCell1);

            if ((j % 2) == 0)
            {
                tRow.CssClass = "pair";
            }
            else
            {
                tRow.CssClass = "impair";
            }

            j++;

            TablePlanif.Rows.Add(tRow); // Ajout de la ligne dans la table
        }
    }
Beispiel #51
0
    protected String get_Envois_sites(System.Data.DataRowCollection dr1)
    {
        String Envois_sites = "";
        String freq         = "";

        if (dr1[0]["date_envoi_logic"].ToString() != "")
        {
            freq          = get_Freq_envoi("logicimmo");
            Envois_sites += "<strong>LogicImmo:</strong><br/> Envoyé le " + dr1[0]["date_envoi_logic"].ToString().Substring(0, 10);
            if (dr1[0]["Time_envoi_logic"].ToString() != "")
            {
                Envois_sites += " " + dr1[0]["Time_envoi_logic"].ToString().Substring(11, 5);
            }
            if (freq != "0")
            {
                Envois_sites += "<br/> Publié toutes les " + freq + " heures.";
            }
            Envois_sites += "<br/>";
        }

        if (dr1[0]["date_envoi_etreproprio"].ToString() != "")
        {
            freq          = get_Freq_envoi("etreproprio");
            Envois_sites += "<strong>EtreProprio:</strong><br/> Envoyé le " + dr1[0]["date_envoi_etreproprio"].ToString().Substring(0, 16);
            if (freq != "0")
            {
                Envois_sites += "<br/> Publié toutes les " + freq + " heures.";
            }
            Envois_sites += "<br/>";
        }
        if (dr1[0]["date_envoi_annoncesjaunes"].ToString() != "")
        {
            freq          = get_Freq_envoi("annoncesjaunes");
            Envois_sites += "<strong>Annonces Jaunes/A Vendre A Louer:</strong><br/> Envoyé le " + dr1[0]["date_envoi_annoncesjaunes"].ToString().Substring(0, 16);
            if (freq != "0")
            {
                Envois_sites += "<br/> Publié toutes les " + freq + " heures.";
            }
            Envois_sites += "<br/>";
        }
        if (dr1[0]["date_envoi_repimmo"].ToString() != "")
        {
            freq          = get_Freq_envoi("repimmo");
            Envois_sites += "<strong>RepImmo:</strong><br/> Envoyé le " + dr1[0]["date_envoi_repimmo"].ToString().Substring(0, 16);
            if (freq != "0")
            {
                Envois_sites += "<br/> Publié toutes les " + freq + " heures.";
            }
            Envois_sites += "<br/>";
        }
        if (dr1[0]["date_envoi_seloger"].ToString() != "")
        {
            freq          = get_Freq_envoi("seloger");
            Envois_sites += "<strong>SeLoger:</strong><br/> Envoyé le " + dr1[0]["date_envoi_seloger"].ToString().Substring(0, 16);
            if (freq != "0")
            {
                Envois_sites += "<br/> Publié toutes les " + freq + " heures.";
            }
            Envois_sites += "<br/>";
        }

        /*if (dr1[0]["date_envoi_essentielleimmo"].ToString() != "")
         * {
         *  freq = "0";
         *   Envois_sites += "<strong>EssentielleImmo:</strong><br/> Envoyé le " + dr1[0]["date_envoi_essentielleimmo"].ToString().Substring(0, 10);
         *  if (freq != "0")  Envois_sites += "<br/> Publié  toutes les " + freq + " heures.";
         *   Envois_sites += "<br/>";
         * }*/
        if (dr1[0]["date_envoi_trouv1toit"].ToString() != "")
        {
            freq          = "0";
            Envois_sites += "<strong>Trouv1Toit:</strong><br/> Envoyé le " + dr1[0]["date_envoi_trouv1toit"].ToString().Substring(0, 16);
            if (freq != "0")
            {
                Envois_sites += "<br/> Publié toutes les " + freq + " heures.";
            }
            Envois_sites += "<br/>";
        }
        if (dr1[0]["date_envoi_superimmo"].ToString() != "")
        {
            freq          = get_Freq_envoi("superimmo");
            Envois_sites += "<strong>SuperImmo:</strong><br/> Envoyé le " + dr1[0]["date_envoi_superimmo"].ToString().Substring(0, 16);
            if (freq != "0")
            {
                Envois_sites += "<br/> Publié toutes les " + freq + " heures.";
            }
            Envois_sites += "<br/>";
        }

        return(Envois_sites);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        int    negoid      = 0;
        string negociateur = null;
        Membre member3     = new Membre();

        member3 = (Membre)Session["Membre"];
        String req = "select `num_agence` from Clients where `idclient`=" + member3.IDCLIENT;

        System.Data.DataSet ds2 = null;
        Connexion           c2  = null;

        c2 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c2.Open();
        ds2 = c2.exeRequette(req);
        c2.Close();
        c2 = null;

        System.Data.DataRowCollection dr2 = ds2.Tables[0].Rows;

        string num_agence = "";

        foreach (System.Data.DataRow ligne2 in dr2)
        {
            num_agence = ligne2["num_agence"].ToString();
        }

        if (num_agence == "999")
        {
            num_agence = "001";
        }

        String req2 = "Select * from Agences where `num_agence`='" + num_agence + "'";

        c2 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c2.Open();
        ds2 = c2.exeRequette(req2);
        System.Data.DataSet dsracine = c2.exeRequette("Select * from Environnement");
        c2.Close();
        c2 = null;

        dr2 = ds2.Tables[0].Rows;
        String racine_site = (String)dsracine.Tables[0].Rows[0]["Chemin_racine_site"];


        foreach (System.Data.DataRow ligne2 in dr2)
        {
            Label31.Text = "<strong>PATRIMO</strong><br />";
            Label32.Text = ligne2["adresse_agence"].ToString() + "<br />";
            Label33.Text = ligne2["code_postal_agence"].ToString() + " " + ligne2["ville_agence"].ToString() + "<br />";
            Label34.Text = "Tél : " + ligne2["telephone_agence"].ToString() + "<br />";
        }

        string refsepare = Request.QueryString["refsepare"];
        string requette3 = "select * from Biens where ref='" + refsepare + "'";

        string pathA  = "../images/" + refsepare + "A.JPG";
        string pathB  = "../images/" + refsepare + "B.JPG";
        string pathC  = "../images/" + refsepare + "C.JPG";
        string pathD  = "../images/" + refsepare + "D.JPG";
        string ImageA = racine_site + "images\\" + refsepare + "A.JPG";
        string ImageB = racine_site + "images\\" + refsepare + "B.JPG";
        string ImageC = racine_site + "images\\" + refsepare + "C.JPG";
        string ImageD = racine_site + "images\\" + refsepare + "D.JPG";


        Connexion c3 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c3.Open();
        System.Data.DataSet ds3 = c3.exeRequette(requette3);
        c3.Close();
        System.Data.DataRowCollection dr3 = ds3.Tables[0].Rows;

        foreach (System.Data.DataRow ligne in dr3)
        {
            if (ligne["type de bien"].ToString() != "T")
            {
                Label1.Text = ligne["nombre de pieces"].ToString() + " pièces";
            }
            else
            {
                Label1.Text = "";
            }
            Label1.Text = Label1.Text.ToUpper();

            if (ligne["ref"].ToString().Substring(0, 1) == "V")
            {
                Label2.Text = ligne["prix de vente"].ToString() + " ";
            }
            else
            {
                Label2.Text = ligne["loyer_cc"].ToString() + " ";
            }
            double nombre = Convert.ToDouble(Label2.Text);
            Label2.Text = string.Format("{0:N}", nombre);

            Label3.Text = ligne["ref"].ToString();
            negociateur = ligne["negociateur"].ToString();

            if (ligne["surface terrain"].ToString() == "0")
            {
                surfaceTerrain.Text = null;
            }
            else
            {
                surfaceTerrain.Text = ligne["surface terrain"].ToString() + " m²";
            }
            Label5.Text  = ligne["charges"].ToString();
            Label6.Text  = ligne["travaux"].ToString();
            Label7.Text  = ligne["taxe habitation"].ToString();
            Label8.Text  = ligne["taxe fonciere"].ToString();
            Label9.Text  = ligne["nombre de pieces"].ToString();
            Label10.Text = ligne["nombre de chambres"].ToString();
            Label11.Text = ligne["surface habitable"].ToString();
            Label12.Text = ligne["surface carrez"].ToString();
            Label13.Text = ligne["surface séjour"].ToString();
            Label14.Text = ligne["exposition sejour"].ToString();
            Label15.Text = ligne["etage"].ToString();
            Label16.Text = ligne["nombre etages"].ToString();
            Label17.Text = ligne["code etage"].ToString();
            Label18.Text = ligne["annee construction"].ToString();
            Label19.Text = ligne["type cuisine"].ToString();
            Label20.Text = ligne["nombre wc"].ToString();
            Label21.Text = ligne["nombre salles de bain"].ToString();
            Label22.Text = ligne["nombre salles eau"].ToString();
            Label23.Text = ligne["nombre parkings interieurs"].ToString();
            Label24.Text = ligne["nombre parkings exterieurs"].ToString();

            Label25.Text = ligne["nombre de caves"].ToString();
            Label26.Text = ligne["type chauffage"].ToString();
            Label27.Text = ligne["nature chauffage"].ToString();
            Label28.Text = ligne["ascenceur"].ToString();
            Label29.Text = ligne["balcon"].ToString();
            Label30.Text = ligne["terrasse"].ToString();
            Label38.Text = ligne["surface terrain"].ToString();

            if (ligne["type de bien"].ToString() == "A")
            {
                Labeltype.Text = "APPARTEMENT";
            }
            else if (ligne["type de bien"].ToString() == "T")
            {
                Labeltype.Text = "TERRAIN";
            }
            else if (ligne["type de bien"].ToString() == "M")
            {
                Labeltype.Text = "MAISON";
            }
            else if (ligne["type de bien"].ToString() == "L")
            {
                Labeltype.Text = "LOCAL";
            }
            else if (ligne["type de bien"].ToString() == "I")
            {
                Labeltype.Text = "IMMEUBLE";
            }


            if (System.IO.File.Exists(ImageA))
            {
                ImageBatiment.ImageUrl = pathA;
                ImageBatiment.Height   = 400;
                ImageBatiment.Width    = 524;
            }
            else
            {
                ImageBatiment.ImageUrl = "";
            }

            if (System.IO.File.Exists(ImageB))
            {
                ImageBatiment2.ImageUrl = pathB;
                ImageBatiment2.Width    = 250;
                ImageBatiment2.Height   = 250;
            }
            else
            {
                ImageBatiment2.ImageUrl = "";
            }

            if (System.IO.File.Exists(ImageC))
            {
                ImageBatiment3.ImageUrl = pathC;
                ImageBatiment3.Width    = 250;
                ImageBatiment3.Height   = 250;
            }
            else
            {
                ImageBatiment3.ImageUrl = "";
            }

            if (System.IO.File.Exists(ImageD))
            {
                ImageBatiment4.ImageUrl = pathD;
                ImageBatiment4.Width    = 250;
                ImageBatiment4.Height   = 250;
            }
            else
            {
                ImageBatiment4.ImageUrl = "";
            }
            negoid = (int)ligne["idclient"];
        }
        string    requet = "select * from Clients where idclient=" + negoid + "";
        Connexion c4     = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c4.Open();
        System.Data.DataSet ds4 = c4.exeRequette(requet);
        c4.Close();
        System.Data.DataRowCollection dr4 = ds4.Tables[0].Rows;
        foreach (System.Data.DataRow ligne in dr4)
        {
            Label36.Text = negociateur + "<br />" + ligne["id_client"].ToString() + "<br />" + ligne["tel_client"].ToString();
        }
    }
    protected void Update_modifierAcquereur(object sender, EventArgs e)
    {
        //id acquereur
        string idAcq   = (string)Session["ajout_acquereur_id"];
        string requete = "SELECT cible FROM Acquereurs WHERE `id_acq`=" + idAcq + "";

        System.Data.DataSet ds = null;
        Connexion           c  = null;

        c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        ds = c.exeRequette(requete);
        c.Close();
        c = null;
        System.Data.DataRowCollection dr = ds.Tables[0].Rows;

        Regex regexPays  = new Regex("%type:pays%");
        Regex regexVille = new Regex("%type:vil%");
        Regex regexDep   = new Regex("%type:dep%");
        Regex regexArr   = new Regex("%arr:");

        String cibles = "";

        foreach (System.Data.DataRow ligne in dr)
        {
            cibles = ligne["cible"].ToString();
        }
        string[]           cible = cibles.Split('|');
        int                k;
        ClickableTableCell cell = new ClickableTableCell();

        for (int i = 0; i < cible.Length - 1; i++)                          // i = boucle des villes ou département d'un acquereur
        {
            string currentCible = cible[i];
            cible[i].Trim();
            cible[i] = cible[i].Replace("type:pays", "");
            cible[i] = cible[i].Replace("type:dep", "");
            cible[i] = cible[i].Replace("type:vil", "");

            string[] temp      = cible[i].Split('%');
            string[] cibleInfo = new string[4];
            k = 0;
            for (int j = 0; j < temp.Length; j++)                          // j = boucle des données de la ville i de l'acquereur
            {
                if (temp[j] != "")
                {
                    cibleInfo[k] = temp[j];
                    k++;
                }
            }
            string cibleCode = cibleInfo[0].Split(':')[1];                         // code de la ville ou du département i de l'acquereur
            string cibleNom  = cibleInfo[1].Split(':')[1];                         // nom de la ville ou du département i de l'acquereur
            string cibleCP   = "";
            if (cibleInfo[2] != null)
            {
                cibleCP = cibleInfo[2].Split(':')[1];                                                             // CP de la ville ou du département i de l'acquereur
            }
            string cibleArr = "";
            if (cibleInfo[3] != null)
            {
                cibleArr = cibleInfo[3].Split(':')[1];                              // Arrondissement de la ville i de l'acquereur
            }
            if (regexPays.IsMatch(currentCible))
            {
                List <Arrondissement>     listeArrondissement = null;
                ListeEmplacementRecherche listeVille          = new ListeEmplacementRecherche();
                Emplacement toto = new Emplacement(false, cibleNom, false, false, cibleCode, listeVille, cibleCP, 0, listeArrondissement);
                toto.IsPays = true;
                emplacementAffiche.Add(toto);
            }
            if (regexVille.IsMatch(currentCible) && !regexArr.IsMatch(currentCible))
            {
                List <Arrondissement>     listeArrondissement = null;
                ListeEmplacementRecherche listeVille          = new ListeEmplacementRecherche();
                Emplacement toto = new Emplacement(false, cibleNom, false, false, cibleCode, listeVille, cibleCP, 0, listeArrondissement);
                emplacementAffiche.Add(toto);
            }
            else if (regexDep.IsMatch(currentCible))
            {
                List <Arrondissement>     listeArrondissement = null;
                ListeEmplacementRecherche listeVille          = new ListeEmplacementRecherche();
                Emplacement toto = new Emplacement(true, cibleNom, false, false, cibleCode, listeVille, cibleCP, 0, listeArrondissement);
                emplacementAffiche.Add(toto);
            }
            else if (regexArr.IsMatch(currentCible))
            {
                List <Arrondissement> listeArrondissement = new List <Arrondissement>();
                listeArrondissement = construireListeArrond(cibleCode);
                ListeEmplacementRecherche listeVille = new ListeEmplacementRecherche();
                Emplacement toto = new Emplacement(false, cibleNom, false, true, cibleCode, listeVille, cibleCP, 0, listeArrondissement);
                toto.HasArrondissement = true;
                emplacementAffiche.Add(toto);
            }
        }
        rafraichirEmplacementAffiche();
    }
Beispiel #54
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*
         * recupere la liste des pays/villes/cp correspondant a la saisie de la recherche,
         * et retourne cette liste sous forme de liste deroulante
         * Utilise les parametres ?type=xxx&recherche=xxx dans l'url
         */

        string indentation = "";
        string onglet      = Request.QueryString["onglet"];    //Sert a choisir un margin suivant la page
        string type        = Request.QueryString["type"];      //in {ville,pays,cp}
        string recherche   = Request.QueryString["recherche"]; //Valeur saisie par l'utilisateur
        string style       = Request.QueryString["style"];     //Style css, valeur par defaut oui | si style = no, renvoie les donnes sans mise en page separe par un \n
        string cssClass    = "";

        switch (style)
        {
        case "no": cssClass = ""; break;

        case "mini": cssClass = "ajouterAcquereur_ClickableCellMini"; break;

        default: cssClass = "ajouterAcquereur_ClickableCell"; break;
        }



        if (onglet == "0")
        {
            indentation = "-220"; //onglet mandat
        }
        else if (onglet == "1")   //onglet vendeur
        {
            if (type == "cp")
            {
                indentation = "-130";
            }
            else if (type == "ville")
            {
                indentation = "-380";
            }
            else
            {
                indentation = "-216";
            }
        }
        else if (onglet == "2")
        {
            indentation = "-216";                       //onglet juridique
        }
        else if (onglet == "3")
        {
            indentation = "-216";                       //onglet proprietaire
        }
        else
        {
            indentation = "0";
        }

        string table    = "<div class='AjoutacquereurScrollCell100' style='z-index:2;background-color:#EFEFEF;position:absolute;margin-left:" + indentation + "px;margin-top:10px;padding-right:18px;'><table border='0'><tbody>";
        string tableend = "</tbody></table></div>";
        string result   = "";
        string query    = "";


        if (type != "" && recherche != "")
        {
            recherche = recherche.Replace("'", "''");
            int temp = 0;

            if (type == "all" || type == "pays")           //Recherche pour un pays
            {
                query = "select Titre_Pays from Pays WHERE Titre_Pays LIKE '%" + recherche + "%' ORDER BY Titre_Pays";

                Connexion c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                c.Open();
                System.Data.DataSet ds = c.exeRequette(query);
                c.Close();
                c = null;

                System.Data.DataRowCollection dr = ds.Tables[0].Rows;


                foreach (System.Data.DataRow ligne in dr)
                {
                    string onclick = "saisiePays(this," + onglet + ")";
                    string nomLieu = ligne[0].ToString().ToUpper();
                    result += genererLigne(onclick, nomLieu, "bold " + cssClass);
                }
            }

            if (type == "all" || type == "dep")           //Recherche pour un dep
            {
                if (int.TryParse(recherche, out temp))
                {
                    string zero = (recherche.Length == 1)?"0":"";
                    query = "select departement_code,departement_nom from departement WHERE departement_code = '" + zero + recherche + "' ORDER BY departement_nom";
                }
                else
                {
                    query = "select departement_code,departement_nom from departement WHERE departement_slug LIKE '%" + recherche + "%' OR departement_nom LIKE '%" + recherche + "%' ORDER BY departement_nom";
                }

                Connexion c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                c.Open();
                System.Data.DataSet ds = c.exeRequette(query);
                c.Close();
                c = null;

                System.Data.DataRowCollection dr = ds.Tables[0].Rows;



                foreach (System.Data.DataRow ligne in dr)
                {
                    string onclick = "saisieDep('" + ligne[1].ToString().Replace("'", "\\\'") + "'," + ligne[0] + "," + onglet + ")";
                    string nomLieu = ligne[1].ToString().ToUpper() + " (" + ligne[0] + ")";
                    result += genererLigne(onclick, nomLieu, "bold " + cssClass);
                }
            }

            if (type == "all" || type == "ville")    //Recherche pour une ville
            {
                //requete sql
                string query1 = "select Nom,[Code Postal],refpays from Ville WHERE Nom LIKE '%" + recherche + "%'";
                string query2 = "select Nom,[Code Postal],refpays from Arrondissement WHERE Nom LIKE '%" + recherche + "%'";

                //execution des 2 requete
                Connexion c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                c.Open();
                System.Data.DataTable dt1 = c.exeRequette(query1).Tables[0];
                System.Data.DataTable dt2 = c.exeRequette(query2).Tables[0];
                c.Close();
                c = null;

                dt1.Merge(dt2);        //Fusion des 2 resultats
                DataView view = new DataView(dt1);
                view.Sort = "Nom ASC"; //Tri des resultat | Order by n'est pas utilise dans le sql vu qu'il faut fusionner apres

                foreach (System.Data.DataRowView ligne in view)
                {
                    if (ligne[1].ToString().Length > 5 && type != "all") //On ignore les villes regroupant plusieurs arrondissements (ayant un champ code postal contenant plus d'un cp)
                    {
                        continue;                                        //Pour afficher les arrondissements de maniere independantes
                    }
                    string onclick = "saisieVille('" + ligne[0].ToString().Replace("'", "\\\'") + "','" + ligne[1] + "'," + onglet + ")";
                    string pays    = "" + ligne[2].ToString();
                    string nomLieu = pays + ligne[0].ToString();
                    if (ligne[1].ToString().Length > 5)
                    {
                        nomLieu += " (Tous les arrondissements)";
                    }
                    else
                    {
                        nomLieu += " (" + ligne[1] + ")";
                    }
                    result += genererLigne(onclick, nomLieu, cssClass);
                }
            }



            if (type == "all" && int.TryParse(recherche, out temp) || type == "cp")  //Recherche pour un code postal
            {
                string query1 = "select Nom,[Code Postal] from Ville WHERE [Code Postal] LIKE '" + recherche + "%'";
                string query2 = "select Nom,[Code Postal] from Arrondissement WHERE [Code Postal] LIKE '" + recherche + "%'";

                Connexion c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                c.Open();
                System.Data.DataTable dt1 = c.exeRequette(query1).Tables[0];
                System.Data.DataTable dt2 = c.exeRequette(query2).Tables[0];
                c.Close();
                c = null;

                dt1.Merge(dt2);
                DataView view = new DataView(dt1);
                view.Sort = "Nom ASC";

                foreach (System.Data.DataRowView ligne in view)
                {
                    if (ligne[1].ToString().Length > 5)
                    {
                        continue;
                    }

                    string onclick = "saisieVille('" + ligne[0].ToString().Replace("'", "\\\'") + "','" + ligne[1] + "'," + onglet + ")";
                    string nomLieu = ligne[0] + " (" + ligne[1] + ")";
                    result += genererLigne(onclick, nomLieu, cssClass);
                }
            }

            if (result != "")
            {
                Response.Write(table + result + tableend);
            }
        }
    }
Beispiel #55
0
    protected void remplirTableauAcquereur()
    {
        //recuperation donnée
        System.Data.DataSet ds = null;
        Connexion           c  = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c = null;

        System.Data.DataRowCollection dr = ds.Tables[0].Rows;
        int   count = dr.Count;
        Regex testSurCibleArrondissement = new Regex(@"%arr:[0-9\-]*" + Label6.Text + @"[0-9\-]*%");
        Regex testSurCibleCP             = new Regex(@"%CP:" + Label6.Text + "%");
        Regex testDep  = new Regex(@"%CP:" + Label6.Text.Substring(0, 2) + "%");
        Regex testPays = new Regex(@"%nom:" + bien.PAYS + "%");

        bool enFrance = (bien.PAYS == "FRANCE");

        //TODO
        //FIXME
        //La rapprochement bien -> acquereurs ignore le code postal s'il s'agit d'un bien a l'etranger

        for (int i = 0; i < count; i++)
        {
            bool TestArrondissement = testSurCibleArrondissement.IsMatch(dr[i]["cible"].ToString());
            bool TestCP             = (enFrance)
                                                ?testSurCibleCP.IsMatch(dr[i]["cible"].ToString())
                                                :false;

            bool TestDep = (enFrance)
                                                ?testDep.IsMatch(dr[i]["cible"].ToString())
                                                :false;

            bool TestPays = testPays.IsMatch(dr[i]["cible"].ToString());

            if (!TestPays && !TestDep && !TestArrondissement && !TestCP && dr[i]["cible"].ToString() != "")
            {
                dr.RemoveAt(i);
                i--;
                count--;
            }
        }

        foreach (System.Data.DataRow ligne in dr)
        {
            AcqRraprochement acquereur = new AcqRraprochement(ligne["id_acq"].ToString(), ligne["mail"].ToString());
            listeRaprochement.Add(acquereur);
            TableRow ligneAcquereur = new TableRow();
            ligneAcquereur.Attributes["class"] = "moncompteacq4";
            string contenuCellule;

            TableCell celluleDate = new TableCell();
            celluleDate.Text = ligne["date_ajout"].ToString().Substring(0, 10);
            celluleDate.Text = celluleDate.Text + "<div class = 'tooltip'><span>" + celluleDate.Text + "</span></div>";

            contenuCellule = ligne["nom"].ToString() + "  " + ligne["prenom"].ToString();
            contenuCellule = contenuCellule + "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell celluleNom = new TableCell();
            celluleNom.Text = contenuCellule;

            contenuCellule = "";
            bool hasTel = false;
            if (ligne["tel"].ToString() != "")
            {
                hasTel = true;
                //contenuCellule = espaceTel(ligne["tel"].ToString()); Necessaire car certains tel on ete enregistre sous la forme x.x.x ou x x x dans la base de donne
                contenuCellule = espaceTel(ligne["tel"].ToString().Replace(".", "").Replace(" ", ""));
            }
            contenuCellule += hasTel?"<br/>":"";
            contenuCellule += espaceTel(ligne["portable"].ToString());
            contenuCellule += "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell celluleTel = new TableCell();
            celluleTel.Text = contenuCellule;


            if (ligne["cible"].ToString() != "")
            {
                contenuCellule = parserCible(ligne["cible"].ToString());
            }
            else
            {
                contenuCellule = "";
            }

            TableCell celluleCP = new TableCell();
            celluleCP.Text = contenuCellule;

            contenuCellule  = ligne["nombre_de_pieces_min"].ToString();
            contenuCellule += "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell celluleNbPiece = new TableCell();
            celluleNbPiece.Text = contenuCellule;

            contenuCellule  = ligne["nombre_de_pieces_max"].ToString();
            contenuCellule += "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell celluleNbPieceMax = new TableCell();
            celluleNbPieceMax.Text = contenuCellule;

            contenuCellule  = ligne["surface_habitable_min"].ToString();
            contenuCellule += "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell celluleSurfHab = new TableCell();
            celluleSurfHab.Text = contenuCellule;

            contenuCellule  = ligne["surface_habitable_Max"].ToString();
            contenuCellule += "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell celluleSurfHabMax = new TableCell();
            celluleSurfHabMax.Text = contenuCellule;

            //Permet de mettre un espace tous les 3 chiffres dans le prix
            string temp = ligne["prix_min"].ToString();
            string prix = "";
            int    k    = 0;
            while ((k + 1) * 3 < temp.Length)
            {
                prix = temp.Substring((temp.Length - (k + 1) * 3), 3) + " " + prix;
                k++;
            }
            prix = temp.Substring(0, temp.Length - k * 3) + " " + prix;

            contenuCellule  = prix + " &#8364;";
            contenuCellule += "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell cellulePrixMin = new TableCell();
            cellulePrixMin.Text = contenuCellule;



            temp = ligne["prix_max"].ToString();
            prix = "";
            k    = 0;
            while ((k + 1) * 3 < temp.Length)
            {
                prix = temp.Substring((temp.Length - (k + 1) * 3), 3) + " " + prix;
                k++;
            }
            prix = temp.Substring(0, temp.Length - k * 3) + " " + prix;

            contenuCellule  = prix + " &#8364;";
            contenuCellule += "<div class = 'tooltip'><span>" + contenuCellule + "</span></div>";
            TableCell cellulePrixMax = new TableCell();
            cellulePrixMax.Text = contenuCellule;

            TableCell celluleModif = new TableCell();
            celluleModif.Text = "<a href='modifier_acquereur.aspx?reference="
                                + ligne["id_acq"]
                                + "&refBien=" + Request.QueryString["idAcq"] + "'target=\"_blank\"><img class='croix_rouge' src='../img_site/calepin3.gif'></a>"
                                + "<div class='tooltip'><span>Modifier l'acquéreur</span></div>";

            TableCell celluleContact = new TableCell();
            Label     labelContact   = new Label();
            labelContact.Text = "";
            if (ligne["mail"].ToString() != null && ligne["mail"].ToString() != "")
            {
                celluleContact.Controls.Add(acquereur.selection);
                labelContact.Text += "<a href='mailto:" + ligne["mail"].ToString() + "'>" + "Envoyer mail</a>";
                labelContact.Text += "<div class = 'tooltip'><span class='marqueurMail'>" + ligne["mail"].ToString() + "</span></div>";
            }
            else
            {
                labelContact.Text += "<img src='../img_site/noEmail.png'>" + "<div class='tooltip'><span>Aucun mail</span></div>";
            }

            celluleContact.Controls.Add(labelContact);

            contenuCellule = "<a href='../pages/rapprochement.aspx?idAcq=" + ligne["id_acq"] + "'>"
                             + "<img id='imgphoto' src='../img_site/rapprochement.png' alt='fleche' style='width: 25px' /></a>"
                             + "<div class='tooltip'><span>Rapprochement</span></div>";
            TableCell celluleRapprochement = new TableCell();
            celluleRapprochement.Text = contenuCellule;

            //former la ligne
            ligneAcquereur.Cells.Add(celluleDate);
            ligneAcquereur.Cells.Add(celluleNom);
            ligneAcquereur.Cells.Add(celluleTel);
            ligneAcquereur.Cells.Add(celluleCP);
            ligneAcquereur.Cells.Add(celluleNbPiece);
            ligneAcquereur.Cells.Add(celluleNbPieceMax);
            ligneAcquereur.Cells.Add(celluleSurfHab);
            ligneAcquereur.Cells.Add(celluleSurfHabMax);
            ligneAcquereur.Cells.Add(cellulePrixMin);
            ligneAcquereur.Cells.Add(cellulePrixMax);
            ligneAcquereur.Cells.Add(celluleModif);
            ligneAcquereur.Cells.Add(celluleRapprochement);
            ligneAcquereur.Cells.Add(celluleContact);

            switch (ligne["categorie"].ToString())
            {
            case "large":
                ligneAcquereur.BackColor = System.Drawing.Color.PaleGreen;
                break;

            case "precis":
                ligneAcquereur.BackColor = System.Drawing.Color.YellowGreen;
                break;

            case "investisseur ancien":
                ligneAcquereur.BackColor = System.Drawing.Color.BurlyWood;
                break;

            case "investisseur neuf":
                ligneAcquereur.BackColor = System.Drawing.Color.Khaki;
                break;
            }


            foreach (TableCell cell in ligneAcquereur.Cells)
            {
                cell.Attributes["class"] = "moncompteacq3";
            }

            celluleNbPiece.Attributes["class"]       = "moncompteacqnosize sizedemi";
            celluleNbPieceMax.Attributes["class"]    = "moncompteacqnosize sizedemi";
            celluleSurfHab.Attributes["class"]       = "moncompteacqnosize sizedemi";
            celluleSurfHabMax.Attributes["class"]    = "moncompteacqnosize sizedemi";
            celluleModif.Attributes["class"]         = "moncompteacqnosize sizeicon";
            celluleRapprochement.Attributes["class"] = "moncompteacqnosize sizeicon";

            //placer la ligne
            TableAcquereur.Rows.Add(ligneAcquereur);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["new"] == "1")
        {
            Session["ajout_acquereur"] = "true";
        }
        ((Label)Page.Master.FindControl("titrebandeau")).Text = "Mon espace";



        string requete = "SELECT TITRE_PAYS FROM PAYS";

        System.Data.DataSet ds2 = null;
        Connexion           c2  = null;

        c2 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c2.Open();
        ds2 = c2.exeRequette(requete);
        c2.Close();
        c2 = null;

        DropDownListPays.DataSource     = ds2;
        DropDownListPays.DataTextField  = "TITRE_PAYS";
        DropDownListPays.DataValueField = "TITRE_PAYS";
        DropDownListPays.DataBind();
        DropDownListPays.SelectedIndex = 68;

        if (Request.QueryString["reference"] != null)
        {
            //ucAjoutAcquereur.UpdatePanel1_Init(sender, e);
            //ucAjoutAcquereur.UpdatePanel1_Init(sender, e);


            if (!Page.IsPostBack)
            {
                #region pré-remplissage
                // On remplit tous les champs du formulaire avec les données dans la table bien

                String idAcq;
                idAcq = Request.QueryString["reference"];

                String requette        = "Select * From Acquereurs where `id_acq`=" + idAcq + "";
                System.Data.DataSet ds = null;
                Connexion           c  = null;

                c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                c.Open();
                ds = c.exeRequette(requette);
                c.Close();
                c = null;

                System.Data.DataRowCollection dr = ds.Tables[0].Rows;

                foreach (System.Data.DataRow ligne in dr)
                {
                    // Général
                    if (ligne["civilite"].ToString() == "Mr")
                    {
                        RadioButtonMr.Checked = true;
                    }
                    else if (ligne["civilite"].ToString() == "Mlle")
                    {
                        RadioButtonMlle.Checked = true;
                    }
                    else if (ligne["civilite"].ToString() == "Mme")
                    {
                        RadioButtonMme.Checked = true;
                    }
                    TextBoxNom.Text                     = ligne["nom"].ToString();
                    TextBoxPrenom.Text                  = ligne["prenom"].ToString();
                    TextBoxAdresse.Text                 = ligne["adresse"].ToString();
                    TextBoxCodePostal.Text              = ligne["code_postal"].ToString();
                    TextBoxVille.Text                   = ligne["ville"].ToString();
                    DropDownListPays.Text               = ligne["pays"].ToString();
                    TextBoxTel.Text                     = ligne["tel"].ToString();
                    TextBoxPortable.Text                = ligne["portable"].ToString();
                    TextBoxMail.Text                    = ligne["mail"].ToString();
                    DropDownListTypeAcq.SelectedValue   = ligne["type_acquereur"].ToString();
                    DDLCategorieAcquereur.SelectedValue = ligne["categorie"].ToString();

                    //Caractéristiques principales
                    if (ligne["appartement"].ToString() == "True")
                    {
                        CheckBoxAppartement.Checked = true;
                    }
                    if (ligne["maison"].ToString() == "True")
                    {
                        CheckBoxMaison.Checked = true;
                    }
                    if (ligne["terrain"].ToString() == "True")
                    {
                        CheckBoxTerrain.Checked = true;
                    }
                    if (ligne["autre"].ToString() == "True")
                    {
                        CheckBoxAutre.Checked = true;
                    }
                    DropDownListEtatAvancement.SelectedValue = ligne["etat_avancement"].ToString();
                    TextBoxPrixMin.Text = ligne["prix_min"].ToString();
                    TextBoxPrixMax.Text = ligne["prix_max"].ToString();

                    //Caractéristiques complémentaires
                    TextBoxPiecesMin.Text           = ligne["nombre_de_pieces_min"].ToString();
                    TextBoxPiecesMax.Text           = ligne["nombre_de_pieces_max"].ToString();
                    TextBoxChambresMin.Text         = ligne["nombre_de_chambres_min"].ToString();
                    TextBoxChambresMax.Text         = ligne["nombre_de_chambres_max"].ToString();
                    TextBoxSurfaceHabitableMin.Text = ligne["surface_habitable_min"].ToString();
                    TextBoxSurfaceHabitableMax.Text = ligne["surface_habitable_max"].ToString();
                    TextBoxSurfaceSejourMin.Text    = ligne["surface_sejour_min"].ToString();
                    TextBoxSurfaceSejourMax.Text    = ligne["surface_sejour_max"].ToString();
                    TextBoxFacade.Text            = ligne["facade"].ToString();
                    TextBoxProfondeur.Text        = ligne["profondeur"].ToString();
                    TextBoxSurfaceTerrainMin.Text = ligne["surface_terrain_min"].ToString();
                    TextBoxSurfaceTerrainMax.Text = ligne["surface_terrain_max"].ToString();
                    if ((string)ligne["ascenseur"] == "OUI")
                    {
                        CheckBoxAscenseur.Checked = true;
                    }
                    if ((string)ligne["sous-sol"] == "OUI")
                    {
                        CheckBoxSousSol.Checked = true;
                    }
                    if ((string)ligne["parking/box"] == "OUI")
                    {
                        CheckBoxParking.Checked = true;
                    }
                    TextBoxTexteComplementaire.Text = ligne["texte_complementaire"].ToString();

                    //acquereur.Cible = ucAjoutAcquereur.listeVilleRecherche.createString();
                }
                #endregion
            }
        }
    }
Beispiel #57
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    i = 0;
        String num_max_agence = "001";
        String requette       = "SELECT `num` FROM Biens WHERE `actif`='actif' GROUP BY `num` ORDER BY Count(Biens.[num]) DESC";

        System.Data.DataSet ds = null;
        Connexion           c  = null;

        c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c = null;

        System.Data.DataRowCollection dr = ds.Tables[0].Rows;

        foreach (System.Data.DataRow ligne in dr)
        {
            num_max_agence = (string)ligne["num"].ToString();
            break;
        }
        requette = "SELECT `lien_plan_google`,`num_agence`,`adresse_agence`, `code_postal_agence`, `ville_agence`, `telephone_agence`, `email_agence`, `telecopie_agence` FROM Agences WHERE Agences.[num_agence]='" + num_max_agence + "'";
        c        = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c = null;

        dr = ds.Tables[0].Rows;

        foreach (System.Data.DataRow ligne in dr)
        {
            agence = new List <string> {
                (string)ligne["num_agence"].ToString(), (string)ligne["adresse_agence"].ToString(), (string)ligne["code_postal_agence"].ToString(), (string)ligne["ville_agence"].ToString(), (string)ligne["email_agence"].ToString(), (string)ligne["telephone_agence"].ToString(), (string)ligne["lien_plan_google"].ToString()
            };
            new ListItem((string)ligne["ville_agence"].ToString() + " - " + (string)ligne["code_postal_agence"].ToString() + " - " + (string)ligne["adresse_agence"].ToString() + " - " + (string)ligne["telephone_agence"].ToString(), (string)ligne["num_agence"].ToString());
        }

        i++;
        requette = "SELECT `lien_plan_google`,`num_agence`,`adresse_agence`, `code_postal_agence`, `ville_agence`, `telephone_agence`, `email_agence`, `telecopie_agence` FROM Agences WHERE `num_agence` <> '" + num_max_agence + "' ORDER BY Agences.[ville_agence]";
        c        = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        ds = c.exeRequette(requette);
        c.Close();
        c  = null;
        dr = ds.Tables[0].Rows;
        foreach (System.Data.DataRow ligne in dr)
        {
            new ListItem((string)ligne["ville_agence"].ToString() + " - " + (string)ligne["code_postal_agence"].ToString() + " - " + (string)ligne["adresse_agence"].ToString() + " - " + (string)ligne["telephone_agence"].ToString(), (string)ligne["num_agence"].ToString());
            i++;
        }


        if (!Page.IsPostBack)
        {
            if (Request.QueryString["ref_bien"] != null)
            {
                tbBody.Text = "Bonjour,\r\nJe vous contacte à propos du bien de référence " + Request.QueryString["ref_bien"] + ".\r\n \r\n ";
            }

            if ((Membre)Session["Membre"] != null)
            {
                Membre member = (Membre)Session["Membre"];
                if (member.NOM != null)
                {
                    TextBoxNomcontact.Text = member.NOM;
                }
                if (member.PRENOM != null)
                {
                    TextBoxPrenomcontact.Text = member.PRENOM;
                }
                if (member.TEL != null)
                {
                    TextBoxTelcontact.Text = member.TEL;
                }
                if (member.ID_CLIENT != null)
                {
                    TextBoxEmailcontact.Text = member.ID_CLIENT;
                }
                TextBoxAdressecontact.Text = "";
                if (member.ADRESSE != null)
                {
                    TextBoxAdressecontact.Text += member.ADRESSE + ", ";
                }
                if (member.CODE_POSTAL != null)
                {
                    TextBoxAdressecontact.Text += member.CODE_POSTAL + ", ";
                }
                if (member.VILLE != null)
                {
                    TextBoxAdressecontact.Text += member.VILLE;
                }
            }
        }
    }
Beispiel #58
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //AlerteMailDAO.addAlerteMailBien("aa","aaaaaa");
        if ((Membre)Session["Membre"] != null)
        {
            member = (Membre)Session["Membre"];
        }

        if ((Request.QueryString["ref"] != null) && (Request.QueryString["ref"] != ""))
        {
            reference                 = Request.QueryString["ref"];
            Session["ref"]            = Request.Params["ref"];
            ficheDetail_Panel.Visible = true;
        }
        else
        {
            Response.Redirect("recherche.aspx");
        }

        String page = "-1";

        if (Request.Params["page"] != null)
        {
            page = Request.Params["page"].ToString();
        }


        b = BienDAO.getBien(reference);

        int nbJour = 30; //les X derniers jours pris en compte pour le compteur de visite

        update_counter(nbJour);


        //récupération de la racine du site web pour la vérificaton de la présence des images :
        c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        System.Data.DataSet ds = c.exeRequette("Select * from Environnement");
        c.Close();
        String racine_site = (String)ds.Tables[0].Rows[0]["Chemin_racine_site"];

        String path         = b.REFERENCE.ToString();
        string relativePath = "../images/";
        string absolutePath = "~/images/";
        String JpgA         = relativePath + path + "A.JPG";
        String JpgB         = relativePath + path + "B.JPG";
        String JpgC         = relativePath + path + "C.JPG";
        String JpgD         = relativePath + path + "D.JPG";
        String JpgE         = relativePath + path + "E.JPG";
        String JpgF         = relativePath + path + "F.JPG";
        String JpgG         = relativePath + path + "G.JPG";
        String JpgH         = relativePath + path + "H.JPG";

        if (b.REFERENCE.ToString().Length > 0)
        {
            if (b.REFERENCE.ToString().Substring(0, 1) == "V")
            {
                Session["Transaction"] = "achat";
            }
            else
            {
                Session["Transaction"] = "location";
            }
        }
        else
        {
            Session["Transaction"] = "";
        }

        tabpartage.Text = Request.Url.ToString();


        //Navigation entre les annonces

        if (Session["tabref"] != null)
        {
            if (!((Request.Params["orig"] != null) && (Request.Params["orig"].ToString() == "nego")))
            {
                ArrayList al         = Session["tabref"] as ArrayList;
                int       indexOfRef = al.IndexOf(reference);
                LBLNav.Text = "";
                if (indexOfRef > 0)
                {
                    LBLNav.Text += "<a href=\"fichedetail1.aspx?ref=" + al[indexOfRef - 1] + "&page=" + page + "#bas\">    << </a>";
                }
                LBLNav.Text += "Annonce " + (indexOfRef + 1) + " sur " + al.Count.ToString();
                if (indexOfRef < al.Count - 1)
                {
                    LBLNav.Text += "<a href=\"fichedetail1.aspx?ref=" + al[indexOfRef + 1] + "&page=" + page + "#bas\"> >></a>";
                }

                LBLNav2.Text = LBLNav.Text;
            }
        }


        //TITRE
        LBLTitre.Text = "";

        if (b.CATEGORIE != "")
        {
            LBLTitre.Text += b.CATEGORIE + " ";
        }
        else
        {
            switch (b.TYPE_BIEN)
            {
            case "A": LBLTitre.Text += "Appartement "; break;

            case "M": LBLTitre.Text += "Maison "; break;

            case "L": LBLTitre.Text += "Local "; break;

            case "T": LBLTitre.Text += "Terrain "; break;

            case "I": LBLTitre.Text += "Immeuble "; break;

            default: LBLTitre.Text += "Bien "; break;
            }
        }

        LBLTitre.Text += " à " + b.VILLE_BIEN + " (" + b.CODE_POSTAL_BIEN + ")";
        LBLTitre.Text  = LBLTitre.Text.ToUpper();



        //On recupere le loyer et la surface carrez en (très) bourrin #I<3AncienStagiaires
        //String requette2 = "SELECT * FROM Biens WHERE (((Biens.ref)='" + b.REFERENCE.ToString() + "'));";
        String requette2 = "SELECT * FROM Biens, optionsBiens WHERE Biens.ref=optionsBiens.refOptions AND (((Biens.ref)='" + b.REFERENCE.ToString() + "'));";

        System.Data.DataSet ds1 = null;
        Connexion           c1  = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c1.Open();
        ds1 = c1.exeRequette(requette2);
        c1.Close();
        System.Data.DataRowCollection dr1 = ds1.Tables[0].Rows;

        //PANNEAU ADMIN
        string refer = b.REFERENCE;

        if (member != null && (member.STATUT == "ultranego" || (member.STATUT == "nego" && b.NEGOCIATEUR == member.PRENOM + " " + member.NOM)))
        {
            Admin_Panel.Visible = true;

            if (refer.Contains("L"))
            {
                LBLModifBien.Text = "<a href=\"./modifier_nego_loc.aspx?reference=" + refer + "\"style='color:Gray'><img src='../img_site/flat_round/modifier.png' style='padding-left:15px' border='0' width='17px' > <strong>Modifier le bien</strong></a><br /><br />";
            }
            if (refer.Contains("V"))
            {
                LBLModifBien.Text = "<a href=\"./modifier_nego.aspx?reference=" + refer + "\"style='color:Gray'><img src='../img_site/flat_round/modifier.png' style='padding-left:15px' border='0' width='17px' ><strong> Modifier le bien</strong></a><br /><br />";
            }

            LBL_Envois.Text = "";

            LBL_Envois.Text += get_Envois_sites(dr1);

            lbl_dates.Text = Get_dates();
        }

        //INFOS IMPORTANTES

        //Prix
        if (refer.Contains("V"))
        {
            LBLPrix.Text = "<strong>" + espaceNombre(b.PRIX_VENTE.ToString()) + " &#8364;</strong>";
        }
        if (refer.Contains("L"))
        {
            String Loyer = dr1[0]["loyer_cc"].ToString();
            LBLPrix.Text = "<strong>" + espaceNombre(Loyer) + "&#8364;</strong>";
        }

        LBLSurface.Text = "<strong>" + espaceNombre(b.S_HABITABLE.ToString()) + " m² </strong>";
        if (b.TYPE_BIEN == "T")
        {
            LBLSurface.Text = "<strong>" + espaceNombre(b.S_TERRAIN.ToString()) + "</strong> m² ";
        }
        else if (b.S_HABITABLE == 0)
        {
            String S_CARREZ = dr1[0]["surface carrez"].ToString();
            LBLSurface.Text = "<strong>" + espaceNombre(S_CARREZ) + "</strong> m² ";
        }


        //Zone surface/Pieces
        LBLPieces.Text = "";
        if (b.NBRE_PIECE != 0)
        {
            LBLPieces.Text += "<td style='width:50%;border-bottom: 1px solid lightgrey ; border-left: 1px solid lightgrey;'>"
                              + "<center><div style='font-size: 25px;text-align:left;margin-left:15px'><strong>" + b.NBRE_PIECE + "</strong> pièce(s) </div> "
                              + "</center></td>";
        }
        else
        {
            LBLPieces.Text += "<td style='width:30%;border-bottom: 1px solid lightgrey ;'></td>";
        }


        //Prix par metre carre
        LBLPrixMetre.Text = "";
        if (refer.Contains("V") && b.TYPE_BIEN != "T")
        {
            LBLPrixMetre.Text += "<tr><td style='border-bottom: 1px solid lightgrey ;' colspan='2'><div style='font-size: 25px;text-align:center;margin-left:15px'><strong>";
            if (b.PRIX_VENTE < b.S_HABITABLE)
            {
                LBLPrixMetre.Text += "<br/>< 1 &#8364;/m²<br/>";
            }
            else
            {
                if (b.S_HABITABLE != 0)
                {
                    LBLPrixMetre.Text += (b.PRIX_VENTE / b.S_HABITABLE).ToString() + " &#8364;/m²";
                }
                else if (b.S_CARREZ != 0)
                {
                    LBLPrixMetre.Text += (b.PRIX_VENTE / b.S_CARREZ).ToString() + " &#8364;/m²";
                }
            }
            LBLPrixMetre.Text += "</td></tr>";
        }

        //Icones
        String texte_internet = b.TEXTE_INTERNET.ToLower();

        LBLIcone.Text  = "";
        LBLIcone.Text += "<tr><td colspan='2'><center>";

        List <String> icones = setIcones(texte_internet, dr1[0]["Mer"].ToString(), dr1[0]["Montagne"].ToString());
        int           k      = 0; //On ne veux pas trop d'icones sur une même ligne (sinon pb avec le zoom)

        foreach (String s in icones)
        {
            LBLIcone.Text += "<div class='new_span' style='display:inline-block'><div class='zoom_simple' style='display:inline-block'><img height=32px src='../img_site/flat_round/" + s + ".png' alt='" + s + "'/></div>"
                             + "<span style='margin-left:-60px;margin-top:45px;'>" + get_icon_text(s) + "</span> </div>";
            k++;
            if (k % 7 == 0)
            {
                LBLIcone.Text += "<br/>";
            }
        }
        if (icones.Count == 0)
        {
            LBLIcone.Text = "";
        }
        LBLIcone.Text += "</center></td></tr>";

        //PANNEAU LOCALISATION
        string localisation = b.VILLE_BIEN;

        adresse.Value = localisation;


        //PANNEAU NEGO
        LBLNego.Text = "";
        if (b.NEGOCIATEUR != "")
        {
            BtnSiteNego.Visible = true;
            //Si l'annonce a été envoyée par un nego, on récupère dans la table Clients les coordonnées de ce nego.
            String PrenomNomNego = b.NEGOCIATEUR;

            String requette = "SELECT id_client, tel_client, adresse_client, ville_client FROM Clients WHERE `idclient`=" + b.IDCLIENT;

            Connexion c2 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            c2.Open();
            System.Data.DataSet ds2 = c2.exeRequette(requette);
            c2.Close();
            c2 = null;
            System.Data.DataRowCollection dr2 = ds2.Tables[0].Rows;


            LBLNego.Text += CheckPhotoProfil(b.IDCLIENT) + "<br/>";
            foreach (System.Data.DataRow ligne in dr2)
            {
                mail_nego = ligne["id_client"].ToString();

                LBLNego.Text += "<strong>" + PrenomNomNego + "</strong><br/>"
                                + "Tel: " + ligne["tel_client"].ToString() + "<br/>";

                if (mail_nego.Length > 24)
                {
                    LBLNego.Text += "<a href='mailto:" + mail_nego + "' > " + mail_nego.Substring(0, 20) + "... </a><br/><br/>";
                }
                else
                {
                    LBLNego.Text += "<a href='mailto:" + mail_nego + "' > " + mail_nego + "</a><br/><br/>";
                }
            }
        }
        else if (b.NOM_AGENCE != "")
        {
            LBLNego.Text += "<STRONG>Reférence : </STRONG>" + b.REFERENCE + " - tel: " + b.TEL_AGENCE + "<br />"
                            + "<STRONG>Contact : </STRONG>"
                            + b.NOM_AGENCE + " - " + b.ADRESSE_AGENCE
                            + " - " + b.CODE_POSTALE_AGENCE + "  " + b.VILLE_AGENCE;
        }


        //MENU BOUTONS
        LBLMenuBoutons.Text = "<br/><a href=\"./contact3.aspx?ref_bien=" + refer + "&appelcontact='menu'\"style='color:Gray'><img src='../img_site/flat_round/phone.png' style='margin-bottom:-10px;margin-left:5px;margin-right:5px' width='24px'><strong> Contacter l'agence </strong></a><br /><br />";
        //LBLMenuBoutons.Text += "<a href='#' style='color:Gray'><img src='../img_site/flat_round/alerte.png' style='margin-bottom:-10px;margin-left:5px;margin-right:5px' width='24px'><strong> Alerte sur ce bien </strong></a><br /><br />";


        LBLMenuBoutons.Text += "<a href=\"javascript:popUp('sendToFriend.aspx?ref=" + refer + "')\"style='color:Gray'><img src='../img_site/flat_round/courrier.png' style='margin-bottom:-10px;margin-left:5px;margin-right:5px;margin-top:5px' width='24px'><strong> Envoyer à un ami </strong></a><br /><br />";
        LBLMenuBoutons.Text += "<a href=\"./ajoutSelection.aspx?ref=" + refer + "\"style='color:Gray'><img src='../img_site/flat_round/ajouter.png' style='margin-bottom:-10px;margin-left:5px;margin-right:5px;margin-top:5px' width='24px'><strong> Ajouter à ma selection</strong></a><br /><br />";


        LBLMenuBoutons.Text += "<span  id='bouton_texte' style='color:Gray; cursor:pointer ' onclick=\"javascript:afficher_cacher('texte');\" onmouseover=><img src='../img_site/flat_round/partager.png' style='margin-bottom:-10px;margin-left:5px;margin-right:5px;margin-top:5px' width='24px'><strong> Partager lien</strong></span>";



        //PHOTOS
        LBLPhotos.Text = "";

        string sourceJpgExcl      = "../img_site/bandeau_exclusivite.png";
        string sourceJpgSemExcl   = "../img_site/bandeau_semiExclusif.png";
        string sourceJpgNouveaute = "../img_site/bandeau_nouveaute.png";

        int      nbJourNv = -15;
        DateTime today    = DateTime.Now;

        DateTime todayMoinsJourNv = today.AddDays(nbJourNv);

        switch (b.TYPE_MANDAT)
        {
        case "Exclusif": LBLPhotos.Text += "<img id=\"bandeau2\" alt=\"photo\" src= \"" + sourceJpgExcl + "\" width=\"240\" height=\"240\" />"; break;

        case "SemiExclusif": LBLPhotos.Text += "<img id=\"bandeau2\" alt=\"photo\" src= \"" + sourceJpgSemExcl + "\" />"; break;

        default: if (b.DATE_MODIFICATION >= todayMoinsJourNv)
            {
                LBLPhotos.Text += "<img id=\"bandeau2\" alt=\"photo\" src= \"" + sourceJpgNouveaute + "\" width=\"240\" height=\"240\" />";
            }
            break;
        }

        if (!testFile(absolutePath + JpgA))
        {
            JpgA = "../img_site/images_par_defaut/" + b.TYPE_BIEN + ".jpg";
        }
        JpgA            = relativePath + JpgA;
        LBLPhotos.Text += "<img id='grosseImage' style='vertical-align:top' src=" + JpgA + " />";

        LBLPhotos.Text += "<br/><br/>";
        LBLPhotos.Text += "<span id='videoAnnonce' style='margin-left:100px;'>" + b.URLVIDEO + "</span>";

        LBLPhotos.Text += "<div class='fichePhotoDroite'><table><tr>";
        if (testFile(absolutePath + JpgA))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgA + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:-5px' /></td>";
        }
        if (testFile(absolutePath + JpgB))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgB + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:15px' /></td>";
        }
        if (testFile(absolutePath + JpgC))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgC + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:15px' /></td>";
        }
        if (testFile(absolutePath + JpgD))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgD + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:15px' /></td>";
        }
        LBLPhotos.Text += "</tr><tr>";
        if (testFile(absolutePath + JpgE))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgE + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:-5px' /></td>";
        }
        if (testFile(absolutePath + JpgF))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgF + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:15px' /></td>";
        }
        if (testFile(absolutePath + JpgG))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgG + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:15px' /></td>";
        }
        if (testFile(absolutePath + JpgH))
        {
            LBLPhotos.Text += "<td><img alt=\"Cliquez pour agrandir\" src=" + relativePath + JpgH + " onclick=\"metGrosseImage(this.src)\" style='width:100px;height:80px;margin-left:15px' /></td>";
        }
        LBLPhotos.Text += "</tr></table></div><br/>";


        //TEXTE INTERNET
        if (b.TEXTE_INTERNET == "")
        {
            Texte_Panel.Visible = false;
        }
        LBLTexteInternet.Text  = "<strong>DESCRIPTION DU BIEN: </strong><br/><br/>";
        LBLTexteInternet.Text += nl2br(b.TEXTE_INTERNET);

        LBLTexteInternet.Text += "<br/><br/>";


        //INFOS COMPLEMENTAIRES

        LBLInfoCompl.Text = "";
        string imgSource;

        if (b.COUP_DE_COEUR && b.PRESTIGE)
        {
            imgSource          = "../img_site/band_CdC_Lux/Trigl_cdcPrestige.png";
            LBLInfoCompl.Text += "<img id=\"imgcdcPrestige_fichedetail\" src=\"" + imgSource + "\" alt=\"Coup de coeur et Prestige\"/>";
        }
        else if (b.COUP_DE_COEUR)
        {
            imgSource          = "../img_site/band_CdC_Lux/Trigl_coupDeCoeur.png";
            LBLInfoCompl.Text += "<img id=\"imgcdcPrestige_fichedetail\" src=\"" + imgSource + "\" alt=\"Coup de coeur\"/>";
        }
        else if (b.PRESTIGE)
        {
            imgSource          = "../img_site/band_CdC_Lux/Trigl_prestige.png";
            LBLInfoCompl.Text += "<img id=\"imgcdcPrestige_fichedetail\" src=\"" + imgSource + "\" alt=\"Prestige\"/>";
        }

        LBLInfoCompl.Text += "<table class='fdetail1' style='font-size: 10pt; color: black; width:92%'>"
                             + "<tr class='fdetail2' style='vertical-align:top'><td>";
        if (b.TYPE_BIEN == "M")
        {
            LBLInfoCompl.Text += "<strong>La maison</strong> <br />";
        }
        if (b.TYPE_BIEN == "A")
        {
            LBLInfoCompl.Text += "<strong>L'appartement</strong> <br />";
        }
        if (b.S_HABITABLE != 0)
        {
            LBLInfoCompl.Text += "Surface habitable : " + b.S_HABITABLE.ToString() + " m²<br />";
        }
        if (b.S_TERRAIN != 0)
        {
            LBLInfoCompl.Text += "Surface terrain : " + b.S_TERRAIN + " m²<br />";
        }
        if (b.S_SEJOUR != 0)
        {
            LBLInfoCompl.Text += "Surface séjour : " + b.S_SEJOUR + " m²<br />";
        }
        if (b.A_CONSTRUCTION != "0" && b.A_CONSTRUCTION != "")
        {
            LBLInfoCompl.Text += "Année de construction : " + b.A_CONSTRUCTION + "<br />";
        }
        if (b.ASCENSEUR == "OUI")
        {
            LBLInfoCompl.Text += "Ascenceur : oui <br />";
        }
        LBLInfoCompl.Text += "</td><td><strong>Equipement</strong> <br />";
        if (b.T_CUISINE != "")
        {
            LBLInfoCompl.Text += "Type de cuisine : " + b.T_CUISINE + "<br />";
        }
        if (b.NBRE_SALLE_BAIN != "0" && b.NBRE_SALLE_BAIN != "")
        {
            LBLInfoCompl.Text += "SDB avec baignoire : " + b.NBRE_SALLE_BAIN + "<br /> ";
        }
        if (b.TYPE_CHAUFFAGE != "")
        {
            LBLInfoCompl.Text += "Type de chauffage : " + b.TYPE_CHAUFFAGE + "<br />";
        }
        if (b.NATURE_CHAUFFAGE != "")
        {
            LBLInfoCompl.Text += "Nature du chaffage : " + b.NATURE_CHAUFFAGE + "<br />";
        }
        if (b.BALCON == "OUI")
        {
            LBLInfoCompl.Text += "Balcon : oui <br />";
        }
        if (b.TERRASSE == "OUI")
        {
            LBLInfoCompl.Text += "Terrasse  : oui <br />";
        }
        LBLInfoCompl.Text += "</td><td>";
        if (b.ANCIEN_PRIX > b.PRIX_VENTE && b.ANCIEN_PRIX != 0)
        {
            LBLInfoCompl.Text += "<img class=\"gifPrixEnBaisse\" src=\"../img_site/prixEnBaisse.gif\" alt=\"PRIX EN BAISSE\"/><br/>";
        }
        if (b.NEUF)
        {
            LBLInfoCompl.Text += "<img class=\"gifNeuf\" src=\"../img_site/Neuf.gif\" alt=\"PRIX EN BAISSE\"/><br/>";
        }
        if (b.LOCALISATION != "")
        {
            LBLInfoCompl.Text += "<strong>Localisation</strong>";
        }
        if (b.LOCALISATION != "")
        {
            LBLInfoCompl.Text += "Localisation du bien : " + b.LOCALISATION + "<br />" + "<br />";
        }
        if (b.TAXE_FONCIERE != "0" || b.TAXE_HABITATION != "0" || b.CHARGES != "0")
        {
            LBLInfoCompl.Text += "<strong>Autre:</strong> <br />";
        }
        if (b.TAXE_FONCIERE != "0")
        {
            LBLInfoCompl.Text += "Taxe foncière : " + b.TAXE_FONCIERE + " &#8364;<br />";
        }
        if (b.TAXE_HABITATION != "0")
        {
            LBLInfoCompl.Text += "Taxe d'habitation : " + b.TAXE_HABITATION + " &#8364;<br />";
        }
        if (b.CHARGES != "0")
        {
            LBLInfoCompl.Text += "Charges : " + b.CHARGES + "&#8364; <br />";
        }
        LBLInfoCompl.Text += "</td></tr></table>";

        //CONSOMMATION

        LBLConso.Text = "";
        if (b.LETTRE_CONSO == "" && b.LETTRE_ENERGIE == "")
        {
            Conso_Panel.Visible = false;
        }
        else
        {
            if (b.LETTRE_CONSO != "")
            {
                LBLConso.Text += "<td><center><img src=\"../img_dpe/high_quality/dpe/dpe_" + b.LETTRE_CONSO.ToLower() + ".gif\"/HEIGHT=299 WIDTH=298></center></td>";
            }
            if (b.LETTRE_ENERGIE != "")
            {
                LBLConso.Text += "<td><center><img src=\"../img_dpe/high_quality/ges/ges_" + b.LETTRE_ENERGIE.ToLower() + ".gif\"/HEIGHT=299 WIDTH=298></center></td>";
            }
        }
    }
Beispiel #59
0
    protected void remplirTableauBien()
    {
        String requeteBien = "SELECT * FROM Biens INNER JOIN optionsBiens ON Biens.ref = optionsBiens.refOptions WHERE Biens.[ref]='" + idAcq + "'";

        System.Data.DataSet dst = null;
        Connexion           c   = null;

        c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();
        dst = c.exeRequette(requeteBien);
        c.Close();
        c = null;
        System.Data.DataRowCollection dsr = dst.Tables[0].Rows;

        bien = new Bien();

        foreach (System.Data.DataRow ligne2 in dsr)
        {
            bien.REFERENCE        = ligne2["ref"].ToString();
            bien.ETAT             = ligne2["etat"].ToString();
            bien.TYPE_BIEN        = ligne2["type de bien"].ToString();
            bien.S_HABITABLE      = (int)ligne2["surface habitable"];
            bien.S_SEJOUR         = (int)ligne2["surface séjour"];
            bien.S_TERRAIN        = (int)ligne2["surface terrain"];
            bien.NBRE_PIECE       = (int)ligne2["nombre de pieces"];
            bien.NBRE_CHAMBRE     = (int)ligne2["nombre de chambres"];
            bien.CODE_POSTAL_BIEN = ligne2["code postal du bien"].ToString();
            bien.VILLE_BIEN       = ligne2["ville du bien"].ToString();
            bien.NEGOCIATEUR      = ligne2["negociateur"].ToString();
            bien.LOYER_CC         = (int)ligne2["loyer_cc"];
            bien.PRIX_VENTE       = (int)ligne2["prix de vente"];
            bien.PAYS             = ligne2["PaysBien"].ToString().ToUpper();

            Label11.Text = ligne2["nom vendeur"].ToString() + ligne2["prenom vendeur"].ToString();
            Label13.Text = ligne2["adresse vendeur"].ToString() + " , " + ligne2["ville vendeur"].ToString() + " (" + ligne2["code postal vendeur"].ToString() + "), " + ligne2["pays vendeur"].ToString();

            if (ligne2["tel domicile vendeur"].ToString() == "")
            {
                Label14.Text = "";
            }
            else
            {
                Label14.Text = ligne2["tel domicile vendeur"].ToString();
            }

            if (ligne2["tel domicile vendeur"].ToString() != "" && ligne2["tel bureau vendeur"].ToString() != "")
            {
                Label14.Text += " , ";
            }

            if (ligne2["tel bureau vendeur"].ToString() == "")
            {
                Label14.Text += "";
            }
            else
            {
                Label14.Text += ligne2["tel bureau vendeur"].ToString();
            }

            if (ligne2["adresse mail vendeur"].ToString() == "")
            {
                Label15.Text = "<br/>";
            }
            else
            {
                Label15.Text = "<br/>Email : " + ligne2["adresse mail vendeur"].ToString() + "<br/>";
            }
        }

        String Image = "..\\images\\" + bien.REFERENCE + "A.jpg";

        if (System.IO.File.Exists(MapPath(Image)) == true)
        {
            LabelImage.Text = "<img style='display: block; max-width:150px;max-height:90px;width: auto;height: auto;margin:auto;' src='../images/" + bien.REFERENCE + "A.jpg' alt='photo'>"
                              + "<div class='tooltip'><span><img style='display: block; max-width:320px;max-height:320px;width: auto;height: auto;' src='../images/" + bien.REFERENCE + "A.jpg' alt='photo'></span></div>";
        }
        Label0.Text  = bien.REFERENCE;
        Label1.Text  = bien.ETAT;
        Label12.Text = "<a href=\"./fichedetail1.aspx?ref=" + bien.REFERENCE + "\"target=\"_blank\">Voir Fiche</a>";
        switch (bien.TYPE_BIEN)
        {
        case "A":
            Label2.Text = "Appartement";
            break;

        case "M":
            Label2.Text = "Maison";
            break;

        case "I":
            Label2.Text = "Immeuble";
            break;

        case "L":
            Label2.Text = "Local";
            break;

        case "T":
            Label2.Text = "Terrain";
            break;
        }

        Label3.Text    = bien.S_HABITABLE.ToString();
        Label3bis.Text = bien.S_SEJOUR.ToString();
        Label4.Text    = bien.S_TERRAIN.ToString();
        Label5.Text    = bien.NBRE_PIECE.ToString();
        Label6.Text    = bien.CODE_POSTAL_BIEN;
        Label7.Text    = bien.VILLE_BIEN;
        Label10.Text   = bien.NEGOCIATEUR;

        if (bien.LOYER_CC == 0)
        {
            Label9.Text = bien.PRIX_VENTE.ToString();
        }
        else
        {
            Label9.Text = bien.LOYER_CC.ToString();
        }

        string temp = Label9.Text;
        string prix = "";
        int    k    = 0;

        while ((k + 1) * 3 < temp.Length)
        {
            prix = temp.Substring((temp.Length - (k + 1) * 3), 3) + " " + prix;
            k++;
        }
        prix = temp.Substring(0, temp.Length - k * 3) + " " + prix;

        Label9.Text = prix;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        /* Membre member3 = new Membre();
         * member3 = (Membre)Session["Membre"];
         * String req = "select `num_agence` from Clients where `idclient`=" + member3.IDCLIENT;
         * System.Data.DataSet ds2 = null;
         * Connexion c2 = null;
         *
         * c2 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
         * c2.Open();
         * ds2 = c2.exeRequette(req);
         * c2.Close();
         * c2 = null;
         *
         * System.Data.DataRowCollection dr2 = ds2.Tables[0].Rows;
         *
         * string num_agence = "";
         * foreach (System.Data.DataRow ligne2 in dr2)
         *   num_agence = ligne2["num_agence"].ToString();
         *
         * if (num_agence == "999")
         * {
         *   num_agence = "001";
         * }
         *
         * String req2 = "Select * from Agences where `num_agence`='" + num_agence + "'";
         *
         * c2 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
         * c2.Open();
         * ds2 = c2.exeRequette(req2);
         * System.Data.DataSet dsracine = c2.exeRequette("Select * from Environnement");
         * c2.Close();
         * c2 = null;
         *
         * dr2 = ds2.Tables[0].Rows;
         * String racine_site = (String)dsracine.Tables[0].Rows[0]["Chemin_racine_site"];
         * foreach (System.Data.DataRow ligne2 in dr2)
         * {
         *   Label31.Text = "<strong>PATRIMO</strong><br />";
         *   Label32.Text = ligne2["adresse_agence"].ToString() + "<br />";
         *   Label33.Text = ligne2["code_postal_agence"].ToString() + " " + ligne2["ville_agence"].ToString() + "<br />";
         *   Label34.Text = "Tél : " + ligne2["telephone_agence"].ToString() + "<br />" + "Fax : " + ligne2["telecopie_agence"].ToString() + "<br />";
         * }*/
        Label31.Text = "<strong>PATRIMO</strong><br />";
        Label32.Text = Session["adresse_agence"].ToString() + "<br />";
        Label33.Text = Session["code_postal_agence"].ToString() + " " + Session["ville_agence"].ToString() + "<br />";
        Label34.Text = "Tél : " + Session["telephone_agence"].ToString() + "<br />";

        string racine_site = Session["racine_site"].ToString();
        string refse       = Request.QueryString["refse"];
        String requette    = "select * from Biens where ref='" + refse + "'";

        string pathA  = "../images/" + refse + "A.JPG";
        string pathB  = "../images/" + refse + "B.JPG";
        string pathC  = "../images/" + refse + "C.JPG";
        string pathD  = "../images/" + refse + "D.JPG";
        string ImageA = racine_site + "images\\" + refse + "A.JPG";
        string ImageB = racine_site + "images\\" + refse + "B.JPG";
        string ImageC = racine_site + "images\\" + refse + "C.JPG";
        string ImageD = racine_site + "images\\" + refse + "D.JPG";

        System.Data.DataSet dsN = null;
        Connexion           cN  = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        cN.Open();
        dsN = cN.exeRequette(requette);

        cN.Close();
        System.Data.DataRowCollection drN = dsN.Tables[0].Rows;

        foreach (System.Data.DataRow ligne in drN)
        {
            Ndossier.Text     = refse;
            NMandat.Text      = ligne["num_mandat"].ToString();
            Datemandat.Text   = "";
            Négociateur.Text  = ligne["negociateur"].ToString();
            Vendeur.Text      = ligne["nom vendeur"].ToString();
            Addresse.Text     = ligne["adresse du bien"].ToString();
            Label1.Text       = ligne["type mandat"].ToString();
            cp.Text           = ligne["code postal du bien"].ToString();
            ville.Text        = ligne["ville du bien"].ToString();
            teledomicile.Text = ligne["tel domicile vendeur"].ToString();
            telebureau.Text   = ligne["tel bureau vendeur"].ToString();
            mail.Text         = ligne["adresse mail vendeur"].ToString();
            if (ligne["ref"].ToString().Substring(0, 1) == "V")
            {
                prixdevente.Text = ligne["prix de vente"].ToString();
            }
            else
            {
                prixdevente.Text = ligne["loyer_cc"].ToString();
            }
            double nombre = Convert.ToDouble(prixdevente.Text);
            prixdevente.Text      = string.Format("{0:N}", nombre);
            Netvendeur.Text       = ligne["net vendeur"].ToString();
            Charges.Text          = ligne["charges"].ToString();
            Honoraires.Text       = ligne["honoraires"].ToString();
            Travaux.Text          = ligne["travaux"].ToString();
            Taxefonc.Text         = ligne["taxe fonciere"].ToString();
            prixestime.Text       = ligne["prix estimé"].ToString();
            Taxehab.Text          = ligne["taxe habitation"].ToString();
            nclès.Text            = "";
            SurfCarrez.Text       = ligne["surface carrez"].ToString();
            Pièce.Text            = ligne["nombre de pieces"].ToString();
            Chambre.Text          = ligne["nombre de chambres"].ToString();
            SurfaceHab.Text       = ligne["surface habitable"].ToString();
            wc.Text               = ligne["nombre wc"].ToString();
            Surfaceséjour.Text    = ligne["surface séjour"].ToString();
            Salledebains.Text     = ligne["nombre salles de bain"].ToString();
            EXPOséjour.Text       = ligne["exposition sejour"].ToString();
            Salledeau.Text        = ligne["nombre salles eau"].ToString();
            Jardin.Text           = "";
            Parkingintérieur.Text = ligne["nombre parkings interieurs"].ToString();
            Etage.Text            = ligne["etage"].ToString();
            Parkingextérieur.Text = ligne["nombre parkings exterieurs"].ToString();
            Nbétages.Text         = ligne["nombre etages"].ToString();
            Box.Text              = "";
            Codeétages.Text       = ligne["code etage"].ToString();
            Annéeconst.Text       = ligne["annee construction"].ToString();
            Cave.Text             = ligne["nombre de caves"].ToString();
            Cuisine.Text          = ligne["type cuisine"].ToString();
            Ascenseur.Text        = ligne["ascenceur"].ToString();
            Typechauff.Text       = ligne["type chauffage"].ToString();
            Balcon.Text           = ligne["balcon"].ToString();
            Naturechauff.Text     = ligne["nature chauffage"].ToString();
            Terrasse.Text         = ligne["terrasse"].ToString();
            Label2.Text           = ligne["surface terrain"].ToString();
            textarea.Text         = ligne["texte commentaires"].ToString();

            if (System.IO.File.Exists(ImageA))
            {
                Label35.Text = "<img style=\"width:100%;\" src=" + pathA + "/>";
            }
            else if (System.IO.File.Exists(ImageB))
            {
                Label35.Text = "<img src=" + pathB + "/>";
            }
            else if (System.IO.File.Exists(ImageC))
            {
                Label35.Text = "<img src=" + pathC + "/>";
            }
            else if (System.IO.File.Exists(ImageD))
            {
                Label35.Text = "<img src=" + pathD + "/>";
            }
            else
            {
                Label35.Text = "";
            }

            if (System.IO.File.Exists(ImageA))
            {
                ImageBatiment.ImageUrl = pathA;
                ImageBatiment.Height   = 400;
                ImageBatiment.Width    = 505;
            }
            else
            {
                ImageBatiment.ImageUrl = "";
            }

            if (System.IO.File.Exists(ImageB))
            {
                ImageBatiment2.ImageUrl = pathB;
                ImageBatiment2.Width    = 250;
                ImageBatiment2.Height   = 250;
            }
            else
            {
                ImageBatiment2.ImageUrl = "";
            }

            if (System.IO.File.Exists(ImageC))
            {
                ImageBatiment3.ImageUrl = pathC;
                ImageBatiment3.Width    = 250;
                ImageBatiment3.Height   = 250;
            }
            else
            {
                ImageBatiment3.ImageUrl = "";
            }

            if (System.IO.File.Exists(ImageD))
            {
                ImageBatiment4.ImageUrl = pathD;
                ImageBatiment4.Width    = 250;
                ImageBatiment4.Height   = 250;
            }
            else
            {
                ImageBatiment4.ImageUrl = "";
            }

            Label37.Text = ligne["idclient"].ToString();
        }
        string nego = Négociateur.Text;
        int    negoid;

        int.TryParse(Label37.Text, out negoid);
        string    requet = "select * from Clients where idclient=" + negoid + "";
        Connexion c4     = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        c4.Open();
        System.Data.DataSet ds4 = c4.exeRequette(requet);
        c4.Close();
        System.Data.DataRowCollection dr4 = ds4.Tables[0].Rows;
        foreach (System.Data.DataRow ligne in dr4)
        {
            Label36.Text = nego + "<br />" + "Email: " + ligne["id_client"].ToString() + "<br />" + "Tél: " + ligne["tel_client"].ToString();
        }
    }