Example #1
0
        //public Equipment(string ausstatType,string[] controlValues)
        //{
        //    InitializeComponent();
        //    AddTypes();
        //    cbAusstattungstyp.SelectedItem = ausstatType;
        //    AddChildUserControl(controlValues);
        //}
        public Equipment(string equipId, string ausstatType)
        {
            InitializeComponent();
            if (Application.Current.Properties["CopyRowStatus"].ToString() == "No")
            {
                getEquipId = equipId;
            }
            else
            {
                getEquipId = null;
            }
            AddTypes();
            cbAusstattungstyp.SelectedItem = ausstatType;
            string    query = "select * from [as_" + ausstatType + "] where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "' and id=" + equipId + "";
            DataTable dt    = DataConnection.GetData(query);

            if (dt != null && dt.Rows.Count > 0)
            {
                Application.Current.Properties["CadId"] = dt.Rows[0][2].ToString();
            }
            else
            {
                Application.Current.Properties["CadId"] = "";
            }
            AddChildUserControl(dt);
        }
Example #2
0
        public UserControlSonnenschutz(DataTable controlValues)
        {
            InitializeComponent();
            string    query = "select * from code_sonnenschutztyp";
            DataTable dt    = DataConnection.GetData(query);

            cbtype.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbtype.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbtype.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbtype.SelectedItem = controlValues.Rows[0][5].ToString();
                }
            }
            query = "select * from code_lage";
            dt    = DataConnection.GetData(query);
            cbLage.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbLage.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbLage.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbLage.SelectedItem = controlValues.Rows[0][6].ToString();
                }
            }
        }
Example #3
0
 private void Cbflachemax_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cbflachemax.SelectedItem.ToString().StartsWith("NUF"))
     {
         string    query    = "select id,value from DIN277_NUF" + cbflachemax.SelectedItem.ToString().Substring(4, 1);
         DataTable dtResult = DataConnection.GetData(query);
         cbntzumax.Items.Clear();
         for (int i = 0; i < dtResult.Rows.Count; i++)
         {
             cbntzumax.Items.Add(dtResult.Rows[i][0].ToString() + " " + dtResult.Rows[i][1].ToString());
         }
     }
     else if (cbflachemax.SelectedItem.ToString().StartsWith("TF"))
     {
         string    query    = "select id,value from DIN277_TF";
         DataTable dtResult = DataConnection.GetData(query);
         cbntzumax.Items.Clear();
         for (int i = 0; i < dtResult.Rows.Count; i++)
         {
             cbntzumax.Items.Add(dtResult.Rows[i][0].ToString() + " " + dtResult.Rows[i][1].ToString());
         }
     }
     else if (cbflachemax.SelectedItem.ToString().StartsWith("VF"))
     {
         string    query    = "select id,value from DIN277_VF";
         DataTable dtResult = DataConnection.GetData(query);
         cbntzumax.Items.Clear();
         for (int i = 0; i < dtResult.Rows.Count; i++)
         {
             cbntzumax.Items.Add(dtResult.Rows[i][0].ToString() + " " + dtResult.Rows[i][1].ToString());
         }
     }
 }
Example #4
0
        private void FillEquipments()
        {
            lbEquipments.Items.Clear();
            string    query = "select * from as_bodenbelag where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            DataTable dt    = DataConnection.GetData(query);

            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "bodenbelag " + dt.Rows[0][5].ToString() + "," + dt.Rows[0][6].ToString());
            }
            query = "select * from as_fenster where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "fenster" + " (" + dt.Rows[0][8].ToString() + "x" + dt.Rows[0][9].ToString() + ")," + dt.Rows[0][5].ToString() + "," + dt.Rows[0][6].ToString() + "," + dt.Rows[0][7].ToString() + "," + dt.Rows[0][10].ToString() + "," + dt.Rows[0][11].ToString());
            }
            query = "select * from as_feuerloescher where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "feuerloescher " + dt.Rows[0][5].ToString());
            }
            query = "select * from [as_glasbau-element] where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "glasbau-element " + dt.Rows[0][5].ToString() + "," + dt.Rows[0][6].ToString() + "," + dt.Rows[0][7].ToString());
            }
            query = "select * from as_leuchte where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "leuchte " + dt.Rows[0][5].ToString() + "," + dt.Rows[0][6].ToString() + "," + dt.Rows[0][7].ToString() + "," + dt.Rows[0][8].ToString());
            }
            query = "select * from as_oberlicht where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "oberlicht " + "(" + dt.Rows[0][5].ToString() + "x" + dt.Rows[0][6].ToString() + ")");
            }
            query = "select * from as_sonnenschutz where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "sonnenschutz " + dt.Rows[0][5].ToString() + "," + dt.Rows[0][6].ToString());
            }
            query = "select * from as_tor where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "tor" + " (" + dt.Rows[0][7].ToString() + "x" + dt.Rows[0][6].ToString() + ")," + dt.Rows[0][5].ToString() + "," + dt.Rows[0][8].ToString());
            }
            query = "select * from as_tuer where gebaeude_id=" + Application.Current.Properties["BuildingId"] + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and raum_id='" + Application.Current.Properties["CadId"] + "'";
            dt    = DataConnection.GetData(query);
            if (dt != null && dt.Rows.Count > 0)
            {
                lbEquipments.Items.Add("EquipId " + dt.Rows[0][3].ToString() + ": " + "tuer" + " (" + dt.Rows[0][7].ToString() + "x" + dt.Rows[0][8].ToString() + ")," + dt.Rows[0][5].ToString() + "," + dt.Rows[0][6].ToString() + "," + dt.Rows[0][9].ToString() + "," + dt.Rows[0][10].ToString() + "," + dt.Rows[0][11].ToString());
            }
        }
