private void gridVas_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { Vas v = new Vas(); v.isdn = textPhone.Text; v.vas = e.Item.Cells[0].Text; v.insdate = DateTime.Now; v.enddate = DateTime.Now; v.data = "delete"; this.PspProxy.SaveVas(v); gridVas.EditItemIndex = -1; BindVas(); }
public void SaveVas(Vas v) { ValidatePermission("Vas.Edit"); SqlConnection con = new SqlConnection(strCon); daVas.UpdateCommand.Connection = con; try { con.Open(); daVas.UpdateCommand.Parameters["@isdn"].Value = v.isdn; daVas.UpdateCommand.Parameters["@vas"].Value = v.vas; daVas.UpdateCommand.Parameters["@begdate"].Value = v.insdate; daVas.UpdateCommand.Parameters["@enddate"].Value = v.enddate; daVas.UpdateCommand.Parameters["@data"].Value = v.data; daVas.UpdateCommand.ExecuteNonQuery(); } catch (Exception ex) { AsyncLogWriter("SaveVas:" + ex); } finally { con.Close(); } }
private void gridVas_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { TextBox vasExpDate = (TextBox)e.Item.Cells[2].Controls[0]; TextBox vasData = (TextBox)e.Item.Cells[3].Controls[0]; Response.Write(e.Item.Cells[0].Text); Vas v = new Vas(); v.isdn = textPhone.Text; v.vas = e.Item.Cells[0].Text; v.insdate = Convert.ToDateTime(e.Item.Cells[1].Text); v.enddate = Convert.ToDateTime(vasExpDate.Text); v.data = vasData.Text; this.PspProxy.SaveVas(v); gridVas.EditItemIndex = -1; BindVas(); }