protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { string id = e.Values["RMES_ID"] as string; StationSubEntity entity = StationSubFactory.GetByKey(id); StationSubFactory.Delete(entity); }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strCode = e.Values["STATION_CODE_SUB"].ToString(); StationSubEntity entSub = StationSubFactory.GetByKey(strCode); db.Delete(entSub); setCondition(); e.Cancel = true; }
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { //修改记录 string strCode = e.OldValues["STATION_CODE_SUB"].ToString(); StationSubEntity entSub = StationSubFactory.GetByKey(strCode); entSub.PLINE_CODE = e.NewValues["PLINE_CODE"].ToString(); entSub.STATION_CODE = e.NewValues["STATION_CODE"].ToString(); entSub.STATION_CODE_SUB = e.NewValues["STATION_CODE_SUB"].ToString(); entSub.STATION_NAME_SUB = e.NewValues["STATION_NAME_SUB"].ToString(); db.Update(entSub); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { //插入新纪录,应先做检查是否合法 StationSubEntity entSub = new StationSubEntity(); entSub.COMPANY_CODE = theCompanyCode; entSub.PLINE_CODE = e.NewValues["PLINE_CODE"].ToString(); entSub.STATION_CODE = e.NewValues["STATION_CODE"].ToString(); entSub.STATION_CODE_SUB = e.NewValues["STATION_CODE_SUB"].ToString(); entSub.STATION_NAME_SUB = e.NewValues["STATION_NAME_SUB"].ToString(); db.Insert(entSub); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { if (ASPxGridView1.IsEditing) { string id = e.NewValues["RMES_ID"] as string; string plineCode = e.NewValues["PLINE_CODE"] as string; string station = e.NewValues["STATION_CODE"] as string; string stationSub = e.NewValues["STATION_CODE_SUB"] as string; StationSubEntity entity = StationSubFactory.GetByKey(id); entity.PLINE_CODE = plineCode; entity.STATION_CODE = station; entity.STATION_CODE_SUB = stationSub; StationSubFactory.Update(entity); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); } }
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { if (ASPxGridView1.IsNewRowEditing) { string plineCode = e.NewValues["PLINE_CODE"] as string; string station = e.NewValues["STATION_CODE"] as string; string stationSub = e.NewValues["STATION_CODE_SUB"] as string; StationSubEntity entity = new StationSubEntity { COMPANY_CODE = "01", PLINE_CODE = plineCode, STATION_CODE = station, STATION_CODE_SUB = stationSub }; StationSubFactory.Insert(entity); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); } }
public static void Delete(StationSubEntity entity) { new StationSubDal().Delete(entity); }
public static void Update(StationSubEntity entity) { new StationSubDal().Update(entity); }
public static void Insert(StationSubEntity entity) { new StationSubDal().Insert(entity); }
public void Delete(StationSubEntity entity) { db.Delete(entity); }
public void Update(StationSubEntity entity) { db.Update(entity); }
public void Insert(StationSubEntity entity) { db.Insert(entity); }