本文整理汇总了C#中System.Web.UI.WebControls.GridViewUpdateEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewUpdateEventArgs类的具体用法?C# GridViewUpdateEventArgs怎么用?C# GridViewUpdateEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridViewUpdateEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了GridViewUpdateEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PrideRunorderGV_RowUpdating
protected void PrideRunorderGV_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//String orderId = ((TextBox)PrideRunOrderGV.Rows[e.RowIndex].Cells[1].Controls[0]).Text; //order_id
//String status = ((DropDownList)PrideRunOrderGV.Rows[e.RowIndex].Cells[2].Controls[1]).SelectedItem.Value; // order_status
//String paymentDate = ((TextBox)PrideRunOrderGV.Rows[e.RowIndex].Cells[3].Controls[0]).Text; //payment_date
//String paymentType = ((TextBox)PrideRunOrderGV.Rows[e.RowIndex].Cells[4].Controls[0]).Text; //payment type
String orderId = ((TextBox)PrideRunOrderGV.Rows[e.RowIndex].Cells[1].Controls[0]).Text; //order_id
String status = ((DropDownList)PrideRunOrderGV.Rows[e.RowIndex].Cells[2].Controls[1]).SelectedItem.Value; // order_status
String paymentDate = ((TextBox)PrideRunOrderGV.Rows[e.RowIndex].Cells[3].Controls[0]).Text; //payment_date
String paymentType = ((TextBox)PrideRunOrderGV.Rows[e.RowIndex].Cells[4].Controls[0]).Text; //payment type
//this line above does not work....i can't get hte value
//String temp = PrideRunOrderGV.Rows[e.RowIndex].Cells[2].FindControl("statusListJovino").ToString();
//Session["statusSelected"] = (((DropDownList)sender).SelectedValue);
//status = (String)Session["statusSelected"];
//controller.updateOrderStatus(Int16.Parse(orderId), status);
controller.updateOrder(Int16.Parse(orderId), status, paymentDate, paymentType);
PrideRunOrderGV.EditIndex = -1;
this.rebind();
}
开发者ID:jovinoribeiro,项目名称:EBFRW,代码行数:27,代码来源:PrideRunOrders.aspx.cs
示例2: gvDSDiary_RowUpdating
protected void gvDSDiary_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = gvDSDiary.Rows[e.RowIndex];
//drdto = new DiaryDTO();
int madiary = Int32.Parse(gvDSDiary.DataKeys[e.RowIndex].Value.ToString());
//drdto.MaDiary = madiary;
//TextBox thamchieu = row.Cells[1].Controls[0] as TextBox;
//drdto.MaClaim = thamchieu.Text;
//TextBox ngay = row.Cells[2].Controls[0] as TextBox;
//drdto.Ngay = DateTime.Parse(ngay.Text);
//TextBox diengiai = row.Cells[3].Controls[0] as TextBox;
//drdto.DienGiai = diengiai.Text;
//TextBox sogio = row.Cells[4].Controls[0] as TextBox;
//drdto.SoGio = float.Parse(sogio.Text);
//TextBox batdau = row.Cells[5].Controls[0] as TextBox;
//drdto.NgayGioBatDau = DateTime.Parse(batdau.Text);
//TextBox ketthuc = row.Cells[6].Controls[0] as TextBox;
//drdto.NgayGioKetThuc = DateTime.Parse(ketthuc.Text);
TextBox ketqua = row.Cells[7].Controls[0] as TextBox;
string result=ketqua.Text;
if (result == null)
result = "Will be update late!";
bool cn = drdao.updateResult(madiary,result);
if (cn == true)
{
e.Cancel = true;
gvDSDiary.EditIndex = -1;
loadDiaryAll();
}
}
开发者ID:baotiit,项目名称:savvyplatform,代码行数:31,代码来源:Diary.aspx.cs
示例3: GV_RowUpdating
protected void GV_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
using (OracleConnection conn = new OracleConnection(DBHelper.ConnectionString))
{
string reason_id = GV.DataKeys[e.RowIndex].Values[0].ToString();
string reason_desc = ((TextBox)GV.Rows[e.RowIndex].FindControl("TxtDesc")).Text;
string active = ((CheckBox)(GV.Rows[e.RowIndex].FindControl("ChkActive"))).Checked == true ? "1" : "0";
string sqlupdate = "update jp_lack_reason set reason_desc = '" + reason_desc + "',is_valid='" + active + "' where reason_id = '" + reason_id + "' ";
OracleCommand updatecomm = new OracleCommand(sqlupdate, conn);
try
{
conn.Open();
updatecomm.ExecuteNonQuery();
GV.EditIndex = -1;
GVDataBind();
}
catch (Exception ex)
{
conn.Close();
Response.Write("<script language=javascript>alert('" + ex.Message + "')</script>");
}
finally
{
updatecomm.Dispose();
conn.Dispose();
conn.Close();
}
}
}
开发者ID:freudshow,项目名称:raffles-codes,代码行数:31,代码来源:lack_reason.aspx.cs
示例4: GridView1_RowUpdating
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
SqlConnection con = new SqlConnection(str);
con.Open();
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
Label l1 = (Label)row.FindControl("lblid");
int id = Convert.ToInt32(l1.Text);
TextBox txtbox = (TextBox)row.FindControl("txtname");
String name = txtbox.Text;
GridView1.EditIndex = -1;
SqlCommand cmd = new SqlCommand("update advisor set [email protected] where [email protected]", con);
cmd.Parameters.AddWithValue("@id", id);
cmd.Parameters.AddWithValue("@name", name);
cmd.ExecuteNonQuery();
con.Close();
bind();
}
开发者ID:ratnasreepenjarla,项目名称:.Net-Programs,代码行数:27,代码来源:Gridviewediting.aspx.cs
示例5: GridView1_RowUpdating
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int gvr = e.RowIndex;
string name = ((TextBox)GridView1.Rows[gvr].FindControl("txtName")).Text;
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
HiddenField lblid = (HiddenField)row.FindControl("lblId");
int id = Convert.ToInt32(lblid.Value);
District fd = new District();
fd.Id = id;
fd.DistrictName = name;
try
{
dMethods.Update(fd);
GridView1.EditIndex = -1;
BindGrid();
js.ShowAlert(this, "Record updated succesfully!");
}
catch (Exception ex)
{
if (ex.InnerException.InnerException.Message.Contains("UNIQUE"))
{
js.ShowAlert(this, "District already exists! Please try another name.");
}
else
{
js.ShowAlert(this, ex.Message);
}
}
}
开发者ID:saif859,项目名称:MAPS,代码行数:33,代码来源:DistrictMaster.aspx.cs
示例6: gridTrees_RowUpdating
protected void gridTrees_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
DropDownList ddlTreeType = gridTrees.Rows[e.RowIndex].FindControl("ddlTreeTypes") as DropDownList;
if (ddlTreeType == null)
return;
int treeType;
if (!int.TryParse(ddlTreeType.SelectedValue, out treeType))
return;
string idStr = gridTrees.Rows[e.RowIndex].Cells[1].Text;
int id;
if (!int.TryParse(idStr, out id))
return;
TextBox txtDescription = gridTrees.Rows[e.RowIndex].FindControl("txtDescription") as TextBox;
if (txtDescription == null)
return;
string description = txtDescription.Text;
Tree tree = new Tree()
{
ID = id,
TreeType = treeType,
Description = description,
};
bl.UpdateTree("School101", "School101", tree);
gridTrees.EditIndex = -1;
ReloadTreesGrid();
}
开发者ID:rumeng,项目名称:MissionChestnutServer,代码行数:31,代码来源:List.aspx.cs
示例7: gvProveedores_RowUpdating
protected void gvProveedores_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
var i = e.RowIndex;
var cod = this.gvProveedores.Rows[i].Cells[0].Text;
var raz = ( (TextBox)(this.gvProveedores.Rows[i].Cells[1].Controls[0])).Text;
var dir = ( (TextBox)(this.gvProveedores.Rows[i].Cells[2].Controls[0])).Text;
var tel = ( (TextBox)(this.gvProveedores.Rows[i].Cells[3].Controls[0])).Text;
var dis = ( (TextBox)(this.gvProveedores.Rows[i].Cells[4].Controls[0])).Text;
var rep = ( (TextBox)(this.gvProveedores.Rows[i].Cells[5].Controls[0])).Text;
objProBE .Codigo = cod;
objProBE .Razon = raz;
objProBE .Direccion = dir;
objProBE .Telefono = tel;
objProBE .Distrito = dis;
objProBE .Representante = rep;
Response.Write(objProBL.ActualizarProveedor(objProBE));
gvProveedores.EditIndex = -1;
gvProveedores .DataSource = objProBL.getProveedores();
gvProveedores.DataBind();
}
开发者ID:LuisPolo,项目名称:tp3_upc_etna,代码行数:25,代码来源:PageActualizarProveedor.aspx.cs
示例8: GridViewMessages_RowUpdating
protected void GridViewMessages_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
using (var context = new ApplicationDbContext())
{
string contents = (this.GridViewMessages.Rows[e.RowIndex].FindControl("TextBoxContents") as TextBox).Text;
if (string.IsNullOrWhiteSpace(contents))
{
LabelErrorMessage.Text = "Contents cannot be empty";
e.Cancel = true;
return;
}
int messageId = Convert.ToInt32(this.GridViewMessages.DataKeys[e.RowIndex].Value);
var message = context.Messages.FirstOrDefault(m => m.Id == messageId);
if (message == null)
{
LabelErrorMessage.Text = "No message selected.";
e.Cancel = true;
return;
}
message.Contents = contents;
context.Entry<Message>(message).State = EntityState.Modified;
context.SaveChanges();
DataBind();
Response.Redirect(Request.RawUrl);
e.Cancel = true;
}
}
开发者ID:nikolaynikolov,项目名称:Telerik,代码行数:32,代码来源:ModeratorDefault.aspx.cs
示例9: gvSchedule_RowUpdating
protected void gvSchedule_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
var tbScheduleType = gvSchedule.Rows[gvSchedule.EditIndex].Cells[1].Controls[0] as TextBox;
var tbDailyTime = gvSchedule.Rows[gvSchedule.EditIndex].Cells[3].Controls[0] as TextBox;
var tbMinutes = gvSchedule.Rows[gvSchedule.EditIndex].Cells[4].Controls[0] as TextBox;
var tbIsSystem = gvSchedule.Rows[gvSchedule.EditIndex].Cells[6].Controls[0] as TextBox;
var tbIsActive = gvSchedule.Rows[gvSchedule.EditIndex].Cells[7].Controls[0] as TextBox;
if (tbScheduleType != null && tbDailyTime != null && tbMinutes != null
&& tbIsSystem != null && tbIsActive != null)
{
try
{
var s = Schedule.Single(gvSchedule.DataKeys[gvSchedule.EditIndex].Value.ToString());
s.ScheduleType = tbScheduleType.Text.Trim();
s.DailyTime = Convert.ToInt32(tbDailyTime.Text.Trim());
s.Minutes = Convert.ToInt32(tbMinutes.Text.Trim());
s.IsSystem = Convert.ToBoolean(tbIsSystem.Text.Trim());
s.IsActive = Convert.ToBoolean(tbIsActive.Text.Trim());
s.Update();
}
catch (Exception ex)
{
ClientScript.RegisterClientScriptBlock(typeof (string), "failed",
$"alert('{ex.Message}');", true);
}
}
gvSchedule.EditIndex = -1;
BindData();
}
开发者ID:CyranoChen,项目名称:Arsenalcn,代码行数:34,代码来源:AdminSchedule.aspx.cs
示例10: gvData_RowUpdating
protected void gvData_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try {
TextBox txtOldnoQty = (TextBox)gvData.Rows[e.RowIndex].FindControl("txtOldNoQty");
TextBox txtNewnoQty = (TextBox)gvData.Rows[e.RowIndex].FindControl("txtNewNoQty");
int rtn = 0;
if (txtNewnoQty.Text != "" && txtOldnoQty.Text != "")
{
//int.Parse(Request["id"])
rtn = PH_RateCalc.PH_RateCaclAdj_TransportInsert(AppCode.strConnDB, gvData.DataKeys[e.RowIndex].Value.ToString(), int.Parse(Request["id"]), int.Parse(txtOldnoQty.Text));
if (rtn > 0) rtn = PH_RateCalc.PH_RateCaclAdj_TransportInsert(AppCode.strConnDB, gvData.DataKeys[e.RowIndex].Value.ToString(), int.Parse(Request["id"]), int.Parse(txtNewnoQty.Text));
}
string message = rtn > 0 ? "Save Data Successfull" : "Save Data Not Successfull";
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alertmsg", "alert('" + message + "');", true);
gvData.EditIndex = -1;
DataBindTrans(true);
}
catch(Exception ex)
{
lblErr.Text = ex.Message;
PH_ExceptionManager.WriteError(ex.Message);
}
}
开发者ID:parnupongk,项目名称:primary,代码行数:25,代码来源:rate_calc_adj.aspx.cs
示例11: GridViewProsjektAnsvarligInsert_RowUpdating
protected void GridViewProsjektAnsvarligInsert_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = GridViewProsjektAnsvarligInsert.Rows[e.RowIndex];
try
{
string surname = e.NewValues["surname"].ToString();
string firstname = e.NewValues["firstname"].ToString();
string username = e.NewValues["username"].ToString();
string password = e.NewValues["password"].ToString();
string phone = e.NewValues["phone"].ToString();
string mail = e.NewValues["mail"].ToString();
DropDownList team = (DropDownList)row.FindControl("dropDownTeam");
DropDownList userType = (DropDownList)row.FindControl("dropDownBruker");
int teamID = Convert.ToInt32(team.SelectedValue);
int userTypeID = Convert.ToInt32(userType.SelectedValue);
string query = String.Format("INSERT INTO User (surname, firstname, password, username, phone, mail, teamID, groupID, aktiv) VALUES('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', {7}, {8})",
surname, firstname, password, username, phone, mail, teamID, userTypeID, "1");
db.InsertDeleteUpdate(query);
GridViewProsjektAnsvarligInsert.EditIndex = -1;
GridViewInsertEmpty();
beskjed.Text = "Ny brukeren er lagt til";
}
catch (Exception exception)
{
string error = exception.Message;
beskjed.Text = "Det oppsto en feil: " + error;
}
}
开发者ID:RosaRom,项目名称:systemutvikling,代码行数:34,代码来源:ProsjektAnsvarligNyBruker.aspx.cs
示例12: gridProduto_RowUpdating
protected void gridProduto_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
int index = gridProduto.EditIndex;
GridViewRow row = gridProduto.Rows[index];
Produto p = new Produto();
p.IdProduto = Convert.ToInt32(gridProduto.DataKeys[e.RowIndex].Value.ToString());
p.Nome = Convert.ToString(((TextBox)(row.Cells[2].Controls[0])).Text);
p.Preco = Convert.ToDecimal(((TextBox)(row.Cells[3].Controls[0])).Text);
p.Quantidade = Convert.ToInt32(((TextBox)(row.Cells[4].Controls[0])).Text);
p.Descricao = Convert.ToString(((TextBox)(row.Cells[5].Controls[0])).Text);
ProdutoDal d = new ProdutoDal();
d.Update(p);
lblMensagem.Text = "Produto Atualizado.";
gridProduto.EditIndex = -1;
gridBind();
}
catch (Exception ex)
{
lblMensagem.Text = "Erro ao atualizar Produto" + ex.Message;
}
}
开发者ID:taysontey,项目名称:CSharp.NET-Project-01,代码行数:30,代码来源:ListarProdutos.aspx.cs
示例13: complainGridView_RowUpdating
protected void complainGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int r = e.RowIndex;
Label t1 = (Label)complainGridView.Rows[r].FindControl("Label1");
TextBox t2 = (TextBox)complainGridView.Rows[r].FindControl("pNameTextBox");
TextBox t3 = (TextBox)complainGridView.Rows[r].FindControl("hostelTextBox");
TextBox t4 = (TextBox)complainGridView.Rows[r].FindControl("roomTextBox");
TextBox t5 = (TextBox)complainGridView.Rows[r].FindControl("categoryTextBox");
TextBox t6 = (TextBox)complainGridView.Rows[r].FindControl("summaryTextBox");
TextBox t7 = (TextBox)complainGridView.Rows[r].FindControl("priorityTextBox");
TextBox t8 = (TextBox)complainGridView.Rows[r].FindControl("contactTextBox");
bool flag = aManager.Update(t1.Text, t2.Text, int.Parse(t3.Text), int.Parse(t4.Text), t5.Text, t6.Text, t7.Text, t8.Text);
if (flag == true)
{
msgLabel.Text = "Update Successfully";
complainGridView.DataSource = aManager.ShowAllComplain();
complainGridView.EditIndex = -1;
complainGridView.DataBind();
}
else
{
msgLabel.Text = "Not Updated, Sorry!!!!!";
}
}
开发者ID:nmizan,项目名称:ComplainRegistrationSystem,代码行数:26,代码来源:ComplainFrm.aspx.cs
示例14: GridView1_RowUpdating
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string s = GridView1.DataKeys[e.RowIndex].Value.ToString();
TextBox name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtName");
TextBox year = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtLaunchYear");
if (name.Text.Trim() == "" || year.Text.Trim() == "")
{
Label16.Text = "Insert data on the textbox.";
Label16.Visible = true;
}
else
{
Label16.Visible = false;
int q = Active_Record.Music.UpdateMusicInfo(Convert.ToInt32(s), name.Text, year.Text);
if (q == -1)
{
Label6.Text = "Error while updating music information. Try again later.";
Label6.Visible = true;
}
else if (q == -99)
{
Label15.Text = "An error occurred while loading the page. Try again later.";
Label15.Visible = true;
}
else
{
GridView1.EditIndex = -1;
BindGridData();
}
}
}
开发者ID:MarioQueiros,项目名称:radiodei-arquitectura-de-sistemas-arqsi,代码行数:33,代码来源:EditMusic.aspx.cs
示例15: GridView1_RowUpdating
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
ControladorTecnico control = new ControladorTecnico();
GridViewRow fila = GridView1.Rows[e.RowIndex];
int id_orden = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0]);
string RutTec = (fila.FindControl("Label2") as Label).Text;
int ID_recep = Convert.ToInt32((fila.FindControl("Label3") as Label).Text);
string estado = (fila.FindControl("txtEstado") as TextBox).Text;
string observa = (fila.FindControl("txtObservacion") as TextBox).Text;
int precio = Convert.ToInt32((fila.FindControl("txtPrecio") as TextBox).Text);
string estadopago = (fila.FindControl("txtEstadoPago") as TextBox).Text;
int tipo = Convert.ToInt32((fila.FindControl("Label4") as Label).Text);
Orden_Trabajo orden = new Orden_Trabajo
{
ID_Orden = id_orden,
RUT_Usuario = RutTec,
ID_Recepcion = ID_recep,
Estado= estado,
Observacion=observa,
Precio=precio,
Estado_pago=estadopago,
ID_TipoPago = tipo
};
control.EditarOrden(orden);
GridView1.EditIndex = -1;
cargarBOX();
}
开发者ID:yeisonopazo,项目名称:ProyectoCER,代码行数:31,代码来源:Tecnico.aspx.cs
示例16: GridView1_RowUpdating
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
Label lblID = (Label)row.FindControl("ID");
TextBox factObject = (TextBox)row.FindControl("FactObject");
TextBox worktype = (TextBox)row.FindControl("WorkType");
TextBox costname = (TextBox)row.FindControl("CostName");
TextBox unitname = (TextBox)row.FindControl("UnitName");
TextBox labor = (TextBox)row.FindControl("Labor");
TextBox materials = (TextBox)row.FindControl("Materials");
TextBox mechanisms = (TextBox)row.FindControl("Mechanisms");
int factId = int.Parse(lblID.Text);
GridView1.EditIndex = -1;
conn.Open();
SqlCommand cmd = new SqlCommand("update Fact set FactObject='" + factObject.Text
+ "', WorkType='" + worktype.Text
+ "', CostName='" + costname.Text
+ "', UnitName='" + unitname.Text
+ "', Labor='" + labor.Text
+ "', Materials='" + materials.Text
+ "', Mechanisms='" + mechanisms.Text
+ "', FactID=" + planID
+ ", Status=" + 1
+ " where ID=" + factId, conn);
cmd.ExecuteNonQuery();
conn.Close();
gvbind();
//GridView1.DataBind();
}
开发者ID:hjujgfg,项目名称:TechUp,代码行数:31,代码来源:NewPlan.aspx.cs
示例17: grDS_RowUpdating
protected void grDS_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = grDS.Rows[e.RowIndex];
TextBox txtmahoa = row.Cells[1].Controls[0] as TextBox;
TextBox txttendonvi = row.Cells[2].Controls[0] as TextBox;
TextBox txtdiachi = row.Cells[3].Controls[0] as TextBox;
TextBox txtmst = row.Cells[4].Controls[0] as TextBox;
int id=Int32.Parse(grDS.DataKeys[e.RowIndex].Value.ToString());
DonViDTO dv = new DonViDTO();
dv.Id_DonVi = id;
dv.TenDonVi = txttendonvi.Text;
dv.DiaChi = txtdiachi.Text;
dv.MaHoa = txtmahoa.Text;
dv.MaSoThue = txtmst.Text;
DonViBHDAO dvdao = new DonViBHDAO();
bool up=dvdao.DonViUpdate(dv);
if (up == true)
{
e.Cancel = true;
grDS.EditIndex = -1;
int ma = int.Parse(drNBH.SelectedItem.Value.ToString());
loadDS(ma);
}
else
Response.Write("");
}
开发者ID:baotiit,项目名称:savvyplatform,代码行数:26,代码来源:QuanLyDonViBaoHiem.aspx.cs
示例18: RetrievalFormGridView_RowEditing_RowUpdating
protected void RetrievalFormGridView_RowEditing_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = RetrievalFormGridView.Rows[e.RowIndex];
string itemId = row.Cells[0].Text;
string stock = ((TextBox)row.Cells[4].Controls[1]).Text;
int num;
if (!(int.TryParse(stock, out num)))
{
row.ForeColor = Color.Red;
}
else if (Convert.ToInt32(stock)<0)
{
row.ForeColor = Color.Red;
}
else
{
ClassLibrary.Entities.Item item = new ClassLibrary.Entities.Item();
item.ItemId = itemId;
item.StockBalance = Convert.ToInt32(stock);
generateStationaryRetrievalFormController.updateStock(item);
RetrievalFormGridView.EditIndex = -1;
dataBind();
row.ForeColor = Color.Black;
}
}
开发者ID:tianhang,项目名称:SA39_AD,代码行数:25,代码来源:GenerateStationaryRetrievalForm.aspx.cs
示例19: GridView1_RowUpdating
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
TextBox tb_Name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("tb_Name");
int id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
var updTest = from test in _eJDataContext.Tests.ToList()
where test.Id == id
select test;
foreach (Tests updT in updTest)
{
updT.Name = tb_Name.Text;
}
try
{
_eJDataContext.SubmitChanges();
}
catch
{
_eJDataContext.ChangeConflicts.ResolveAll(RefreshMode.KeepChanges);
{
try
{
_eJDataContext.SubmitChanges();
}
catch (Exception exept)
{
Console.WriteLine("Error: " + exept);
}
}
}
GridView1.EditIndex = -1;
FillCustomerInGrid();
}
开发者ID:BeliaevIlia,项目名称:CompetenceManager,代码行数:35,代码来源:EditTests.aspx.cs
示例20: GridViewempEdit_RowUpdating
protected void GridViewempEdit_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
SqlConnection con = new SqlConnection(connectionstring);
con.Open();
GridViewRow row = (GridViewRow)GridViewempEdit.Rows[e.RowIndex];
Label l1 = (Label)row.FindControl("lbleno");
int eno = Convert.ToInt32(l1.Text);
TextBox txt4 = (TextBox)row.FindControl("txtsal");
int sal =Convert.ToInt32(txt4.Text);
GridViewempEdit.EditIndex = -1;
SqlCommand cmd = new SqlCommand("update Employee set [email protected] where [email protected]", con);
cmd.Parameters.AddWithValue("@sal", sal);
cmd.Parameters.AddWithValue("@eno", eno);
cmd.ExecuteNonQuery();
con.Close();
bind();
lblmsg.Text = "Employe details updated";
}
开发者ID:ananth039,项目名称:Anantha-Kumar-.net-Practice-programs,代码行数:26,代码来源:Edit+operation+grid+view.aspx.cs
注:本文中的System.Web.UI.WebControls.GridViewUpdateEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论