Example #5
0
        private void FillBuildingList()
        {
            string    query    = "select geb_id from kl_gebaeude";
            DataTable dtResult = DataConnection.GetData(query);

            lbDisplayBuilding.Items.Clear();
            for (int i = 0; i < dtResult.Rows.Count; i++)
            {
                lbDisplayBuilding.Items.Add(dtResult.Rows[i][0].ToString());
            }
        }
Example #6
0
        private void FillRoomsByLevelAndBuilding()
        {
            info.Content = "";
            string    query    = "select cad_id from kl_raum where geb_id=" + lbDisplayBuilding.SelectedItem + " and geschoss_id='" + lbDisplayLevels.SelectedValue + "'";
            DataTable dtResult = DataConnection.GetData(query);

            lbDisplayRooms.Items.Clear();
            for (int i = 0; i < dtResult.Rows.Count; i++)
            {
                lbDisplayRooms.Items.Add(dtResult.Rows[i][0].ToString());
            }
            Application.Current.Properties["LevelId"] = lbDisplayLevels.SelectedItem;
        }
Example #7
0
        private void LbDisplayBuilding_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            info.Content = "";
            string    query    = "select geschoss_id,cad_id from kl_raum where geb_id=" + lbDisplayBuilding.SelectedItem + "";
            DataTable dtResult = DataConnection.GetData(query);

            lbDisplayLevels.Items.Clear();
            lbDisplayRooms.Items.Clear();
            for (int i = 0; i < dtResult.Rows.Count; i++)
            {
                lbDisplayLevels.Items.Add(dtResult.Rows[i][0].ToString());
            }
            Application.Current.Properties["BuildingId"] = lbDisplayBuilding.SelectedItem;
        }
        public UserControlLeuchtentyp(DataTable controlValues)
        {
            InitializeComponent();
            string    query = "select * from code­_leuchtentyp";
            DataTable dt    = DataConnection.GetData(query);

            cbLeuchtentyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbLeuchtentyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbLeuchtentyp.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbLeuchtentyp.SelectedItem = controlValues.Rows[0][5].ToString();
                }
            }
            query = "select * from code_leuchtmitteltyp";
            dt    = DataConnection.GetData(query);
            cbLeuchtmitteltyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbLeuchtmitteltyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbLeuchtmitteltyp.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbLeuchtmitteltyp.SelectedItem = controlValues.Rows[0][6].ToString();;
                }
            }
            query = "select * from code_montage";
            dt    = DataConnection.GetData(query);
            cbMontage.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbMontage.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbMontage.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbMontage.SelectedItem     = controlValues.Rows[0][8].ToString();;
                    txtAnzahlleuchtmittel.Text = controlValues.Rows[0][7].ToString();;
                }
            }
        }
Example #9
0
 private void LbDisplayRooms_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (lbDisplayRooms.SelectedItem != null)
     {
         string    query = "select * from kl_raum where geb_id=" + lbDisplayBuilding.SelectedItem + " and geschoss_id='" + lbDisplayLevels.SelectedItem + "' and cad_id='" + lbDisplayRooms.SelectedItem + "'";
         DataTable dt    = DataConnection.GetData(query);
         if (dt != null && dt.Rows.Count > 0)
         {
             info.Content = "Raum-Nr:" + dt.Rows[0][4].ToString() + "\n" + "Flaeche:" + dt.Rows[0][8].ToString() + " m\u00b2" + "\n" + "Lichte Hohe:" + dt.Rows[0][9].ToString() + " m" + "\n" + "Anz. A.P:" + dt.Rows[0][10].ToString() + "\n" + "Anz. M.A:" + dt.Rows[0][11].ToString() + "\n" + "zustand sch:" + dt.Rows[0][12].ToString() + "\n" + "Bemerkung:" + dt.Rows[0][13].ToString() + "\n" + "Umfang [m]:" + dt.Rows[0][14].ToString() + " m" + "\n" + "Anz. Heizho:" + dt.Rows[0][16].ToString() + "\n" + "Anz. Patchsc:" + dt.Rows[0][18].ToString() + "\n" + "Bezeichnug:" + dt.Rows[0][5].ToString() + "\n" + "MAX:" + dt.Rows[0][6].ToString() + "\n" + "IST:" + dt.Rows[0][7].ToString();
         }
         else
         {
             info.Content = "\n\n\n" + "No Data Available";
         }
     }
 }
Example #10
0
        public UserControlFeuerloeschertyp(DataTable controlValues)
        {
            InitializeComponent();
            string    query = "select * from code_feuerloeschertyp";
            DataTable dt    = DataConnection.GetData(query);

            cbFeuerloeschertyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbFeuerloeschertyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbFeuerloeschertyp.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbFeuerloeschertyp.SelectedItem = controlValues.Rows[0][5].ToString();
                }
            }
        }
        public UserControlBodenblagType(string[] controlValues)
        {
            InitializeComponent();
            string    query = "select * from code_bodenbelagtyp";
            DataTable dt    = DataConnection.GetData(query);

            cbBodenbelagtyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbBodenbelagtyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbBodenbelagtyp.Items.Count > 0)
            {
                if (controlValues != null && controlValues.Length == 2)
                {
                    cbBodenbelagtyp.SelectedItem = controlValues[0].ToString().Split(' ')[1];
                    txtFlaeche.Text = controlValues[1];
                }
            }
        }
