internal SupportTicket(UInt32 Id, int Score, int Type, UInt32 SenderId, UInt32 ReportedId, String Message, UInt32 RoomId, String RoomName, Double Timestamp, object senderName, object reportedName, object modName) { this.Id = Id; this.Score = Score; this.Type = Type; this.Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; this.ModeratorId = 0; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; if (senderName == DBNull.Value) this.SenderName = string.Empty; else this.SenderName = (string)senderName; if (reportedName == DBNull.Value) this.ReportedName = string.Empty; else this.ReportedName = (string)reportedName; if (modName == DBNull.Value) this.ModName = string.Empty; else this.ModName = (string)modName; }
/// <summary> /// create a new assembla ticket /// </summary> /// <param name="summary"></param> /// <param name="desc"></param> /// <param name="pri"></param> /// <param name="stat"></param> public AssemblaTicket(string summary, string desc, Priority pri, TicketStatus stat) { _stat = stat; _pri = pri; _sum = summary; _desc = desc; }
public void Close(TicketStatus NewStatus, bool UpdateInDb) { String dbType = null; Status = NewStatus; if (UpdateInDb) { switch (NewStatus) { case TicketStatus.RESOLVED: dbType = "resolved"; break; case TicketStatus.ABUSIVE: dbType = "abusive"; break; case TicketStatus.INVALID: dbType = "invalid"; break; } using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.ExecuteQuery("UPDATE moderation_tickets SET status = '" + dbType + "' WHERE Id = '" + Id + "' LIMIT 1"); } } }
public SupportTicket(uint Id, int Score, int Type, int CatagoryId, uint SenderId, uint ReportedId, string Message, uint RoomId, string RoomName, double Timestamp, object senderName, object reportedName, object modName) { this.Id = Id; this.Score = Score; this.Type = Type; CategoryId = CatagoryId; Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; ModeratorId = 0; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; if (senderName == DBNull.Value) SenderName = string.Empty; else SenderName = (string)senderName; if (reportedName == DBNull.Value) ReportedName = string.Empty; else ReportedName = (string)reportedName; if (modName == DBNull.Value) ModName = string.Empty; else ModName = (string)modName; }
protected Ticket(IPerformance performance, TicketType type) { this.Performance = performance; this.Price = this.CalculatePrice(); this.status = TicketStatus.Unsold; this.Type = type; }
public TicketItemViewModel(string description, TicketStatus status = TicketStatus.Open, Action<object> removeAction = null) { removeAction = removeAction ?? (x => Console.WriteLine("NoOp.")); Description = description; Status = status; RemoveItem = new ReactiveCommand(); RemoveItem.Subscribe(removeAction); }
public Ticket(long ticketnr, long klantnr, int verwachteReparatieTijd, double verwachteKosten, TicketStatus status, string afdelingsAfkorting, string probleem, string categorieNaam) { this.ticketnr = ticketnr; this.klantnr = klantnr; this.verwachteReparatieTijd = verwachteReparatieTijd; this.verwachteKosten = verwachteKosten; this.status = status; this.afdelingsAfkorting = afdelingsAfkorting; this.probleem = probleem; this.categorieNaam = categorieNaam; }
public void Pick(uint ModeratorId, bool UpdateInDb) { Status = TicketStatus.PICKED; //ModeratorId = ModeratorId; ModName = PhoenixEnvironment.GetGame().GetClientManager().GetNameById(ModeratorId); if (UpdateInDb) { using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.ExecuteQuery("UPDATE moderation_tickets SET status = 'picked', moderator_id = '" + ModeratorId + "' WHERE Id = '" + Id + "' LIMIT 1"); } } }
public static void Main() { var guid = "7ae15a71-6514-4559-8ea6-06b9ddc7a59a"; var ticket = TicketStatus.Identify(guid); if (ticket != null) { Console.WriteLine(ticket.GuidValue + " found"); } else { Console.WriteLine("unknown ticket"); } }
// GET: TicketStatus/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TicketStatus ticketStatus = db.TicketStatuses.Find(id); if (ticketStatus == null) { return(HttpNotFound()); } return(View(ticketStatus)); }
public SupportTicket(uint Id, int Score, int Type, uint SenderId, uint ReportedId, string Message, uint RoomId, string RoomName, Double Timestamp) { this.Id = Id; this.Score = Score; this.Type = Type; this.Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; this.ModeratorId = 0; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; }
public ActionResult Create([Bind(Include = "Id,StatusName,Description")] TicketStatus ticketStatus) { if (ModelState.IsValid) { db.TicketStatus.Add(ticketStatus); if (!roleHelper.IsUserDemo()) { db.SaveChanges(); } return(RedirectToAction("Index")); } return(View(ticketStatus)); }
public void MapEFToBOList() { var mapper = new DALTicketStatusMapper(); TicketStatus entity = new TicketStatus(); entity.SetProperties(1, "A"); List <BOTicketStatus> response = mapper.MapEFToBO(new List <TicketStatus>() { entity }); response.Count.Should().Be(1); }
// GET: TicketStatuses/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(RedirectToAction("Oops5", "Home", null)); } TicketStatus ticketStatus = db.TicketStatuses.Find(id); if (ticketStatus == null) { return(RedirectToAction("Oops5", "Home", null)); } return(View(ticketStatus)); }
public ActionResult Create([Bind(Include = "Id,Name")] TicketStatus ticketStatus) { var nHelper = new UserNotificationsHelper(); ViewBag.Notifications = nHelper.filterNotifications(User.Identity.GetUserId()); if (ModelState.IsValid) { db.TicketStatuses.Add(ticketStatus); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ticketStatus)); }
public ActionResult DeleteConfirmed(int id) { TicketStatus ticketStatus = db.TicketStatuses.Find(id); db.TicketStatuses.Remove(ticketStatus); var userr = User.Identity.GetUserId(); if (!rolesHelper.IsDemoUser(userr)) { db.SaveChanges(); } return(RedirectToAction("Index")); }
public static IEnumerable <SimpleSetting> GetAvailableStatuses(this DbSet <Setting> settings, string language) { var rSet = AppModelText.ResourceManager.GetResourceSet(new CultureInfo(language), true, true); var enumeration = new TicketStatus(); var list = from Enum e in Enum.GetValues(enumeration.GetType()) let ev = Enum.Parse(enumeration.GetType(), Enum.GetName(enumeration.GetType(), e)) select new SimpleSetting( rSet.GetString("TicketStatus" + ev.ToString()), ev.ToString() ); return(list); }
public async Task <TicketStatus> Create(TicketStatus TicketStatus) { if (!await TicketStatusValidator.Create(TicketStatus)) { return(TicketStatus); } try { TicketStatusFilter TicketStatusFilter = new TicketStatusFilter { Take = 1, Selects = TicketStatusSelect.ALL, OrderBy = TicketStatusOrder.OrderNumber, OrderType = OrderType.DESC }; await UOW.Begin(); if (TicketStatus.OrderNumber == 0) { List <TicketStatus> TicketStatuss = await UOW.TicketStatusRepository.List(TicketStatusFilter); TicketStatus.OrderNumber = TicketStatuss.Any() ? TicketStatuss.Max(c => c.OrderNumber) + 1 : 1; } await UOW.TicketStatusRepository.Create(TicketStatus); await UOW.Commit(); TicketStatus = await UOW.TicketStatusRepository.Get(TicketStatus.Id); await Logging.CreateAuditLog(TicketStatus, new { }, nameof(TicketStatusService)); return(TicketStatus); } catch (Exception ex) { if (ex.InnerException == null) { await Logging.CreateSystemLog(ex, nameof(TicketStatusService)); throw new MessageException(ex); } else { await Logging.CreateSystemLog(ex.InnerException, nameof(TicketStatusService)); throw new MessageException(ex.InnerException); } } }
private ActivityAndStatusDto PrepareActivityAndStatusDto(TicketStatus ticketStatusToReturn, TicketActivityLog ticketActivityLog) { var ticketStatusToReturnDto = _mapper.Map <TicketStatusDto>(ticketStatusToReturn); var ticketActivityLogToReturnDto = _mapper.Map <TicketActivityLogDto>(ticketActivityLog); var activityAndStatusDto = new ActivityAndStatusDto { TicketStatusDto = ticketStatusToReturnDto, TicketActivityLogDto = ticketActivityLogToReturnDto }; return(activityAndStatusDto); }
// GET: TicketStatus/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TicketStatus ticketStatus = TicketStatusHelper.GetTicketStatus(id); if (ticketStatus == null) { return(HttpNotFound()); } return(View(ticketStatus)); }
public List <Ticket> GetSolverTTByType(User solver, TicketStatus status) { List <Ticket> tickets = new List <Ticket>(); using (SqlConnection c = new SqlConnection(ConfigurationManager.ConnectionStrings["TTdatabase"].ConnectionString)) { try { c.Open(); string sql = "SELECT * FROM Ticket WHERE idSolver =" + solver.ID + " AND status = "; if (status == TicketStatus.ASSIGNED) { sql += "'assigned'"; } else if (status == TicketStatus.CLOSED) { sql += "'closed'"; } SqlCommand cmd = new SqlCommand(sql, c); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Ticket ticket = new Ticket(); ticket.ID = reader.GetInt32(0); ticket.Date = reader.GetDateTime(5); ticket.Description = reader.GetString(4); ticket.Title = reader.GetString(3); ticket.Author = solver; ticket.Status = status; tickets.Add(ticket); } reader.Close(); } catch (SqlException) { } finally { c.Close(); } return(tickets); } }
/// <summary> /// 计算普通订单当前进度所在, 0:刚发起 1:投注中 2:已出票 3:已开奖 4:已派奖 /// </summary> /// <param name="status">方案状态</param> /// <param name="ticketstatus">出票状态</param> /// <param name="bonusstatus">中奖状态</param> /// <returns>所在位置</returns> public static int Progress_StatusIndex(ProgressStatus status, TicketStatus ticketstatus, BonusStatus bonusstatus, bool isPrizeMoney = false) { var at = 0; try { switch (status) { case ProgressStatus.Aborted: at = 0; break; case ProgressStatus.AutoStop: at = 0; break; case ProgressStatus.Waitting: at = 1; break; case ProgressStatus.Complate: case ProgressStatus.Running: switch (ticketstatus) { case TicketStatus.Skipped: case TicketStatus.Error: case TicketStatus.Abort: at = 0; break; case TicketStatus.Ticketing: case TicketStatus.Waitting: at = 1; break; case TicketStatus.Ticketed: if (status == ProgressStatus.Complate && (bonusstatus == BonusStatus.Win || bonusstatus == BonusStatus.Lose)) { at = 3; if (bonusstatus == BonusStatus.Win && isPrizeMoney) { at = 4; } } else { at = 2; } break; } break; } } catch { } return(at); }
/// <summary> /// 更改团购单状态 /// 并且初始化团购单商品在库存中已经用掉的库存 /// 所以团购单的团购销量等于团购开始活动中的已用库存量减去 /// 团购开始时库存表中的已用库存量 /// </summary> /// <param name="gid"></param> /// <param name="status"></param> /// <param name="productSysNo"></param> /// <returns></returns> public static bool UpdateTicketStatus(string gid, int status, int productSysNo) { bool result = false; TicketStatus statusTag = (TicketStatus)status; switch (statusTag) { case TicketStatus.Approved: { result = UpdateTicketInitialAllocatedQtyAndStatus(gid, status, productSysNo); break; } case TicketStatus.NeedMorePurchaser: { result = UpdateTicketStatus(gid, status); break; } case TicketStatus.Overdue: { result = UpdateTicketStatus(gid, status); break; } case TicketStatus.UnReviewed: { result = UpdateTicketStatus(gid, status); break; } case TicketStatus.Rejected: { result = UpdateTicketStatus(gid, status); break; } case TicketStatus.All: { break; } default: { break; } } return(result); }
public override bool CanChangeTo(TicketStatus toStatus) { switch (toStatus) { case TicketStatus.New: return false; case TicketStatus.Accepted: return true; case TicketStatus.Rejected: return false; case TicketStatus.Closed: return false; default: return false; } }
/// <summary> /// The Update /// </summary> /// <param name="id">The ticket id</param> /// <param name="status">The status<see cref="TicketStatus"/></param> /// <returns>The <see cref="Ticket"/></returns> public async Task <Ticket> Update(string id, TicketStatus status) { var ticket = await Get(id); if (ticket == null) { return(null); } ticket.UpdateStatus(status); ticket = await _ticketRepository.Update(ticket); return(ticket); }
public bool UpdateStatus(Ticket ticket, TicketStatus status) { if (ticket == null) { return(false); } else { ticket.Status = status; db.Entry(ticket).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(true); } }
protected string GetTotal(TicketStatus status, int id = 0) { try { var client = Connector.GetHttpClient(); HttpResponseMessage result = client.GetAsync($"Dashboard/CountTicketsByStatus?status={status}&id={id}").Result; var content = result.Content.ReadAsStringAsync().Result; return(content); } catch (Exception ex) { GlobalVariable.log.Write(LogLevel.Error, ex); return(null); } }
public AssemblaTicket(AssemblaTicket copy) { _ticknum = copy._ticknum; _un = copy._un; _updated = copy._updated; _tickdocid = copy._tickdocid; _sum = copy._sum; _stat = copy._stat; _space = copy._space; _reporter = copy._reporter; _pw = copy._pw; _milestone = copy._milestone; _desc = copy._desc; _assign = copy._assign; }
public void GetTicketType() { TicketStatusCollection ticketStatuses = TestSetup.KayakoApiService.Tickets.GetTicketStatuses(); Assert.IsNotNull(ticketStatuses, "No ticket statuses were returned"); Assert.IsNotEmpty(ticketStatuses, "No ticket statuses were returned"); TicketStatus randomTicketStatusToGet = ticketStatuses[new Random().Next(ticketStatuses.Count)]; Trace.WriteLine("GetTicketType using ticket status id: " + randomTicketStatusToGet.Id); TicketStatus ticketType = TestSetup.KayakoApiService.Tickets.GetTicketStatus(randomTicketStatusToGet.Id); CompareTicketTypes(ticketType, randomTicketStatusToGet); }
public ActionResult Edit([Bind(Include = "Id,StatusName,Description")] TicketStatus ticketStatus) { if (ModelState.IsValid) { db.Entry(ticketStatus).State = EntityState.Modified; var userr = User.Identity.GetUserId(); if (!rolesHelper.IsDemoUser(userr)) { db.SaveChanges(); } return(RedirectToAction("Index")); } return(View(ticketStatus)); }
public void Delete(TicketStatus status) { using (var context = new PunchClockDbContext()) { var ticketStatus = context.TicketStatuses.FirstOrDefault(x => x.Id == status.Id); if (ticketStatus == null) { return; } ticketStatus.ModifiedById = status.ModifiedById; ticketStatus.ModifiedDateUtc = DateTime.UtcNow; ticketStatus.IsDeleted = true; context.SaveChanges(); } }
/// <summary> /// Build the insert query for the ticket mapping table /// </summary> private string BuildInsertTicketTableQuery(int ticketID, int memberID, TicketStatus ticketStatus) { string tableName = GetTicketTableName(ticketStatus); string query = "INSERT INTO " + tableName + "("; switch (ticketStatus) { case TicketStatus.FREE: query += "TICKET_ID"; break; case TicketStatus.HELD: query += "TICKET_ID,MEMBER_ID"; break; case TicketStatus.PURCHASED: query += "TICKET_ID,MEMBER_ID"; break; default: break; } query += ") VALUES("; switch (ticketStatus) { case TicketStatus.FREE: query += ticketID; break; case TicketStatus.HELD: query += ticketID + "," + memberID; break; case TicketStatus.PURCHASED: query += ticketID + "," + memberID; break; default: break; } query += ")"; return(query); }
public ActionResult Edit(TicketStatus category) { if (ModelState.IsValid) { TicketStatus stats = _ticketStatusDao.GetById(category.Id); stats.Title = category.Title; stats.Description = category.Description; _ticketStatusDao.Update(stats); return(RedirectToAction("Index", "TicketStatus")); } ViewBag.statuses = _statuses; return(View("Index")); }
private bool CheckExist(TicketStatus status) { if (status == TicketStatus.UNASSIGNED) { if (client.Proxy.GetUnassignedTT().Length > 0) { return(true); } } else if (client.Proxy.GetSolverTTByType(this.user, status).Length > 0) { return(true); } return(false); }
public void SortOnTooLargeRequestedOrder() { TicketStatusCollection tempCol = HelpdeskService.GetAllStatus(); int TooLargeStatusOrder = tempCol.Count + 15; int ExpectedStatusOrder = tempCol.Count + 1; TicketStatus temp = NewStatus(); temp.StatusOrder = TooLargeStatusOrder; HelpdeskService.CreateStatus(temp); Trace.WriteLine(temp.StatusOrder); Assert.IsTrue(ExpectedStatusOrder == temp.StatusOrder); }
public virtual async Task <CreateResponse <ApiTicketStatusServerResponseModel> > Create( ApiTicketStatusServerRequestModel model) { CreateResponse <ApiTicketStatusServerResponseModel> response = ValidationResponseFactory <ApiTicketStatusServerResponseModel> .CreateResponse(await this.TicketStatusModelValidator.ValidateCreateAsync(model)); if (response.Success) { TicketStatus record = this.DalTicketStatusMapper.MapModelToEntity(default(int), model); record = await this.TicketStatusRepository.Create(record); response.SetRecord(this.DalTicketStatusMapper.MapEntityToModel(record)); await this.mediator.Publish(new TicketStatusCreatedNotification(response.Record)); } return(response); }
public async Task <ActionResult <TicketStatus_TicketStatusDTO> > Get([FromBody] TicketStatus_TicketStatusDTO TicketStatus_TicketStatusDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } if (!await HasPermission(TicketStatus_TicketStatusDTO.Id)) { return(Forbid()); } TicketStatus TicketStatus = await TicketStatusService.Get(TicketStatus_TicketStatusDTO.Id); return(new TicketStatus_TicketStatusDTO(TicketStatus)); }
/// <summary> /// Picks the specified p moderator identifier. /// </summary> /// <param name="pModeratorId">The p moderator identifier.</param> /// <param name="updateInDb">if set to <c>true</c> [update in database].</param> internal void Pick(uint pModeratorId, bool updateInDb) { Status = TicketStatus.Picked; ModeratorId = pModeratorId; _modName = Yupi.GetHabboById(pModeratorId).UserName; if (!updateInDb) { return; } using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor()) queryReactor.RunFastQuery( string.Concat("UPDATE moderation_tickets SET status = 'picked', moderator_id = ", pModeratorId, ", timestamp = '", Yupi.GetUnixTimeStamp(), "' WHERE id = ", TicketId)); }
public TicketReport_TicketStatusDTO(TicketStatus TicketStatus) { this.Id = TicketStatus.Id; this.Name = TicketStatus.Name; this.OrderNumber = TicketStatus.OrderNumber; this.ColorCode = TicketStatus.ColorCode; this.StatusId = TicketStatus.StatusId; this.Used = TicketStatus.Used; this.Errors = TicketStatus.Errors; }
public SupportTicket(int Id, int Score, int Type, int SenderId, int ReportedId, string Message, int RoomId, string RoomName, double Timestamp) { this.Id = Id; this.Score = Score; this.Type = Type; this.Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; this.ModeratorId = 0; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; this.SenderName = ButterflyEnvironment.GetGame().GetClientManager().GetNameById(SenderId); this.ReportedName = ButterflyEnvironment.GetGame().GetClientManager().GetNameById(ReportedId); this.ModName = ButterflyEnvironment.GetGame().GetClientManager().GetNameById(this.ModeratorId); }
internal SupportTicket(UInt32 Id, int Score, int Type, UInt32 SenderId, UInt32 ReportedId, String Message, UInt32 RoomId, String RoomName, Double Timestamp) { this.Id = Id; this.Score = Score; this.Type = Type; this.Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; this.ModeratorId = 0; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; this.SenderName = SilverwaveEnvironment.GetGame().GetClientManager().GetNameById(SenderId); this.ReportedName = SilverwaveEnvironment.GetGame().GetClientManager().GetNameById(ReportedId); this.ModName = SilverwaveEnvironment.GetGame().GetClientManager().GetNameById(ModeratorId); }
public SupportTicket(uint mId, int mScore, int mType, uint mSenderId, uint mReportedId, string mMessage, uint mRoomId, string mRoomName, double mTimestamp, uint mModeratorId) { this.Id = mId; this.Score = mScore; this.Type = mType; this.Status = TicketStatus.OPEN; this.SenderId = mSenderId; this.ReportedId = mReportedId; this.ModeratorId = mModeratorId; this.Message = mMessage; this.RoomId = mRoomId; this.RoomName = mRoomName; this.Timestamp = mTimestamp; this.string_2 = GoldTree.GetGame().GetClientManager().GetNameById(mSenderId); this.string_3 = GoldTree.GetGame().GetClientManager().GetNameById(mReportedId); this.string_4 = GoldTree.GetGame().GetClientManager().GetNameById(mModeratorId); }
public SupportTicket(uint mId, int mScore, int mType, uint mSenderId, uint mReportedId, string mMessage, uint mRoomId, string mRoomName, double mTimestamp, uint mModeratorId) { Id = mId; Score = mScore; Type = mType; Status = TicketStatus.OPEN; SenderId = mSenderId; ReportedId = mReportedId; ModeratorId = mModeratorId; Message = mMessage; RoomId = mRoomId; RoomName = mRoomName; Timestamp = mTimestamp; SenderName = PhoenixEnvironment.GetGame().GetClientManager().GetNameById(mSenderId); ReportedName = PhoenixEnvironment.GetGame().GetClientManager().GetNameById(mReportedId); ModName = PhoenixEnvironment.GetGame().GetClientManager().GetNameById(mModeratorId); }
public SupportTicket(uint mId, int mScore, int mType, uint mSenderId, uint mReportedId, string mMessage, uint mRoomId, string mRoomName, double mTimestamp, uint mModeratorId) { this.Id = mId; this.Score = mScore; this.Type = mType; this.Status = TicketStatus.OPEN; this.SenderId = mSenderId; this.ReportedId = mReportedId; this.ModeratorId = mModeratorId; this.Message = mMessage; this.RoomId = mRoomId; this.RoomName = mRoomName; this.Timestamp = mTimestamp; this.string_2 = GoldTree.GetGame().GetClientManager().GetNameById(mSenderId); this.string_3 = GoldTree.GetGame().GetClientManager().GetNameById(mReportedId); this.string_4 = GoldTree.GetGame().GetClientManager().GetNameById(mModeratorId); }
internal SupportTicket(uint Id, int Score, int Type, uint SenderId, uint ReportedId, string Message, uint RoomId, string RoomName, double Timestamp, List<string> ReportedChats) { this.Id = Id; this.Score = Score; this.Type = Type; this.Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; this.ModeratorId = 0u; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; this.SenderName = CyberEnvironment.GetGame().GetClientManager().GetNameById(SenderId); this.ReportedName = CyberEnvironment.GetGame().GetClientManager().GetNameById(ReportedId); this.ModName = CyberEnvironment.GetGame().GetClientManager().GetNameById(this.ModeratorId); this.ReportedChats = ReportedChats; }
public static int Create(string space, string user, string password, string summary, string description, TicketStatus status, Priority priority) { int stat = (int)status; int pri = (int)priority; string url = GetTicketUrl(space); StringBuilder data = new StringBuilder(); data.AppendLine("<ticket>"); data.AppendLine("<status>" + stat.ToString() + "</status>"); data.AppendLine("<priority>" + pri.ToString() + "</priority>"); data.AppendLine("<summary>"); data.AppendLine(System.Web.HttpUtility.HtmlEncode(summary)); data.AppendLine("</summary>"); data.AppendLine("<description>"); data.AppendLine(System.Web.HttpUtility.HtmlEncode(description)); data.AppendLine("</description>"); data.AppendLine("</ticket>"); // prepare id int id = 0; string rs = string.Empty; try { qc.gopost(url,user,password, data.ToString(),SendDebug, out rs); XmlDocument xd = new XmlDocument(); xd.LoadXml(rs); XmlNodeList xnl = xd.GetElementsByTagName("id"); string val = xnl[0].InnerText; if ((val != null) && (val != string.Empty)) id = Convert.ToInt32(val); // display it if (SendDebug != null) SendDebug(rs); } catch (Exception ex) { if (SendDebug != null) SendDebug("error on data: "+rs+" err: " + ex.Message + ex.StackTrace); return 0; } return id; }
public SupportTicket(uint Id, int Score, int Type, int CategoryId, uint SenderId, uint ReportedId, string Message, uint RoomId, string RoomName, double Timestamp) { this.Id = Id; this.Score = Score; this.Type = Type; this.CategoryId = CategoryId; Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; ModeratorId = 0; this.Message = ButterflyEnvironment.FilterInjectionChars(Message); this.RoomId = RoomId; this.RoomName = ButterflyEnvironment.FilterInjectionChars(RoomName); this.Timestamp = Timestamp; SenderName = ButterflyEnvironment.GetGame().GetClientManager().GetNameById(SenderId); ReportedName = ButterflyEnvironment.GetGame().GetClientManager().GetNameById(ReportedId); ModName = ButterflyEnvironment.GetGame().GetClientManager().GetNameById(ModeratorId); }
public SupportTicket(int Id, int Score, int Type, int Category, int SenderId, int ReportedId, String Message, int RoomId, String RoomName, Double Timestamp, List<string> ReportedChats) { this.Id = Id; this.Score = Score; this.Type = Type; this.Category = Category; this.Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; ModeratorId = 0; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; this.ReportedChats = ReportedChats; SenderName = PlusEnvironment.GetGame().GetClientManager().GetNameById(SenderId); ReportedName = PlusEnvironment.GetGame().GetClientManager().GetNameById(ReportedId); ModName = PlusEnvironment.GetGame().GetClientManager().GetNameById(ModeratorId); }
internal void Pick(uint pModeratorId, bool UpdateInDb) { this.Status = TicketStatus.PICKED; this.ModeratorId = pModeratorId; this.ModName = CyberEnvironment.getHabboForId(pModeratorId).Username; if (UpdateInDb) { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.runFastQuery(string.Concat(new object[] { "UPDATE moderation_tickets SET status = 'picked', moderator_id = ", pModeratorId, ", timestamp = '", CyberEnvironment.GetUnixTimestamp(), "' WHERE id = ", this.Id })); } } }
void Response_SendTicketEvent(string space, string user, string password, string summary, string description, Priority pri, TicketStatus stat) { if (_sendticketwarn) return; debug("Sendticket not supported in gauntlet."); _sendticketwarn = true; }
public void WhenIUpdateTheTicketWithTheSubjectAndDescriptionTWorkInTheseConditions(TicketStatus status) { _savedSingleTicket.Status = status; _client.Tickets.Put(new TicketRequest { Item = _savedSingleTicket }); }
public void ThenIGetATicketFromZendeskWithTheStatus(TicketStatus status) { Assert.That(_singleTicketResponse.Status, Is.EqualTo(status)); }
/// <summary> /// create a new assembla ticket in a given space using a given account /// </summary> /// <param name="space"></param> /// <param name="username"></param> /// <param name="pw"></param> /// <param name="summary"></param> /// <param name="desc"></param> /// <param name="pri"></param> /// <param name="stat"></param> public AssemblaTicket(string space, string username, string pw, string summary, string desc, Priority pri, TicketStatus stat) { _space = space; _un = username; _pw = pw; _stat = stat; _pri = pri; _sum = summary; _desc = desc; }
internal void Pick(UInt32 pModeratorId, Boolean UpdateInDb) { this.Status = TicketStatus.PICKED; this.ModeratorId = pModeratorId; if (UpdateInDb) { using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.runFastQuery("UPDATE moderation_tickets SET status = 'picked', moderator_id = " + pModeratorId + " WHERE id = " + Id + ""); } } }
public Ticket UpdateTicket(string title, string content, int categoryId, TicketPriority priority, TicketStatus status) { this.Title = title; this.Content = content; this.CategoryId = categoryId; this.Priority = priority; this.Status = status; this.LastEdited = DateTime.Now; return this; }
/// <summary> /// send ticket /// </summary> /// <param name="space"></param> /// <param name="user"></param> /// <param name="pw"></param> /// <param name="summary"></param> /// <param name="desc"></param> /// <param name="pri"></param> /// <param name="stat"></param> public virtual void sendticket(string space, string user, string pw, string summary, string desc, Priority pri, TicketStatus stat) { string ticket_json = "{\"todo\": \"collect all fields here if requires.. see GotMessage() for example...\"}"; send_event(MimeType.send_ticket, "ticket", ticket_json); if (SendTicketEvent != null) SendTicketEvent(space, user, pw, summary, desc, pri, stat); }
internal void Release(Boolean UpdateInDb) { this.Status = TicketStatus.OPEN; if (UpdateInDb) { using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.runFastQuery("UPDATE moderation_tickets SET status = 'open' WHERE id = " + Id + ""); } } }
/// <summary> /// Helper method to insert values into the database. If successful, it will set teh appropriate row id. /// </summary> /// <param name="Module"></param> private void InsertStatusIntoDatabase(TicketStatus Status) { HelpdeskService.CreateStatus(Status); }
/// <summary> /// Creates shiny new modules that are not referenced / altered by other methods. /// </summary> /// <returns></returns> private TicketStatus NewStatus() { //Initialize a basic module object. TicketStatus Status = new TicketStatus(); Status.Description = "This is my status descrition"; Status.IsActive = true; Status.Name = "Ticket Status Name"; Status.StatusOrder = 1; return Status; }
public static bool UpdateStatus(string space, string user, string password, int ticket, TicketStatus status) { int stat = (int)status; string xml = "<status>" + stat.ToString() + "</status>"; return Update(space, user, password, ticket, xml); }