private void metroButton1_Click(object sender, EventArgs e) { string s = "feo"; FrmViewEmp ev = new FrmViewEmp(s); ev.ShowDialog(); txtemp.Text = ev.emp; p = ev.p; InitializeBinding(); }
private void btn_add_Click(object sender, EventArgs e) { //try //{ PersonModel p = new PersonModel(); p.Name = txtname.Text; p.Family = txtfamily.Text; p.BimeNum = txtbimenum.Text; //3 p.EmpCode = txtempcode.Text; //4 p.FatherName = txtfathername.Text; //5 p.NationalCode = txtnationalcode.Text; //6 p.EmpShSh = txtshsh.Text; //7 p.EmpMSh1 = txtmsh1.Text; //8 p.EmpMSh2 = txtmsh2.Text; //9 p.CitySodor = txtcitysodor.Text; //10 p.CityCodeSodor = txtcodecitysodor.Text; //11 p.BakhshSodor = txtbakhshsodor.Text; //12 p.CityTavalod = txtcitytavalod.Text; //13 p.CityTavalodCode = txtcodetavalod.Text; //14 p.CountryTavalod = txtcountry.Text; //15 p.CountryTavalodCode = txtcodecountry.Text; //16 //p.TavalodDate = Convert.ToInt32(txttavaloddate.Text.Replace("/","")); //17 p.Job = txtjobname.Text; //18 p.JobCode = txtjobcode.Text; //19 //p.Sex = cmbSex.SelectedItem.ToString(); //20 //p.Married = cmbMarrid.SelectedItem.ToString(); //21 p.Child = txtchild.Value.ToString(); //22 //p.National = cmbNation.SelectedItem.ToString(); //23 p.Education = cmbEducation.SelectedValue.ToString(); //FMessageBox.Show(cmbEducation.SelectedValue.ToString()); //24 p.Branch = txtbranch.Text; //25 p.UniverCity = txtunivercity.Text; //26 //p.YearEducation = Convert.ToInt32(txtyear.Text); //27 p.Tell = txttell.Text; //28 p.CodeTell = txttellcode.Text; //29 p.Mobile = txtmobile.Text; //30 try { //var eMailValidator = new System.Net.Mail.MailAddress(txtemail.Text); //p.Email = eMailValidator.ToString(); } catch (FormatException ex) { FMessageBox.Show("آدرس ایمیل درست وارد کنید"); return; } p.Address = txtaddress.Text; //32 p.Post = txtpost.Text; //33 p.JobNum = txtjobnum.Text; //34 //p.JobDate = Convert.ToInt32(txtjobdate.Text.Replace("/", "")); //35 p.BankName = txtbankname.Text; //36 p.Banknum = txtbanknum.Text; //37 p.BankCard = txtbankcard.Text; //38 p.Pic = pic; //39 if (btnsave.Text == "ویرایش") { p.ID = ID; SqlliteDataAccess.EditPerson(p); FMessageBox.Show("با موفقیت ویرایش شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information); } else { SqlliteDataAccess.SavePerson(p); FMessageBox.Show("با موفقیت ثبت شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information); } FrmViewEmp vm = new FrmViewEmp(); vm.InitializeBinding(); this.Close(); //} //catch (Exception ex) //{ // FMessageBox.Show(ex.Message, "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Warning); //} }
private void پرسنلToolStripMenuItem_Click(object sender, EventArgs e) { FrmViewEmp ve = new FrmViewEmp(); ve.ShowDialog(); }