Example #12
0
 private void BtnEditRoom_Click(object sender, RoutedEventArgs e)
 {
     if (lbDisplayRooms.SelectedItem != null)
     {
         string    query = "select * from kl_raum where geb_id=" + lbDisplayBuilding.SelectedValue + " and geschoss_id='" + Application.Current.Properties["LevelId"] + "' and cad_id='" + lbDisplayRooms.SelectedValue + "'";
         DataTable dt    = DataConnection.GetData(query);
         if (dt != null && dt.Rows.Count > 0)
         {
             //DataTable selectedTable = dt.AsEnumerable()
             //            .Where(r => r.Field<int>("gebaeude_id") ==Convert.ToInt32(lbDisplayBuilding.SelectedValue) && r.Field<string>("geschoss_id")==lbDisplayLevels.SelectedValue.ToString() && r.Field<int>("cad_id")==Convert.ToInt32(lbDisplayRooms.SelectedValue))
             //            .CopyToDataTable();
             AddNewRoom newRoom = new AddNewRoom(lbDisplayRooms.SelectedItem.ToString(), dt, "EditRoom");
             newRoom.ShowDialog();
             info.Content = AddNewRoom.Info;
         }
     }
     else
     {
         MessageBox.Show("Select room");
     }
 }
        public UserControlBodenblagType(DataTable dtControlValues)
        {
            InitializeComponent();
            string    query = "select * from code_bodenbelagtyp";
            DataTable dt    = DataConnection.GetData(query);

            cbBodenbelagtyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbBodenbelagtyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbBodenbelagtyp.Items.Count > 0)
            {
                if (dtControlValues != null)
                {
                    cbBodenbelagtyp.SelectedItem = dtControlValues.Rows[0][5].ToString();
                    txtFlaeche.Text = dtControlValues.Rows[0][6].ToString();
                    getEqupId       = dtControlValues.Rows[0][3].ToString();
                }
            }
        }
Example #14
0
        public AddNewLevel()
        {
            InitializeComponent();
            string    query    = "select geb_id from kl_gebaeude";
            DataTable dtResult = DataConnection.GetData(query);

            selectFloorList = new ArrayList();
            selectFloorList.Add("UG4:00");
            selectFloorList.Add("UG3:01");
            selectFloorList.Add("UG2:02");
            selectFloorList.Add("UG1:03");
            selectFloorList.Add("EG:04");
            for (int i = 1; i <= 25; i++)
            {
                if ((4 + i) <= 9)
                {
                    selectFloorList.Add("OG" + i + ":0" + (4 + i) + "");
                }
                else
                {
                    selectFloorList.Add("OG" + i + ":" + (4 + i) + "");
                }
            }
            selectFloorList.Add("UG4Z:30");
            selectFloorList.Add("UG3Z:31");
            selectFloorList.Add("UG2Z:32");
            selectFloorList.Add("UG1Z:33");
            selectFloorList.Add("EGZ:34");
            for (int i = 1; i <= 25; i++)
            {
                selectFloorList.Add("OG" + i + "Z:" + (34 + i) + "");
            }
            //for (int i = 0; i < dtResult.Rows.Count; i++)
            //{
            //    selectFloorList.Add(dtResult.Rows[i][0].ToString());
            //}
            cbSelectYesOrNo.Items.Clear();
            cbSelectYesOrNo.Items.Add("Yes");
            cbSelectYesOrNo.Items.Add("No");
        }
        public UserControlGlasbauType(DataTable controlValues)
        {
            UpdateChildGetSet = false;
            InitializeComponent();
            string    query = "select * from code_glasbauelementtyp";
            DataTable dt    = DataConnection.GetData(query);

            cbGlasbauType.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbGlasbauType.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbGlasbauType.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbGlasbauType.SelectedItem   = controlValues.Rows[0][5].ToString();
                    txtGlasflaecheeinseitig.Text = controlValues.Rows[0][6].ToString();
                    txtReinigungsflaechen.Text   = controlValues.Rows[0][7].ToString();
                }
            }
        }
Example #16
0
        public UserControlTor(DataTable controlValues)
        {
            InitializeComponent();
            string    query = "select * from code_tortyp";
            DataTable dt    = DataConnection.GetData(query);

            cbTortyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbTortyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbTortyp.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbTortyp.SelectedItem = controlValues.Rows[0][5].ToString();
                }
            }
            query = "select * from code_antrieb";
            dt    = DataConnection.GetData(query);
            cbAntrieb.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbAntrieb.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbTortyp.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbTortyp.SelectedItem = controlValues.Rows[0][8].ToString();
                }
            }
            if (controlValues != null)
            {
                txtHohe.Text   = controlValues.Rows[0][6].ToString();
                txtBreite.Text = controlValues.Rows[0][7].ToString();
            }
        }
Example #17
0
 private void BtnNewRoom_Click(object sender, RoutedEventArgs e)
 {
     if (lbDisplayLevels.SelectedItem != null)
     {
         string    level    = lbDisplayLevels.SelectedItem.ToString();
         string    query    = "select top 1 cad_id from kl_raum where geb_id=" + lbDisplayBuilding.SelectedItem + " and geschoss_id='" + lbDisplayLevels.SelectedValue + "' order by cad_id desc";
         DataTable dtResult = DataConnection.GetData(query);
         if (dtResult != null && dtResult.Rows.Count > 0)
         {
             if (dtResult.Rows[0][0].ToString() != "" || dtResult.Rows[0][0] != null)
             {
                 string getRoom = dtResult.Rows[0][0].ToString().Substring(2, dtResult.Rows[0][0].ToString().Length - 2).ToString();
                 if (getRoom.StartsWith("000"))
                 {
                     getRoom = "001";
                 }
                 else if (getRoom.StartsWith("00"))
                 {
                     getRoom = getRoom.Substring(2, 1).ToString();
                     int value = Int32.Parse(getRoom) + 1;
                     if (value == 10)
                     {
                         getRoom = "0" + value.ToString();
                     }
                     else
                     {
                         getRoom = "00" + value.ToString();
                     }
                 }
                 else if (getRoom.StartsWith("0"))
                 {
                     getRoom = getRoom.Substring(1, 2).ToString();
                     int value = Int32.Parse(getRoom) + 1;
                     if (value == 100)
                     {
                         getRoom = value.ToString();
                     }
                     else
                     {
                         getRoom = "0" + value.ToString();
                     }
                 }
                 else
                 {
                 }
                 string[] levels = level.Split(':');
                 if (levels.Length == 2)
                 {
                     Application.Current.Properties["CadId"] = levels[1] + getRoom;
                     AddNewRoom newRoom = new AddNewRoom(lbDisplayBuilding.SelectedItem.ToString(), lbDisplayLevels.SelectedItem.ToString(), levels[1] + getRoom, "NewRoom");
                     newRoom.ShowDialog();
                     info.Content = AddNewRoom.Info;
                     lbDisplayRooms.Items.Add(levels[1] + getRoom);
                 }
             }
         }
         else
         {
             string[] levels = level.Split(':');
             if (levels.Length == 2)
             {
                 Application.Current.Properties["CadId"] = levels[1] + "000";
                 AddNewRoom newRoom = new AddNewRoom(lbDisplayBuilding.SelectedItem.ToString(), lbDisplayLevels.SelectedItem.ToString(), levels[1] + "000", "NewRoom");
                 newRoom.ShowDialog();
                 info.Content = AddNewRoom.Info;
                 lbDisplayRooms.Items.Add(levels[1] + "000");
             }
         }
     }
     else
     {
         MessageBox.Show("Select levels");
     }
 }
