private void btnOk_Click(object sender, EventArgs e) { FrmEmp em = new FrmEmp(); //em.fill(); FMessageBox.Show("d"); this.Visible = false; }
private void button1_Click(object sender, EventArgs e) { TypeSalaryModel t = new TypeSalaryModel(); t.Name = txtname.Text; SqlliteDataAccess.SaveType(t); FMessageBox.Show("با موفقیت ذخیره شد", "پیام"); InitializeBinding(); }
private void button2_Click(object sender, EventArgs e) { TypeSalaryModel t = new TypeSalaryModel(); t.ID = Convert.ToInt32(dgvhokm.CurrentRow.Cells[0].Value); SqlliteDataAccess.DeleteType(t); FMessageBox.Show("با موفقیت حذف شد", "پیام"); txtname.ResetText(); InitializeBinding(); }
private void button2_Click(object sender, EventArgs e) { HokmModel h = new HokmModel(); h.ID = Convert.ToInt32(dgvhokm.CurrentRow.Cells[0].Value.ToString()); SqlliteDataAccess.DeleteHokm(h); FMessageBox.Show("با موفقیت حذف شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information); InitializeBinding(); }
private void txtcity_TextChanged(object sender, EventArgs e) { try { //search= txtcity.Text; // Frmcity = SqlliteDataAccess.LoadCity(g); // dgvcity.DataSource = Frmcity; } catch (Exception ex) { FMessageBox.Show(ex.Message, "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Warning); } }
private void pictureBox2_Click(object sender, EventArgs e) { if (dgvperson.CurrentRow.Cells[0].Value != null) { PersonModel pe = new PersonModel(); pe.ID = Convert.ToInt32(dgvperson.CurrentRow.Cells[0].Value.ToString()); SqlliteDataAccess.DeletePerson(pe); FMessageBox.Show("با موفقیت حذف شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information); InitializeBinding(); } }
private void LoadCity() { try { Frmcity = SqlliteDataAccess.LoadCity(); dgvcity.DataSource = Frmcity; dgvcity.Columns["Code"].HeaderText = "کد"; dgvcity.Columns["Name"].HeaderText = "نام گروه"; } catch (Exception ex) { FMessageBox.Show(ex.Message, "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Warning); } }
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); //} }