public WorkflowState Get() { var rng = new Random(); InFrameContext myContext = new InFrameContext(); WorkflowState bezin = myContext.WorkflowState.FirstOrDefault(); return(bezin); }
public static void AddTicket(Ticket ticket) { using (InFrameContext db = new InFrameContext()) { db.Ticket.Add(ticket); db.SaveChanges(); } }
public static List <Ticket> getTicketList() { List <Ticket> Result; using (InFrameContext db = new InFrameContext()) { Result = db.Ticket.ToList(); } return(Result); }
public static List <string> getDropdownItems(string itemType) { List <string> Result; using (InFrameContext db = new InFrameContext()) { Result = db.Modalist.Where(s => s.ModalistGroup == itemType).Select(x => x.ModalistLabel).ToList(); } return(Result); }
//public static List<string> getFormTypes() //{ // List<string> Result; // using (InFrameContext db = new InFrameContext()) // { // Result = db.TicketFormConfig.Where(s => s.Active).Select(y => y.FormNature).Distinct().ToList();//.Select(x => new SelectListItem { Value = x.FormNature, Text = x.FormNature}); // } // return Result; //} public static List <string> getTicketTypes() { List <string> Result; using (InFrameContext db = new InFrameContext()) { Result = db.Modalist.Where(s => s.ModalistGroup == "TicketType").Select(x => x.ModalistLabel).ToList(); } return(Result); }
public static List <TicketFormConfig> getTicketFormConfigList() { List <TicketFormConfig> Result; using (InFrameContext db = new InFrameContext()) { Result = db.TicketFormConfig.Where(s => s.Active).ToList(); } return(Result); }
public static Ticket getTicket(int id) { Ticket Result; using (InFrameContext db = new InFrameContext()) { Result = db.Ticket.Where(x => x.Id == id).FirstOrDefault(); } return(Result); }
public static List <TicketType> getTicketTypes() { List <TicketType> Result; using (InFrameContext db = new InFrameContext()) { Result = db.TicketType.Where(s => s.Active == 1).ToList(); } return(Result); }
public static Demand getDemandById(long id) { Demand Result; using (InFrameContext db = new InFrameContext()) { Result = db.Demand.Include("DemandDynPropValue").Include("DemandDynPropValue.DynProp").Include("Type").Include("WorkflowState") .Where(d => d.Id == id).FirstOrDefault(); } return(Result); }
public static TicketFormConfig getFormConfigByDemandType(long id) { TicketFormConfig Result; using (InFrameContext db = new InFrameContext()) { Result = db.TicketFormConfig.Include("TicketFormGroup").Include("TicketFormGroup.FormField") .Where(s => s.Active).FirstOrDefault(); } return(Result); }
public static FormConfig GetFormConfigById(long id) { FormConfig Result; using (InFrameContext db = new InFrameContext()) { Result = db.FormConfig.Include("FormGroup").Include("FormGroup.FormField") .Where(s => s.Id == id && s.Active).FirstOrDefault(); } return(Result); }
public static List <string> getFormTypes() { List <string> Result; using (InFrameContext db = new InFrameContext()) { Result = db.TicketFormConfig.Where(s => s.Active).Select(y => y.Title).Distinct().ToList();//.Select(x => new SelectListItem { Value = x.FormNature, Text = x.FormNature}); // Result = db.TicketFormConfig.Select(y => y.Title).Distinct().ToList();//.Select(x => new SelectListItem { Value = x.FormNature, Text = x.FormNature}); } return(Result); }
public static List <Ticket> getTicketList(long typeId = -1) { List <Ticket> Result; using (InFrameContext db = new InFrameContext()) { if (typeId == -1) { Result = db.Ticket.ToList(); } else { Result = db.Ticket.Where(t => t.TypeId == typeId).ToList(); } } return(Result); }