Example #18
0
        private void Btnsaveandclose_Click(object sender, RoutedEventArgs e)
        {
            string gasabsperrsch  = "N";
            string heizungabsperr = "N";
            string Hydrant        = "N";
            string schukostdose   = "N";
            string sprinkler      = "N";
            string telnetzdose    = "N";
            string wasserabsperr  = "N";

            if (chkgasabsperrsch.IsChecked == true)
            {
                gasabsperrsch = "Y";
            }
            if (chkheizungabsperr.IsChecked == true)
            {
                heizungabsperr = "Y";
            }
            if (chkHydrant.IsChecked == true)
            {
                Hydrant = "Y";
            }
            if (chkschukostdose.IsChecked == true)
            {
                schukostdose = "Y";
            }
            if (chksprinkler.IsChecked == true)
            {
                sprinkler = "Y";
            }
            if (chktelnetzdose.IsChecked == true)
            {
                telnetzdose = "Y";
            }
            if (chkwasserabsperr.IsChecked == true)
            {
                wasserabsperr = "Y";
            }
            if (EditRoomId == 0)
            {
                int       id    = 1;
                string    query = "select top 1 id from kl_raum order by id desc";
                DataTable dt    = DataConnection.GetData(query);
                if (dt != null && dt.Rows.Count > 0)
                {
                    if (dt.Rows[0][0].ToString() != "")
                    {
                        id = Int32.Parse(dt.Rows[0][0].ToString()) + 1;
                    }
                }
                query = "insert into kl_raum values(" + id + "," + Building + ",'" + Level + "','" + CadId + "','" + txtraum.Text + "','" + Bezeichnug + "','" + Max + "','" + IST + "'," + txtflaeche.Text + "," + txtLichte.Text + "," + txtAnzap.Text + "," + txtAnzma.Text + ",'" + cbzustand.SelectionBoxItem + "','" + txtbemerku.Text + "'," + txtumfang.Text + "," + chkschukostdose.IsChecked + "," + txtanzheizho.Text + "," + chktelnetzdose.IsChecked + "," + txtanzpatchsc.Text + "," + chksprinkler.IsChecked + "," + chkgasabsperrsch.IsChecked + "," + chkwasserabsperr.IsChecked + "," + chkheizungabsperr.IsChecked + "," + chkHydrant.IsChecked + ")";
                string msg = DataConnection.ExecuteQuery(query);
                if (msg == "Executed")
                {
                    RoomAddOrEdit = "";
                    saveStatus    = "yes";
                    MessageBox.Show("Saved Successfully");

                    Info = "Raum-Nr:" + txtraum.Text + "\n" + "Flaeche:" + txtflaeche.Text + " m\u00b2" + "\n" + "Lichte Hohe:" + txtLichte.Text + " m" + "\n" + "Anz. A.P:" + txtAnzap.Text + "\n" + "Anz. M.A:" + txtAnzma.Text + "\n" + "zustand sch:" + cbzustand.SelectedValue + "\n" + "Bemerkung:" + txtbemerku.Text + "\n" + "Umfang [m]:" + txtumfang.Text + " m" + "\n" + "Anz. Heizho:" + txtanzheizho.Text + "\n" + "Anz. Patchsc:" + txtanzpatchsc.Text + "\n" + "Bezeichnug:" + Bezeichnug + "\n" + "MAX:" + Max + "\n" + "IST:" + IST;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Please enter correct input fields");
                }
            }
            else
            {
                string query = "update kl_raum set raumnummer='" + txtraum.Text + "' , raumbezeichnung='" + Bezeichnug + "' , DIN277_max='" + Max + "' , DIN277_ist='" + IST + "' , raumflaeche=" + txtflaeche.Text + " , lichte_raumhoehe=" + txtLichte.Text + " , anzahl_arbeitsplaetze=" + txtAnzap.Text + " , anzahl_mitarbeiter=" + txtAnzma.Text + " ,  bemerkung='" + txtbemerku.Text + "' , umfang=" + txtumfang.Text + " , schukosteckdose=" + chkschukostdose.IsChecked + " , anzahl_heizkoerper=" + txtanzheizho.Text + " , telefon_netzwerkdose=" + chktelnetzdose.IsChecked + " , anzahl_patschraenke=" + txtanzpatchsc.Text + " , sprinkler=" + chksprinkler.IsChecked + " , gasabsperrschieber=" + chkgasabsperrsch.IsChecked + " , wasserabsperrschieber=" + chkwasserabsperr.IsChecked + " , heizungsabsperrschieber=" + chkheizungabsperr.IsChecked + " , hydrant=" + chkHydrant.IsChecked + " where id=" + EditRoomId + "";
                string msg   = DataConnection.ExecuteQuery(query);
                if (msg == "Executed")
                {
                    RoomAddOrEdit = "";
                    saveStatus    = "yes";
                    MessageBox.Show("Saved Successfully");
                    Info = "Raum-Nr:" + txtraum.Text + "\n" + "Flaeche:" + txtflaeche.Text + " m\u00b2" + "\n" + "Lichte Hohe:" + txtLichte.Text + " m" + "\n" + "Anz. A.P:" + txtAnzap.Text + "\n" + "Anz. M.A:" + txtAnzma.Text + "\n" + "zustand sch:" + cbzustand.SelectedValue + "\n" + "Bemerkung:" + txtbemerku.Text + "\n" + "Umfang [m]:" + txtumfang.Text + " m" + "\n" + "Anz. Heizho:" + txtanzheizho.Text + "\n" + "Anz. Patchsc:" + txtanzpatchsc.Text + "\n" + "Bezeichnug:" + Bezeichnug + "\n" + "MAX:" + Max + "\n" + "IST:" + IST;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Please enter correct input fields");
                }
            }
        }
