public void ShowBattleOver(bool isRanked, int winner, string opponentId, string opponentName = "Opponent", OfficerType officerType = OfficerType.KRUGER, bool isRematch = false, bool enableEmotes = false, bool showBackground = false) { BattleResultsPanel.Show(); BattleResultsPanel.Instance.Setup(isRanked, winner, opponentId, opponentName, officerType, isRematch, enableEmotes, showBackground); }
/// <summary> /// IndEmployeeInfoType class constructor /// </summary> public IndEmployeeInfoType() { this.userAreaField = new UserAreaType(); this.employeeGroupField = new List <EntityIdType>(); this.retirementInfoField = new List <IndRetirementInfoType>(); this.isPercentOwnerField = new PercentOwnerType(); this.isOfficerField = new OfficerType(); this.isExecutiveField = new ExecutiveType(); this.isVIPField = new VIPType(); this.employmentTermField = new EmploymentTermType(); this.contactInfoField = new List <EffectiveDatedContactMethodWithPrecedenceType>(); this.priorIncorrectEmployeeIdField = new List <EntityIdType>(); this.employeeIdField = new List <EntityIdType>(); }
private void OnCellDoubleClick(object sender, RadRoutedEventArgs e) { if (this.NavigationService != null) { if (isOfficerSelected) { StationReportResult obj = this.gv.SelectedItem as StationReportResult; if (obj != null) { OfficerType type = lbType.SelectedItem as OfficerType; string uri = string.Format("/Views/SMSRecordListNew.xaml?OfficerId={0}&Start={1}&End={2}&OfficerTypeId={3}", obj.UnitId, dateStart.SelectedDate, dateEnd.SelectedDate, type == null ? "" : type.Id.ToString()); this.NavigationService.Navigate(new Uri(uri, UriKind.RelativeOrAbsolute)); } } } }
public virtual string GetByHql(string hql) { using (ISession sess = HbmSessionFactory.OpenSession()) { try { OfficerType entity = sess.CreateQuery(hql).UniqueResult <OfficerType>(); string s = JsonSerializerHelper.EntityToJson(entity); return(PackJsonResult("true", s, string.Empty)); } catch (Exception ex) { return(PackJsonResult("true", string.Empty, ex.Message)); } } }
/// <summary> /// 通过id获得一个实体对象 /// </summary> /// <param name="id"></param> /// <returns></returns> public virtual string GetById(int id) { using (ISession sess = HbmSessionFactory.OpenSession()) { try { OfficerType entity = sess.Get <OfficerType>(id); string s = JsonSerializerHelper.EntityToJson(entity); return(PackJsonResult("true", s, string.Empty)); } catch (Exception ex) { return(PackJsonResult("false", string.Empty, ex.Message)); } } }
/// <summary> /// 通过id删除一个实体对象 /// </summary> /// <param name="id"></param> /// <returns></returns> public virtual string DeleteById(int id) { using (ISession sess = HbmSessionFactory.OpenSession()) { ITransaction tx = sess.BeginTransaction(); try { OfficerType entity = sess.Load <OfficerType>(id); sess.Delete(entity); tx.Commit(); return(PackJsonResult("true", "true", string.Empty)); } catch (Exception ex) { tx.Rollback(); return(PackJsonResult("false", "false", ex.Message)); } } }
void gv_SelectionChanged(object sender, SelectionChangeEventArgs e) { if (this.NavigationService != null) { if (isOfficerSelected) { if (e.AddedItems != null && e.AddedItems.Count > 0) { StationReportResult obj = e.AddedItems[0] as StationReportResult; if (obj != null) { OfficerType type = lbType.SelectedItem as OfficerType; string uri = string.Format("/Views/SMSRecordListNew.xaml?OfficerId={0}&Start={1}&End={2}&OfficerTypeId={3}", obj.UnitId, dateStart.SelectedDate, dateEnd.SelectedDate, type == null ? "" : type.Id.ToString()); this.NavigationService.Navigate(new Uri(uri, UriKind.RelativeOrAbsolute)); } } } } }
/// <summary> /// 保存或修改 /// 保存的工作每个业务对象都不相同,有可能重写,请注意! /// </summary> /// <param name="json"></param> /// <returns></returns> public virtual string SaveOrUpdate(string json) { using (ISession sess = HbmSessionFactory.OpenSession()) { ITransaction tx = null; OfficerType entity = JsonSerializerHelper.JsonToEntity <OfficerType>(json); //DunLibrary.User.User u = sess.Get<DunLibrary.User.User>(2); //DunLibrary.Dun.VisitRecord vr = entity as DunLibrary.Dun.VisitRecord; //vr.Visitors.Add(u); try { tx = sess.BeginTransaction(); sess.SaveOrUpdate(entity); tx.Commit(); //有点sb了,凑合补救一下 //正确的做法是定义个包含Id的interface,所有要持久化的类都实现这个interface dynamic d = entity; return(PackJsonResult("true", d.Id.ToString(), string.Empty)); } catch (Exception ex) { if (tx != null && tx.IsActive) { tx.Rollback(); } return(PackJsonResult("false", "0", ex.Message)); } } }