예제 #1
0
        public ActionResult Save(TodoWrap data)
        {
            var repo = new AllRepository();

            if (repo.Save(data))
            {
                return(Ok(repo.GetFirstAll()));
            }
            return(Ok(new { message = "Not okie-dokie." }));
        }
예제 #2
0
        public void DeleteEmailSmsEntry(int Id)
        {
            var repo = new AllRepository <ReferalEventDetail>();

            if (Id > 0)
            {
                repo.DeleteModel(Id);
            }

            repo.Save();
        }
예제 #3
0
        public void DeleteEvent(int Id)
        {
            var repo = new AllRepository <ReferalEventDetail>();

            if (Id > 0)
            {
                var data = dbContext.ReferalEventDetails.Where(row => row.Id == Id).FirstOrDefault();
                data.isDeleted = true;
                repo.UpdateModel(data);
                repo.Save();
            }
        }
예제 #4
0
        public void SaveApointMent(ReferalApointment model)
        {
            var repo = new AllRepository <ReferalApointment>();

            if (model.Id == 0)
            {
                repo.InsertModel(model);
            }
            else
            {
                repo.UpdateModel(model);
            }
            repo.Save();
        }
예제 #5
0
        public void SaveEmailSMSEntry(SendSmsOrEmail model)
        {
            var repo = new AllRepository <SendSmsOrEmail>();

            if (model.Id == 0)
            {
                model.CreatedOn = DateTime.Now.Date;
                repo.InsertModel(model);
            }
            else
            {
                repo.UpdateModel(model);
            }
            repo.Save();
        }
예제 #6
0
        public void SaveEvents(ReferalEventDetail model, int siteId, int studyId)
        {
            var repo = new AllRepository <ReferalEventDetail>();

            if (model.Id == 0)
            {
                repo.InsertModel(model);
            }
            else
            {
                repo.UpdateModel(model);
            }
            repo.Save();
            var value = dbContext.StudySiteReferalMappings.AsNoTracking().Where(row => row.RefrelId == model.ReferalId && row.SiteId == siteId && row.StudyId == studyId).FirstOrDefault();

            if (value != null)
            {
                value.ReferalStatusId        = model.ReferalStatusId;
                dbContext.Entry(value).State = System.Data.Entity.EntityState.Modified;
                dbContext.SaveChanges();
            }
        }
예제 #7
0
        public async Task StartAsync(IDialogContext context)
        {
            var               reply  = context.MakeMessage();
            HeroCard          card   = new HeroCard();
            var               query  = @"query  {
                    viewer{
                        name
                      repositories(first: 100)
                      {
                        nodes
                        {
                           name
                        }
                        }
                    }
                }";
            var               client = new GraphQLClient();
            string            data   = client.Query(query, null);
            AllRepository     obj    = Newtonsoft.Json.JsonConvert.DeserializeObject <AllRepository>(data);
            List <CardAction> button = new List <CardAction>();
            CardAction        cardAction;

            foreach (Node1 rep in obj.data.viewer.repositories.nodes)
            {
                cardAction = new CardAction(ActionTypes.ImBack, rep.name, value: rep.name);
                button.Add(cardAction);
            }
            card.Title    = "Below are your repositories";
            card.Subtitle = "To get detail click on it";
            card.Buttons  = button;
            Attachment attachment = card.ToAttachment();

            reply.Attachments.Add(attachment);
            await context.PostAsync(reply);

            context.Wait(RepositoryDetailData);
        }
예제 #8
0
        public async Task StartAsync(IDialogContext context)
        {
            var reply = context.MakeMessage();
            List <AdaptiveChoice> choice = new List <AdaptiveChoice>();

            choice.Add(new AdaptiveChoice()
            {
                Title = "--Select option--", Value = "--Select option--"
            });
            var query = @"query  {
                    viewer{
                        name
                      repositories(first: 100)
                      {
                         nodes
                        {
                         name
                        }
                      }
                    }
                }";

            var           client = new GraphQLClient();
            string        data   = client.Query(query, null);
            AllRepository obj    = Newtonsoft.Json.JsonConvert.DeserializeObject <AllRepository>(data);

            foreach (Node1 rep in obj.data.viewer.repositories.nodes)
            {
                choice.Add(new AdaptiveChoice()
                {
                    Title = rep.name, Value = rep.name
                });
            }
            AdaptiveCard card = new AdaptiveCard()
            {
                Body = new List <AdaptiveElement>()
                {
                    new AdaptiveTextBlock()
                    {
                        Text = "Search Issue", Weight = AdaptiveTextWeight.Bolder, Size = AdaptiveTextSize.Large, Wrap = true, HorizontalAlignment = AdaptiveHorizontalAlignment.Center
                    },
                    new AdaptiveTextBlock()
                    {
                        Text = "Select Repository"
                    },
                    new AdaptiveChoiceSetInput()
                    {
                        Id = "Repository", Style = AdaptiveChoiceInputStyle.Compact, Choices = choice
                    },
                    new AdaptiveTextBlock()
                    {
                        Text = "Select Issue State"
                    },
                    new AdaptiveChoiceSetInput()
                    {
                        Id      = "State", Value = "--ALL--", IsMultiSelect = false, Style = AdaptiveChoiceInputStyle.Compact,
                        Choices = new List <AdaptiveChoice>()
                        {
                            new AdaptiveChoice()
                            {
                                Title = "--ALL--", Value = "--ALL--"
                            },
                            new AdaptiveChoice()
                            {
                                Title = "OPEN",
                                Value = "OPEN"
                            },
                            new AdaptiveChoice()
                            {
                                Title = "CLOSED",
                                Value = "CLOSED"
                            }
                        }
                    }
                },
                Actions = new List <AdaptiveAction>()
                {
                    new AdaptiveSubmitAction()
                    {
                        Title    = "Submit",
                        Id       = "IssueDetail",
                        DataJson = @"{""Action"":""GetIssueDetail""}"
                    }
                }
            };

            Microsoft.Bot.Connector.Attachment attachment = new Microsoft.Bot.Connector.Attachment()
            {
                ContentType = AdaptiveCard.ContentType,
                Content     = card,
                //  Name = "ABCD"
            };

            reply.Attachments.Add(attachment);
            await context.PostAsync(reply);

            context.Done <object>(new object());
        }
예제 #9
0
        public ActionResult GetFirstAll()
        {
            var repo = new AllRepository();

            return(Ok(repo.GetFirstAll()));
        }