protected override void Saving() { if (IsAdd) { var obj = AttendanceRate.New; BindControlsDecimal.BindControlsToObject(obj, tabPage1); obj.OptrType = UserStatics.OptrType; obj.Save(); } else if (IsAdd == false) { var obj = AttendanceRate.FindById(long.Parse(ItemID)); BindControlsDecimal.BindControlsToObject(obj, tabPage1); obj.Save(); } }
protected override void Loading() { ctDistrict.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "区域"); ctDistrict.DisplayMember = "Name"; ctGroupMonitor.DataSource = BllAttendanceRate.GetGroupMonitorByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctGroupMonitor.DisplayMember = "Name"; if (!IsAdd) { var obj = AttendanceRate.FindById(long.Parse(ItemID)); BindControlsDecimal.BindObjectToControls(obj, tabPage1); ReSetNumbericUpDownStatus(); } else { ctInputDate.Value = UserStatics.GetSqlServerDateTime(); } }