Example #19
0
        private void BtnSaveFileExport_Click(object sender, RoutedEventArgs e)
        {
            //using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
            //{
            //System.Windows.Forms.DialogResult result = dialog.ShowDialog();
            //MessageBox.Show(dialog.SelectedPath);
            if (folderPath != "")
            {
                string     query      = "select * from kl_raum";
                DataTable  dt         = DataConnection.GetData(query);
                string     txt        = string.Empty;
                FileStream fileStream = new FileStream("" + folderPath + "\\raumbuch.txt", FileMode.Create);
                TextWriter sw         = new StreamWriter(fileStream);


                foreach (DataColumn column in dt.Columns)
                {
                    //Add the Header row for Text file.
                    txt += column.ColumnName + "\t";
                }

                //Add new line.
                txt += "\r\n";
                foreach (DataRow row in dt.Rows)
                {
                    foreach (DataColumn column in dt.Columns)
                    {
                        //Add the Data rows.
                        txt += row[column.ColumnName].ToString() + "\t";
                    }

                    //Add new line.
                    txt += "\r\n";
                }
                sw.Write(txt);

                sw.Close();
                fileStream.Close();
                Process.Start(folderPath + "\\raumbuch.txt", "notepad.exe");

                query = "select geb_id,geschoss_id,cad_id from kl_raum";
                dt    = DataConnection.GetData(query);
                int fileRowId = 1;
                if (dt != null && dt.Rows.Count > 0)
                {
                    txt        = string.Empty;
                    fileStream = new FileStream("" + folderPath + "\\ausstattungu.txt", FileMode.Create);
                    sw         = new StreamWriter(fileStream);
                    string[] columns = new string[24];
                    columns[0]  = "Laufende Nr";
                    columns[1]  = "Gebäude";
                    columns[2]  = "Geschoss";
                    columns[3]  = "CAD-ID";
                    columns[4]  = "Ausstattungstyp";
                    columns[5]  = "Att1";
                    columns[6]  = "Att_Typ2";
                    columns[7]  = "Att2";
                    columns[8]  = "Att_Typ3";
                    columns[9]  = "Att3";
                    columns[10] = "Att_Typ4";
                    columns[11] = "Att4";
                    columns[12] = "Att_Typ5";
                    columns[13] = "Att5";
                    columns[14] = "Att_Typ6";
                    columns[15] = "Att6";
                    columns[16] = "Att_Typ7";
                    columns[17] = "Att7";
                    columns[18] = "Att_Typ8";
                    columns[19] = "Att8";
                    columns[20] = "Att_Typ9";
                    columns[21] = "Att9";
                    columns[22] = "Att_Typ10";
                    columns[23] = "Att10";
                    for (int i = 0; i < columns.Length; i++)
                    {
                        //Add the Header row for Text file.
                        txt += columns[i] + "\t";
                    }

                    //Add new line.
                    txt += "\r\n";

                    //}
                    sw.Write(txt);
                    txt = "";
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        //as_bodenbelag
                        query = "select * from as_bodenbelag where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dtBodenbelag = DataConnection.GetData(query);
                        if (dtBodenbelag != null && dtBodenbelag.Rows.Count > 0)
                        {
                            for (int j = 0; j < dtBodenbelag.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "bodenbelag" + "\t" + dtBodenbelag.Rows[j][5].ToString() + "\t" + "flaeche" + "\t" + dtBodenbelag.Rows[j][6].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_fenster
                        query = "select * from as_fenster where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dtfenster = DataConnection.GetData(query);
                        if (dtfenster != null && dtfenster.Rows.Count > 0)
                        {
                            for (int j = 0; j < dtfenster.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "fenster" + "\t" + dtfenster.Rows[j][5].ToString() + "\t" + "fensterrahmenmaterial" + "\t" + dtfenster.Rows[j][6].ToString() + "\t" + "verglasung" + "\t" + dtfenster.Rows[j][7].ToString() + "\t" + "breite" + "\t" + dtfenster.Rows[j][8].ToString() + "\t" + "hoehe" + "\t" + dtfenster.Rows[j][9].ToString() + "\t" + "feststellanlage" + "\t" + dtfenster.Rows[j][10].ToString() + "\t" + "tuernummer" + "\t" + dtfenster.Rows[j][11].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_feuerloescher
                        query = "select * from as_feuerloescher where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable as_feuerloescher = DataConnection.GetData(query);
                        if (as_feuerloescher != null && as_feuerloescher.Rows.Count > 0)
                        {
                            for (int j = 0; j < as_feuerloescher.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "feuerloescher" + "\t" + as_feuerloescher.Rows[j][5].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_glasbau-element
                        query = "select * from [as_glasbau-element] where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dtglasbauelement = DataConnection.GetData(query);
                        if (dtglasbauelement != null && dtglasbauelement.Rows.Count > 0)
                        {
                            for (int j = 0; j < dtglasbauelement.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "glasbau-element" + "\t" + dtglasbauelement.Rows[j][5].ToString() + "\t" + "glasflaeche einseitig" + "\t" + dtglasbauelement.Rows[j][6].ToString() + "\t" + "reinigungsflaechen" + "\t" + dtglasbauelement.Rows[j][7].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_leuchte
                        query = "select * from as_leuchte where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dtleuchte = DataConnection.GetData(query);
                        if (dtleuchte != null && dtleuchte.Rows.Count > 0)
                        {
                            for (int j = 0; j < dtleuchte.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "leuchte" + "\t" + dtleuchte.Rows[j][5].ToString() + "\t" + "leuchtmitteltyp" + "\t" + dtleuchte.Rows[j][6].ToString() + "\t" + "anzahl leuchtmittel" + "\t" + dtleuchte.Rows[j][7].ToString() + "\t" + "montage" + "\t" + dtleuchte.Rows[j][8].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_oberlicht
                        query = "select * from as_oberlicht where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dtoberlicht = DataConnection.GetData(query);
                        if (dtoberlicht != null && dtoberlicht.Rows.Count > 0)
                        {
                            for (int j = 0; j < dtoberlicht.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "breite" + "\t" + dtoberlicht.Rows[j][5].ToString() + "\t" + "hoehe" + "\t" + dtoberlicht.Rows[j][6].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_sonnenschutz
                        query = "select * from as_sonnenschutz where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dtsonnenschutz = DataConnection.GetData(query);
                        if (dtsonnenschutz != null && dtsonnenschutz.Rows.Count > 0)
                        {
                            for (int j = 0; j < dtsonnenschutz.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "sonnenschutz" + "\t" + dtsonnenschutz.Rows[j][5].ToString() + "\t" + "lage" + "\t" + dtsonnenschutz.Rows[j][6].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_tor
                        query = "select * from as_tor where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dttor = DataConnection.GetData(query);
                        if (dttor != null && dttor.Rows.Count > 0)
                        {
                            for (int j = 0; j < dttor.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "tor" + "\t" + dttor.Rows[j][5].ToString() + "\t" + "breite" + "\t" + dttor.Rows[j][6].ToString() + "\t" + "hoehe" + "\t" + dttor.Rows[j][7].ToString() + "\t" + "antrieb" + "\t" + dttor.Rows[j][8].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                        //as_bodenbelag
                        query = "select * from as_tuer where gebaeude_id=" + dt.Rows[i][0].ToString() + " and geschoss_id='" + dt.Rows[i][1].ToString() + "'";
                        DataTable dttuer = DataConnection.GetData(query);
                        if (dttuer != null && dttuer.Rows.Count > 0)
                        {
                            for (int j = 0; j < dttuer.Rows.Count; j++)
                            {
                                txt += fileRowId + "\t" + dt.Rows[i][0].ToString() + "\t" + dt.Rows[i][1].ToString() + "\t" + dt.Rows[i][2].ToString() + "\t" + "tuer" + "\t" + dttuer.Rows[j][5].ToString() + "\t" + "türblattmaterial" + "\t" + dttuer.Rows[j][6].ToString() + "\t" + "hoehe" + "\t" + dttuer.Rows[j][7].ToString() + "\t" + "breite" + "\t" + dttuer.Rows[j][8].ToString() + "\t" + "glasflaeche einseitig" + "\t" + dttuer.Rows[j][9].ToString() + "\t" + "antrieb" + "\t" + dttuer.Rows[j][10].ToString();
                                txt += "\r\n";
                                sw.Write(txt);
                                fileRowId = fileRowId + 1;
                                txt       = "";
                            }
                        }
                    }
                    sw.Close();
                    fileStream.Close();
                    Process.Start(folderPath + "\\ausstattungu.txt", "notepad.exe");
                }
                //File.Copy(AppDomain.CurrentDomain.BaseDirectory + "\\file2.txt", "" + folderPath + "\\file2.txt");
                //Process.Start(folderPath + "\\file1.txt", "notepad.exe");
                //Process.Start(folderPath + "\\file2.txt", "notepad.exe");
            }
            else
            {
                MessageBox.Show("Select folder to save file");
            }
            //}
        }
Example #20
0
        public UserControlFensterType(string[] controlValues)
        {
            InitializeComponent();
            //cbFeststellanlage.Items.Clear();
            //cbFeststellanlage.Items.Add("Test");

            string    query = "select * from code_fenstertyp";
            DataTable dt    = DataConnection.GetData(query);

            cbFenstertyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbFenstertyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbFenstertyp.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbFenstertyp.SelectedItem = controlValues[1];
                }
            }
            query = "select * from code_fensterrahmenmaterial";
            dt    = DataConnection.GetData(query);
            cbFensterrahmenmaterial.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbFensterrahmenmaterial.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbFensterrahmenmaterial.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbFensterrahmenmaterial.SelectedItem = controlValues[2];
                }
            }
            query = "select * from code_verglasung";
            dt    = DataConnection.GetData(query);
            cbVerglasung.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbVerglasung.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbVerglasung.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbVerglasung.SelectedItem = controlValues[3];
                }
            }
            if (controlValues != null)
            {
                string[] heightwidth = controlValues[0].ToString().Split(' ')[1].ToString().Split('x');
                txtHohe.Text   = heightwidth[0].ToString().Replace("(", "");
                txtBreite.Text = heightwidth[1].ToString().Replace(")", "");
                //cbFeststellanlage.SelectedItem = controlValues[4];
                if (controlValues[4].ToString() != "")
                {
                    if (controlValues[4].ToString() == "Y")
                    {
                        rbYes.IsChecked = true;
                        rbNo.IsChecked  = false;
                    }
                    else
                    {
                        rbNo.IsChecked  = true;
                        rbYes.IsChecked = false;
                    }
                }
                txtTuernummer.Text = controlValues[5];
            }
        }
Example #21
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            string msg = string.Empty;

            if (Equipment.getEquipId == null)
            {
                string    query = "select top 1 id from as_tuer order by id desc";
                DataTable dt    = DataConnection.GetData(query);
                int       id    = 1;
                if (dt != null && dt.Rows.Count > 0)
                {
                    id    = Convert.ToInt32(dt.Rows[0][0].ToString()) + 1;
                    query = "insert into as_tuer values('" + Application.Current.Properties["BuildingId"] + "','" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbTürtyp.SelectedValue + "','" + cbTürblattmaterial.SelectedValue + "','" + txtBreite.Text + "','" + txtHohe.Text + "','" + cbTuerzargenmaterial.SelectedValue + "','" + cbAntrieb.SelectedValue + "')";
                    msg   = DataConnection.ExecuteQuery(query);
                }
                else if (dt != null && dt.Rows.Count >= 1)
                {
                    int status = 0;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i][0].ToString() != "")
                        {
                            id     = Convert.ToInt32(dt.Rows[0][0].ToString()) + 1;
                            query  = "insert into as_tuer values('" + Application.Current.Properties["BuildingId"] + "','" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbTürtyp.SelectedValue + "','" + cbTürblattmaterial.SelectedValue + "','" + txtBreite.Text + "','" + txtHohe.Text + "','" + cbTuerzargenmaterial.SelectedValue + "','" + cbAntrieb.SelectedValue + "')";
                            msg    = DataConnection.ExecuteQuery(query);
                            status = 1;
                            break;
                        }
                    }
                    if (status == 0)
                    {
                        query = "insert into as_tuer values('" + Application.Current.Properties["BuildingId"] + "','" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbTürtyp.SelectedValue + "','" + cbTürblattmaterial.SelectedValue + "','" + txtBreite.Text + "','" + txtHohe.Text + "','" + cbTuerzargenmaterial.SelectedValue + "','" + cbAntrieb.SelectedValue + "')";
                        msg   = DataConnection.ExecuteQuery(query);
                    }
                }
                else
                {
                    query = "insert into as_tuer values('" + Application.Current.Properties["BuildingId"] + "','" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbTürtyp.SelectedValue + "','" + cbTürblattmaterial.SelectedValue + "','" + txtBreite.Text + "','" + txtHohe.Text + "','" + cbTuerzargenmaterial.SelectedValue + "','" + cbAntrieb.SelectedValue + "')";
                    msg   = DataConnection.ExecuteQuery(query);
                }
                if (msg == "Executed")
                {
                    query = "select top 1 id from as_tuer order by id desc";
                    dt    = DataConnection.GetData(query);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        UpdateChildGetSet     = true;
                        SelectChildTypeValues = "EquipId " + dt.Rows[0][0].ToString() + ": " + "tuer" + " (" + txtHohe.Text + "x" + txtBreite.Text + ")," + cbTürtyp.SelectedValue + "," + cbTürblattmaterial.SelectedValue + "," + cbTuerzargenmaterial.SelectedValue + "," + txtGlasflaeche.Text + "," + cbAntrieb.SelectedValue;
                        //var myWindow =
                        Window.GetWindow(this).Close();
                    }
                }
                else
                {
                    MessageBox.Show("Please enter correct input values");
                }
            }
            else
            {
                string updatedcolumns = "türtyp='" + cbTürtyp.SelectedValue + "' , breite='" + txtBreite.Text + "' , hoehe='" + txtHohe.Text + "' , türblattmaterial='" + cbTürblattmaterial.SelectedValue + "' , [glasflaeche einseitig]='" + txtGlasflaeche.Text + "' , antrieb='" + cbAntrieb.SelectedValue + "'";
                msg = EquipmentData.UpdateEquipment("as_tuer", updatedcolumns, Equipment.getEquipId);
                if (msg == "Executed")
                {
                    UpdateChildGetSet     = true;
                    SelectChildTypeValues = "EquipId " + Equipment.getEquipId + ": " + "tuer" + " (" + txtHohe.Text + "x" + txtBreite.Text + ")," + cbTürtyp.SelectedValue + "," + cbTürblattmaterial.SelectedValue + "," + cbTuerzargenmaterial.SelectedValue + "," + txtGlasflaeche.Text + "," + cbAntrieb.SelectedValue;
                    Window.GetWindow(this).Close();
                }
                else
                {
                    MessageBox.Show("Please enter correct input values");
                }
            }
        }
Example #22
0
        public UserControlTuer(DataTable controlValues)
        {
            InitializeComponent();
            string    query = "select * from code_tuertyp";
            DataTable dt    = DataConnection.GetData(query);

            cbTürtyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbTürtyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbTürtyp.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbTürtyp.SelectedItem = controlValues.Rows[0][5].ToString();
                }
            }
            query = "select * from code_tuerblattmaterial";
            dt    = DataConnection.GetData(query);
            cbTürblattmaterial.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbTürblattmaterial.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbTürblattmaterial.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbTürblattmaterial.SelectedItem = controlValues.Rows[0][6].ToString();
                }
            }
            query = "select * from code_tuerzargenmaterial";
            dt    = DataConnection.GetData(query);
            cbTuerzargenmaterial.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbTuerzargenmaterial.Items.Add(dt.Rows[i][1].ToString());
            }
            //if (cbTuerzargenmaterial.Items.Count > 0)
            //{
            //    if (controlValues != null)
            //        cbTuerzargenmaterial.SelectedItem = controlValues[3];
            //}
            query = "select * from code_antrieb";
            dt    = DataConnection.GetData(query);
            cbAntrieb.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbAntrieb.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbAntrieb.Items.Count > 0)
            {
                if (controlValues != null)
                {
                    cbAntrieb.SelectedItem = controlValues.Rows[0][10].ToString();
                    txtGlasflaeche.Text    = controlValues.Rows[0][9].ToString();
                    txtHohe.Text           = controlValues.Rows[0][7].ToString();
                    txtBreite.Text         = controlValues.Rows[0][8].ToString();
                }
            }
        }
