private void btnApply_Click_1(object sender, EventArgs e) { try { //if (txtAlarm.Text == "" || txtName.Text == "" || txtPartId.Text == "" || txtPrice.Text == "") // MessageBox.Show("لطفا موارد خواسته شده را پر نمایید"); //else //{ var db = new linqDataContext(); db.EditPart(Convert.ToInt32(txtPartId.Text), txtPartName.Text, Convert.ToInt32(txtPartPrice.Text), Convert.ToInt32(txtPartAlert.Text)); var gvobj = new MainFrm(); gvobj.GVTablePart.DataSource = db.ShowParts(); this.Close(); } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } //} }