protected void gvPPE2_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Transfer")) { try { int id = int.Parse(e.CommandArgument.ToString()); TransferTableAdapters.TransferTableAdapter transferTA = new TransferTableAdapters.TransferTableAdapter(); transferTA.TransferPPE(id, int.Parse(ddlCompany1.Text), int.Parse(ddlDepartment1.Text), loggedInUserId); } catch { } } }
protected void btnTransferAll2_Click(object sender, EventArgs e) { foreach (GridViewRow gr in gvPPE2.Rows) { try { HiddenField hfPPEId = (HiddenField)gr.FindControl("hfPPEId2"); TransferTableAdapters.TransferTableAdapter ta = new TransferTableAdapters.TransferTableAdapter(); ta.TransferPPE(int.Parse(hfPPEId.Value), int.Parse(ddlCompany1.SelectedValue), int.Parse(ddlDepartment1.SelectedValue), loggedInUserId); } catch { } } }