/// <summary> /// 重新计算上级站点数量 /// </summary> /// <param name="obj"></param> private void ReCount(E_LevelStop obj) { string sqlwhere = " where LevelID='" + obj.LevelID + "'"; int recordnum = MainHelper.PlatformSqlMap.GetRowCount<E_LevelStop>(sqlwhere); E_Level el = MainHelper.PlatformSqlMap.GetOneByKey<E_Level>(obj.LevelID); if (el!=null) { el.StopNum = recordnum; MainHelper.PlatformSqlMap.Update<E_Level>(el); } }
/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(E_LevelStop newobj) { newobj.SeasonID = ParentIDA; newobj.LevelID = ParentIDB; }
void gridViewOperation_AfterAdd(E_LevelStop obj) { ReCount(obj); }
private void AddRecord() { string sqlwhere = " where LevelID='" + ParentIDB + "'"; MainHelper.PlatformSqlMap.DeleteByWhere<E_LevelStop>(sqlwhere); for (int i = 0; i < 10; i++) { E_LevelStop tempstop = new E_LevelStop(); tempstop.ID += i; tempstop.SeasonID = ParentIDA; tempstop.LevelID = ParentIDB; tempstop.Name = "站点" + (i + 1); tempstop.Sequence = (i + 1); tempstop.PdNumAndLevel = "1,2;2,2;3,2;4,2;5,2"; tempstop.DxNumAndLevel = "1,2;2,2;3,2;4,2;5,2"; //tempstop.DDxNumAndLevel = "1,2;2,2;3,2;4,2;5,2"; tempstop.QuestionAllNUM = 20; MainHelper.PlatformSqlMap.Create<E_LevelStop>(tempstop); } E_LevelStop tempstop2 = new E_LevelStop(); tempstop2.LevelID = ParentIDB; ReCount(tempstop2); }