Example #23
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            string msg = string.Empty;

            if (Equipment.getEquipId == null)
            {
                string    query = "select top 1 id from as_sonnenschutz order by id desc";
                DataTable dt    = DataConnection.GetData(query);
                int       id    = 1;
                if (dt != null && dt.Rows.Count > 0)
                {
                    if (dt.Rows[0][0].ToString() != "")
                    {
                        id = Convert.ToInt32(dt.Rows[0][0].ToString()) + 1;
                    }
                    query = "insert into as_sonnenschutz values(" + Application.Current.Properties["BuildingId"] + ",'" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbtype.SelectedValue + "','" + cbLage.SelectedValue + "')";
                    msg   = DataConnection.ExecuteQuery(query);
                }
                else if (dt != null && dt.Rows.Count >= 1)
                {
                    int status = 0;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i][0].ToString() != "")
                        {
                            id     = Convert.ToInt32(dt.Rows[0][0].ToString()) + 1;
                            query  = "insert into as_sonnenschutz values('" + Application.Current.Properties["BuildingId"] + "','" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbtype.SelectedValue + "','" + cbLage.SelectedValue + "')";
                            msg    = DataConnection.ExecuteQuery(query);
                            status = 1;
                            break;
                        }
                    }
                    if (status == 0)
                    {
                        query = "insert into as_sonnenschutz values('" + Application.Current.Properties["BuildingId"] + "','" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbtype.SelectedValue + "','" + cbLage.SelectedValue + "')";
                        msg   = DataConnection.ExecuteQuery(query);
                    }
                }
                else
                {
                    query = "insert into as_sonnenschutz values('" + Application.Current.Properties["BuildingId"] + "','" + Application.Current.Properties["LevelId"] + "','" + Application.Current.Properties["CadId"] + "'," + id + ",'','" + cbtype.SelectedValue + "','" + cbLage.SelectedValue + "')";
                    msg   = DataConnection.ExecuteQuery(query);
                }
                if (msg == "Executed")
                {
                    query = "select top 1 id from as_sonnenschutz order by id desc";
                    dt    = DataConnection.GetData(query);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        UpdateChildGetSet     = true;
                        SelectChildTypeValues = "EquipId " + dt.Rows[0][0].ToString() + ": " + "sonnenschutz " + cbtype.SelectedValue + "," + cbLage.SelectedValue;
                        //var myWindow =
                        Window.GetWindow(this).Close();
                    }
                }
                else
                {
                    MessageBox.Show("Please enter correct input values");
                }
            }
            else
            {
                string updatedcolumns = "sonnenschutztyp='" + cbtype.SelectedValue + "' , lage='" + cbLage.SelectedValue + "'";
                msg = EquipmentData.UpdateEquipment("as_sonnenschutz", updatedcolumns, Equipment.getEquipId);
                if (msg == "Executed")
                {
                    UpdateChildGetSet     = true;
                    SelectChildTypeValues = "EquipId " + Equipment.getEquipId + ": " + "sonnenschutz " + cbtype.SelectedValue + "," + cbLage.SelectedValue;
                    Window.GetWindow(this).Close();
                }
                else
                {
                    MessageBox.Show("Please enter correct input values");
                }
            }
        }
