internal Current( ISafeService <SignInInfo, SessionInfo> userService, GetTicket getTicket ) : base(userService, getTicket) { }
public object GetTicketList(GetTicket gettkt) { dynamic TBGetTicketResult; dynamic GetTicketResults; List <object> GetTicketResult = new List <object>(); int pagesize = 3, pageno = 1, total; int skippageno = pageno - 1; try { List <GetTicketList> Result = Ticket.getTicket(gettkt); for (int i = 0; i < Result.Count; i++) { GetTicketResult.Add(new { TicketResult = Result[i] }); } if (Result.Count > 0) { var totalPages = 1; if (string.IsNullOrEmpty(gettkt.pageNo)) { total = Result.Count; GetTicketResults = GetTicketResult.ToList(); } else { total = Result.Count; totalPages = (int)Math.Ceiling((double)total / pagesize); GetTicketResults = GetTicketResult.Skip(0).Take(pagesize * Convert.ToInt32(gettkt.pageNo)).ToList(); } TBGetTicketResult = new { status = "0", message = "success", resultCount = total.ToString(), TotalPages = totalPages.ToString(), currentPage = pageno.ToString(), GetTicketResults }; } else { TBGetTicketResult = new { status = "0", message = "Record not found" }; } } catch { TBGetTicketResult = new { status = "1", message = "failed" }; } return(new { TBGetTicketResult }); }
protected void LoadTickets() { // GoDaddy ConnectionString //SqlConnection con = new SqlConnection(@"Data Source=148.72.232.167 ;Database=techelpDB;Integrated Security=False;user ID=Reem; password=Manal1908 ;Connect Timeout=15;Encrypt=False;Packet Size=4096;"); // Local ConnectionString SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\apple\Desktop\TecHelpDB.mdf;Integrated Security=True;Connect Timeout=30"); con.Open(); SqlCommand command = new SqlCommand("SELECT TicketNo, Title, Date,Status, Content from Ticket WHERE EmployeeEmail = '*****@*****.**' ", con); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(command); da.Fill(ds); GetTicket.DataSource = ds; GetTicket.DataBind(); con.Close(); }
public static List <GetTicketList> getTicket(GetTicket tkt) { try { var grpID = new MySqlParameter("?groupId", tkt.groupId); var memberProfileId = new MySqlParameter("?memberProfileId", tkt.memberProfileId); var Result = _DBTouchbase.ExecuteStoreQuery <GetTicketList>("CALL V2_USPGetTicket(?groupId,?memberProfileId)", grpID, memberProfileId).ToList(); return(Result); } catch (Exception ex) { throw ex; } finally { GC.Collect(); } }
public static List <GetTicketList> getTicket(GetTicket tkt) { try { var grpID = new MySqlParameter("?groupId", tkt.groupId); var memberProfileId = new MySqlParameter("?memberProfileId", tkt.memberProfileId); using (TouchBaseWebAPI.Data.row_productionEntities context = new TouchBaseWebAPI.Data.row_productionEntities()) { context.Connection.Open(); var Result = context.ExecuteStoreQuery <GetTicketList>("CALL V2_USPGetTicket(?groupId,?memberProfileId)", grpID, memberProfileId).ToList(); return(Result); } } catch (Exception ex) { throw ex; } finally { GC.Collect(); } }
protected Current(ISafeService <SignInInfo, SessionInfo> userService, GetTicket getTicket) { this.userService = userService; clientGetTicket = getTicket; }