Exemplo n.º 1
0
        private void RememberChenged()
        {
            string nameText = CFunc.CheckTextBox(this, nameTextBox.Text, EnterNameExhibit);

            if (nameText == "")
            {
                return;
            }

            int exhibitID = (int)exhibitListBox.SelectedValue;
            int crutchID  = (int)dataset.Exhibit.Rows.Find(exhibitID)["CrutchID"];

            string crutchFilter = "From = ";
            string fromTable    = "";

            dataset.Exhibit.Rows.Find(exhibitID)["Name"]       = nameText;
            dataset.Exhibit.Rows.Find(exhibitID)["CategoryID"] = categorID;

            //В бд нужно текстовое поле!!!
            //dataset.Exhibit.Rows.Find(exhibitID)["CreatedDate"] = createdDate.Value;


            dataset.Exhibit.Rows.Find(exhibitID)["AppearanceDate"] = appearanceDate.Value;

            nameText = CFunc.CheckTextBox(this, TimeTextBox.Text, EnterCreationDate);
            if (nameText == "")
            {
                return;
            }
            dataset.Exhibit.Rows.Find(exhibitID)["CreatedDate"] = nameText;

            //if (photoFilePath != "NOTHING" || photoFilePath != null)
            {
                dataset.Exhibit.Rows.Find(exhibitID)["Photo"] = photoFilePath;
                photoFilePath = null;
            }
            dataset.Exhibit.Rows.Find(exhibitID)["Description"] = descriptionTextBox.Text;
            if (radioMaecenas.Checked)
            {
                dataset.Crutch.Rows.Find(crutchID)["From"] = "Maecenas";
                crutchFilter += "'Maecenas' ";
                fromTable     = "Maecenas";
            }
            if (radioMuseum.Checked)
            {
                dataset.Crutch.Rows.Find(crutchID)["From"] = "Museum";
                crutchFilter += "'Museum' ";
                fromTable     = "Museum";
            }
            crutchFilter += "AND InstanceID = " + getFromID;
            DataView tempCrutch = new DataView(dataset.Crutch);

            tempCrutch.RowFilter = crutchFilter;
            tempCrutch.RowFilter = "From = '" + fromTable + "' " + "AND InstanceID = " + getFromID;
            dataset.Exhibit.Rows.Find(exhibitID)["CrutchID"] = (int)tempCrutch[0][0];
        }
Exemplo n.º 2
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            string nameText = CFunc.CheckTextBox(this, nameTextBox.Text, EnterNameRestorer);

            if (nameText == "")
            {
                return;
            }
            dataset.Restorer.Rows.Find(idListBox)["Name"] = nameText;
            RestorerListBox.DataSource = dataset.Restorer;
        }
Exemplo n.º 3
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            string nameText = CFunc.CheckTextBox(this, nameTextBox.Text, EnterNameShowRoom);

            if (nameText == "")
            {
                return;
            }
            dataset.Showroom.Rows.Find(idListBox)["Name"] = nameText;
            showroomListBox.DataSource = dataset.Showroom;
        }
Exemplo n.º 4
0
        private void ChangeMuseum_Click(object sender, EventArgs e)
        {
            canChooseMuseum = false;
            string nameText = CFunc.CheckTextBox(this, NameMuseum.Text, EnterNameMuseum);

            if (nameText != "")
            {
                dataset.Museum.Rows.Find(idListBox)["Name"] = NameMuseum.Text;
                ChangeMuseum.Enabled = true;
            }
            canChooseMuseum = true;
            return;
        }
Exemplo n.º 5
0
        private void RememberChenged()
        {
            int    restorationID = (int)RestorationListBox.SelectedValue;
            string nameText      = CFunc.CheckTextBox(this, RestorerNameTextBox.Text, EnterNameRestorations);

            if (nameText == "")
            {
                return;
            }
            if (indexNewRestorer == 0)
            {
                CFunc.ShowMessage(ChooseNewRestorer);
                return;
            }
            if (indexNewExhibit == 0)
            {
                CFunc.ShowMessage(ChooseNewExhibit);
                return;
            }
            if (photoFilePath != "NOTHING" || photoFilePath != null)
            {
                dataset.Exhibit.Rows.Find(restorationID)["Photo"] = photoFilePath;
                photoFilePath = "";
            }

            dataset.Restoration.Rows.Find(restorationID)["Name"]        = RestorerNameTextBox.Text;
            dataset.Restoration.Rows.Find(restorationID)["ExhibitID"]   = RestorationRestorerComboBox.SelectedValue;
            dataset.Restoration.Rows.Find(restorationID)["RestorerID"]  = comboBoxExhibit.SelectedValue;
            dataset.Restoration.Rows.Find(restorationID)["Start"]       = RestorationStart.Value;
            dataset.Restoration.Rows.Find(restorationID)["End"]         = RestorationEnd.Value;
            dataset.Restoration.Rows.Find(restorationID)["Photo"]       = photoFilePath;
            dataset.Restoration.Rows.Find(restorationID)["Description"] = descriptionTextBox.Text;
            getRestorationList() = new DataView(dataset.Restoration);
        }
Exemplo n.º 6
0
 private void ChangeMaecenas_Click(object sender, EventArgs e)
 {
     if (idListBox != 0)
     {
         string nameText = CFunc.CheckTextBox(this, NameMaecenas.Text, EnterNameMaecenas);
         if (nameText == "")
         {
             return;
         }
         dataset.Maecenas.Rows.Find(idListBox)["Name"] = NameMaecenas.Text;
         canChooseMaecenas          = true;
         MaecenasListBox.DataSource = dataset.Maecenas;
     }
     else
     {
         CFunc.ShowMessage(NeedChooseMaecenas);
     }
 }
Exemplo n.º 7
0
        private void CreateNewExhibit()
        {
            var      newExhibit = dataset.Exhibit.NewRow();
            DateTime temp       = appearanceDate.Value;

            string nameText = CFunc.CheckTextBox(this, nameTextBox.Text, EnterNameExhibit);

            if (nameText == "")
            {
                return;
            }
            newExhibit["Name"]       = nameText;
            newExhibit["CategoryID"] = comboBoxExhibitCategor.SelectedValue;
            nameText = CFunc.CheckTextBox(this, nameTextBox.Text, EnterCreationDate);
            if (nameText == "")
            {
                return;
            }
            newExhibit["CreatedDate"]    = dateCreationTextBox.Text;
            newExhibit["AppearanceDate"] = appearanceDate.Value;
            if (photoFilePath == "NOTHING")
            {
                CFunc.ShowMessage("Выберите фотографию!");
                return;
            }
            newExhibit["Photo"]       = photoFilePath;
            newExhibit["Description"] = descriptionTextBox.Text;

            int      getFromID    = (int)comboBoxGetFrom.SelectedValue;
            string   crutchFilter = "[From] = '" + tableNameDaritel + "' " + "AND InstanceID = " + getFromID;
            DataView tempCrutch   = new DataView(dataset.Crutch);

            tempCrutch.RowFilter   = crutchFilter;
            newExhibit["CrutchID"] = (int)tempCrutch[0][0];

            dataset.Exhibit.Rows.Add(newExhibit);
        }