コード例 #1
0
        public WorkflowState Get()
        {
            var            rng       = new Random();
            InFrameContext myContext = new InFrameContext();
            WorkflowState  bezin     = myContext.WorkflowState.FirstOrDefault();

            return(bezin);
        }
コード例 #2
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
 public static void AddTicket(Ticket ticket)
 {
     using (InFrameContext db = new InFrameContext())
     {
         db.Ticket.Add(ticket);
         db.SaveChanges();
     }
 }
コード例 #3
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
        public static List <Ticket> getTicketList()
        {
            List <Ticket> Result;

            using (InFrameContext db = new InFrameContext())
            {
                Result = db.Ticket.ToList();
            }
            return(Result);
        }
コード例 #4
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
        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);
        }
コード例 #5
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
        //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);
        }
コード例 #6
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
        public static List <TicketFormConfig> getTicketFormConfigList()
        {
            List <TicketFormConfig> Result;

            using (InFrameContext db = new InFrameContext())
            {
                Result = db.TicketFormConfig.Where(s => s.Active).ToList();
            }
            return(Result);
        }
コード例 #7
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
        public static Ticket getTicket(int id)
        {
            Ticket Result;

            using (InFrameContext db = new InFrameContext())
            {
                Result = db.Ticket.Where(x => x.Id == id).FirstOrDefault();
            }
            return(Result);
        }
コード例 #8
0
        public static List <TicketType> getTicketTypes()
        {
            List <TicketType> Result;

            using (InFrameContext db = new InFrameContext())
            {
                Result = db.TicketType.Where(s => s.Active == 1).ToList();
            }
            return(Result);
        }
コード例 #9
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
        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);
        }
コード例 #10
0
ファイル: DataFactory.cs プロジェクト: cscbruneau/InFrame
        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);
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
        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);
        }