示例#1
0
        public NewOwner(Form1 form1)
        {
            InitializeComponent();
            helper = form1;
            OwnerTableHandler ownerTableHandler = new OwnerTableHandler();

            owners = ownerTableHandler.Select();
        }
示例#2
0
 public void DeleteDatas(string number)
 {
     if (cb_OwnORAni.SelectedIndex == 0)
     {
         OwnerTableHandler ownerTableHandler   = new OwnerTableHandler();
         string            deletedrecordnumber = ownerTableHandler.Delete(number).ToString(); ////////////////6--------------------------------
         MessageBox.Show(deletedrecordnumber + "rekord sikeresen törölve!");
         owners = ownerTableHandler.Select();
         ownerTableHandler.Delete(number);
         Initializedgv_table();
         UpdateDgv_table();
     }
 }
        public void DataSet()
        {
            OwnerTableHandler ownerTableHandler = new OwnerTableHandler();

            foreach (Owners owners in ownerTableHandler.Select())
            {
                if (owners.OwnerId == ID)
                {
                    switch (cb_Set.SelectedIndex)
                    {
                    case 0:
                        ownerTableHandler.Update(ID, "familyName", tb_NewSet.Text, OracleDbType.Varchar2);
                        break;

                    case 1:
                        ownerTableHandler.Update(ID, "surName", tb_NewSet.Text, OracleDbType.Varchar2);
                        break;

                    case 2:
                        ownerTableHandler.Update(ID, "zipCode", tb_NewSet.Text, OracleDbType.Varchar2);
                        break;

                    case 3:
                        ownerTableHandler.Update(ID, "city", tb_NewSet.Text, OracleDbType.Varchar2);
                        break;

                    case 4:
                        ownerTableHandler.Update(ID, "address", tb_NewSet.Text, OracleDbType.Varchar2);
                        break;

                    case 5:
                        ownerTableHandler.Update(ID, "phonenumber", tb_NewSet.Text, OracleDbType.Varchar2);
                        break;

                    case 6:
                        ownerTableHandler.Update(ID, "email", tb_NewSet.Text, OracleDbType.Varchar2);
                        break;

                    default:
                        break;
                    }
                    break;
                }
            }
        }
示例#4
0
 public void UpdateDgv_table()
 {
     dgv_table.Rows.Clear();
     if (cb_OwnORAni.SelectedIndex == 0)
     {
         OwnerTableHandler ownerTableHandler = new OwnerTableHandler();
         foreach (Owners o in ownerTableHandler.Select())
         {
             dgv_table.Rows.Add(new object[]
             {
                 o.OwnerId,
                 o.FamilyName,
                 o.Surname,
                 o.BirthDate.ToString("yyyy.MM.dd")
             });
         }
     }
 }
示例#5
0
        private void btn_addnewowner_Click(object sender, EventArgs e)
        {
            OwnerTableHandler ownerTableHandler = new OwnerTableHandler();

            try
            {
                Owners newo = new Owners();
                newo.FamilyName = tb_FN.Text;
                newo.Surname    = tb_SN.Text;
                newo.BirthDate  = dtp_BD.Value;
                //if (ownerTableHandler.CheckZipCode(tb_ZC.Text))
                //{
                newo.ZipCode = tb_ZC.Text;
                //}
                newo.City    = tb_CT.Text;
                newo.Address = tb_AD.Text;
                //if (ownerTableHandler.CheckPhonenumber(tb_PN.Text))
                //{
                newo.PhoneNumber = tb_PN.Text;
                //}
                newo.Email   = tb_EM.Text;
                newo.OwnerId = tb_FN.Text[0].ToString() + tb_SN.Text[1].ToString() + tb_ZC.Text[2].ToString() + tb_CT.Text[3].ToString() + tb_AD.Text[3].ToString();
                tb_FN.Clear();
                tb_SN.Clear();
                tb_ZC.Clear();
                tb_CT.Clear();
                tb_AD.Clear();
                tb_PN.Clear();
                tb_EM.Clear();

                OwnerTableHandler handler = new OwnerTableHandler();
                int insertedrownum        = handler.Insert(newo);
                MessageBox.Show(insertedrownum + "sor sikeresen rögzítve");
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            helper.UpdateDgv_table();
        }
示例#6
0
        private void Updatelb_Datas(string Id)
        {
            OwnerTableHandler ownerTableHandler = new OwnerTableHandler();

            foreach (Owners o in ownerTableHandler.Select())
            {
                if (o.OwnerId == Id)
                {
                    lbl_ownerid.Text     = o.OwnerId.ToString();
                    lbl_familyname.Text  = o.FamilyName;
                    lbl_surname.Text     = o.Surname;
                    lbl_birthdate.Text   = o.BirthDate.ToString("yyyy.MM.dd");
                    lbl_zipcode.Text     = o.ZipCode;
                    lbl_city.Text        = o.City;
                    lbl_address.Text     = o.Address;
                    lbl_phonenumber.Text = o.PhoneNumber;
                    lbl_email.Text       = o.Email;
                }
            }
        }