Example #24
0
        public UserControlFensterType(DataTable dtControlValues)
        {
            InitializeComponent();
            //cbFeststellanlage.Items.Clear();
            //cbFeststellanlage.Items.Add("Test");

            string    query = "select * from code_fenstertyp";
            DataTable dt    = DataConnection.GetData(query);

            cbFenstertyp.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbFenstertyp.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbFenstertyp.Items.Count > 0)
            {
                if (dtControlValues != null)
                {
                    cbFenstertyp.SelectedItem = dtControlValues.Rows[0][5].ToString();
                }
            }
            query = "select * from code_fensterrahmenmaterial";
            dt    = DataConnection.GetData(query);
            cbFensterrahmenmaterial.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbFensterrahmenmaterial.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbFensterrahmenmaterial.Items.Count > 0)
            {
                if (dtControlValues != null)
                {
                    cbFensterrahmenmaterial.SelectedItem = dtControlValues.Rows[0][6].ToString();
                }
            }
            query = "select * from code_verglasung";
            dt    = DataConnection.GetData(query);
            cbVerglasung.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cbVerglasung.Items.Add(dt.Rows[i][1].ToString());
            }
            if (cbVerglasung.Items.Count > 0)
            {
                if (dtControlValues != null)
                {
                    cbVerglasung.SelectedItem = dtControlValues.Rows[0][7].ToString();
                }
            }
            if (dtControlValues != null)
            {
                txtHohe.Text   = dtControlValues.Rows[0][8].ToString();
                txtBreite.Text = dtControlValues.Rows[0][9].ToString();
                //cbFeststellanlage.SelectedItem = controlValues[4];
                //if (controlValues[4].ToString() != "")
                //{
                //    if (controlValues[4].ToString() == "Y")
                //    {
                //        rbYes.IsChecked = true;
                //        rbNo.IsChecked = false;
                //    }
                //    else
                //    {
                //        rbNo.IsChecked = true;
                //        rbYes.IsChecked = false;

                //    }
                //}
                txtTuernummer.Text = dtControlValues.Rows[0][11].ToString();
            }
        }