Exemplo n.º 1
0
        static void Main(string[] args)
        {
            using (IRiakEndPoint endpoint = RiakCluster.FromConfig("riakConfig"))
            {
                IRiakClient client = endpoint.CreateClient();
                UserRepository userRepo = new UserRepository(client);
                MsgRepository msgRepo = new MsgRepository(client);
                TimelineRepository timelineRepo = new TimelineRepository(client);
                TimelineManager timelineMgr = new TimelineManager(timelineRepo, msgRepo);

                // Create and save users
                var marleen = new User("marleenmgr", "Marleen Manager", "*****@*****.**");
                var joe = new User("joeuser", "Joe User", "*****@*****.**");
                userRepo.Save(marleen);
                userRepo.Save(joe);

                // Create new Msg, post to timelines
                Msg msg = new Msg(marleen.UserName, joe.UserName, "Welcome to the company!");
                timelineMgr.PostMsg(msg);

                // Get Joe's inbox for today, get first message
                Timeline joesInboxToday = timelineMgr.GetTimeline(joe.UserName, Timeline.TimelineType.Inbox, DateTime.UtcNow);
                Msg joesFirstMsg = msgRepo.Get(joesInboxToday.MsgKeys.First());

                Console.WriteLine("From: " + joesFirstMsg.Sender);
                Console.WriteLine("Msg : " + joesFirstMsg.Text);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            using (IRiakEndPoint endpoint = RiakCluster.FromConfig("riakConfig"))
            {
                IRiakClient        client       = endpoint.CreateClient();
                UserRepository     userRepo     = new UserRepository(client);
                MsgRepository      msgRepo      = new MsgRepository(client);
                TimelineRepository timelineRepo = new TimelineRepository(client);
                TimelineManager    timelineMgr  = new TimelineManager(timelineRepo, msgRepo);

                // Create and save users
                var marleen = new User("marleenmgr", "Marleen Manager", "*****@*****.**");
                var joe     = new User("joeuser", "Joe User", "*****@*****.**");
                userRepo.Save(marleen);
                userRepo.Save(joe);

                // Create new Msg, post to timelines
                Msg msg = new Msg(marleen.UserName, joe.UserName, "Welcome to the company!");
                timelineMgr.PostMsg(msg);

                // Get Joe's inbox for today, get first message
                Timeline joesInboxToday = timelineMgr.GetTimeline(joe.UserName, Timeline.TimelineType.Inbox, DateTime.UtcNow);
                Msg      joesFirstMsg   = msgRepo.Get(joesInboxToday.MsgKeys.First());

                Console.WriteLine("From: " + joesFirstMsg.Sender);
                Console.WriteLine("Msg : " + joesFirstMsg.Text);
            }
        }
Exemplo n.º 3
0
        public static void ShowfromPage(string MessageId, MsgBuilder MessageBuilder, Page frmName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            MessageBuilder.MsgRepository[MessageId] = theMsg.ToString();
            string theDynamicMsg = MessageBuilder.BuildMessage(MessageId);

            Showfrompage(theDynamicMsg, theMsg.Type.ToString(), theMsg.Buttons.ToString(), frmName);
        }
Exemplo n.º 4
0
        public static void ShowConfirm(string MessageId, MsgBuilder MessageBuilder, WebControl cntrlName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            MessageBuilder.MsgRepository[MessageId] = theMsg.ToString();
            string theDynamicMsg = MessageBuilder.BuildMessage(MessageId);

            ShowConfirm(theDynamicMsg, theMsg.Type.ToString(), theMsg.Buttons.ToString(), cntrlName);
        }
Exemplo n.º 5
0
        public static void ShowforUpdatePanel(string MessageId, MsgBuilder MessageBuilder, Control frmName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            MessageBuilder.MsgRepository[MessageId] = theMsg.ToString();
            string theDynamicMsg = MessageBuilder.BuildMessage(MessageId);

            ShowforUpdatePanel(theDynamicMsg, theMsg.Type.ToString(), theMsg.Buttons.ToString(), frmName);
        }
Exemplo n.º 6
0
        public static string GetMessage(string MessageId, MsgBuilder MessageBuilder, Control frmName = null)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            MessageBuilder.MsgRepository[MessageId] = theMsg.ToString();
            string theDynamicMsg = MessageBuilder.BuildMessage(MessageId);

            return(theDynamicMsg.ToString());
        }
Exemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MessageId">For retrieving message from xml file corresponding to MessageId</param>
        /// <param name="MessageBuilder">Send user defined message</param>
        /// <param name="frmName">The form control on which message will be shown</param>
        public static DialogResult ShowWindowConfirm(string MessageId, MsgBuilder MessageBuilder, System.Windows.Forms.Control frmName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            MessageBuilder.MsgRepository[MessageId] = theMsg.ToString();
            string theDynamicMsg = MessageBuilder.BuildMessage(MessageId);

            //ShowConfirm(theDynamicMsg, theMsg.Type.ToString(), theMsg.Buttons.ToString(), cntrlName);
            return(ShowWindow(theDynamicMsg, theMsg.Type.ToString(), theMsg.Buttons.ToString(), frmName));
        }
Exemplo n.º 8
0
 public ManageController(
     UserManager <EaUser> userManager,
     SignInManager <EaUser> signInManager,
     ILogger <ManageController> logger,
     IEmailSenderService emailSender,
     EaDbContext dbContext,
     UrlEncoder urlEncoder,
     MsgRepository msgRespository)
 {
     _userManager    = userManager;
     _signInManager  = signInManager;
     _logger         = logger;
     _emailSender    = emailSender;
     _urlEncoder     = urlEncoder;
     _dbContext      = dbContext;
     _msgRespository = msgRespository;
 }
Exemplo n.º 9
0
        public static void ShowConfirm(string MessageId, WebControl cntrlName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            ShowConfirm(theMsg.ToString(), theMsg.Type.ToString(), theMsg.Buttons.ToString(), cntrlName);
        }
Exemplo n.º 10
0
        public static void ShowforUpdatePanel(string MessageId, Control frmName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            ShowforUpdatePanel(theMsg.ToString(), theMsg.Type.ToString(), theMsg.Buttons.ToString(), frmName);
        }
Exemplo n.º 11
0
        public static string GetMessage(string MessageId, Control frmName = null)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            return(theMsg.ToString());
        }
Exemplo n.º 12
0
        private Boolean ValidationFormData()
        {
            if (rcbOrderBy.SelectedValue == "")
            {
                //lblmessage.Text = "Date of Last Actual Contact cannot be blank.";
                RawMessage theMsg = MsgRepository.GetMessage("IQTouchOrderedByName");
                RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                return(false);
            }
            //if (rcbReportedBy.SelectedValue == "")
            //{
            //    //lblmessage.Text = "Date of Last Actual Contact cannot be blank.";
            //    RawMessage theMsg = MsgRepository.GetMessage("IQTouchReportedByName");
            //    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
            //    return false;

            //}
            if (RadDateOrder.DbSelectedDate == null)
            {
                //lblmessage.Text = "Date of Last Actual Contact cannot be blank.";
                RawMessage theMsg = MsgRepository.GetMessage("IQTouchOrderDate");
                RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                return(false);
            }
            //if (RadDateReportDate.DbSelectedDate == null)
            //{
            //    //lblmessage.Text = "Date of Last Actual Contact cannot be blank.";
            //    RawMessage theMsg = MsgRepository.GetMessage("IQTouchReportedDate");
            //    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
            //    return false;

            //}
            if (hiddTestID.Value == "")
            {
                //lblmessage.Text = "Date of Last Actual Contact cannot be blank.";
                RawMessage theMsg = MsgRepository.GetMessage("IQTouchSubTestID");
                RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                return(false);
            }
            // Date Validation

            if (Convert.ToDateTime(RadDateOrder.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
            {
                RawMessage theMsg = MsgRepository.GetMessage("IQTouchLabOrderDate");
                RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                return(false);
            }

            //if (Convert.ToDateTime(RadDateReportDate.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
            //{
            //    RawMessage theMsg = MsgRepository.GetMessage("IQTouchlabOrderReportedByDate");
            //    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
            //    return false;
            //}
            //if (Convert.ToDateTime(RadDateOrder.SelectedDate.Value) > Convert.ToDateTime(RadDateReportDate.SelectedDate.Value))
            //{
            //    RawMessage theMsg = MsgRepository.GetMessage("IQTouchlabOrderDateCompReportedDate");
            //    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
            //    return false;

            //}



            return(true);
        }
Exemplo n.º 13
0
 public MsgController(MsgRepository msgRepository)
 {
     _msgRepository = msgRepository;
 }
Exemplo n.º 14
0
        private Boolean ValidationFormData()
        {
            if (dtDateBCG.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateBCG.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtOPV0Date.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtOPV0Date.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateOPV1.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateOPV1.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateRV1.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateRV1.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateDTaP1.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateDTaP1.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateHepB1.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateHepB1.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDatePCV1.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDatePCV1.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateDTaP2.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateDTaP2.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateHepB2.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateHepB2.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateDTaP3.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateDTaP3.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateHepB3.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateHepB3.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDatePCV2.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDatePCV2.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateRV2.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateRV2.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateMeasles1.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateMeasles1.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDatePVC3.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDatePVC3.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateMeasles2.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateMeasles2.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateDTaP4.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateDTaP4.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateTd6Yrs.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateTd6Yrs.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }
            if (dtDateTd23Yrs.SelectedDate != null)
            {
                if (Convert.ToDateTime(dtDateTd23Yrs.SelectedDate.Value) > Convert.ToDateTime(DateTime.Today))
                {
                    RawMessage theMsg = MsgRepository.GetMessage("IQTouchImmunisationDate");
                    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "src1", "FormValidatedOnSubmit('" + theMsg.Text + "');", true);
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 15
0
        public static void Show(string MessageId, Page frmName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            Show(theMsg.ToString(), theMsg.Type.ToString(), theMsg.Buttons.ToString(), frmName);
        }
Exemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MessageId">For retrieving message from xml file corresponding to MessageId </param>
        /// <param name="frmName">The form control on which message will be shown</param>
        public static DialogResult ShowWindowConfirm(string MessageId, Control frmName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            return(ShowWindow(theMsg.ToString(), theMsg.Type.ToString(), theMsg.Buttons.ToString(), frmName));
        }
Exemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MessageId">For retrieving message from xml file corresponding to MessageId </param>
        /// <param name="frmName">The form control on which message will be shown</param>
        public static void ShowWindow(string MessageId, System.Windows.Forms.Control frmName)
        {
            RawMessage theMsg = MsgRepository.GetMessage(MessageId);

            ShowWindow(theMsg.ToString(), theMsg.Type.ToString(), theMsg.Buttons.ToString(), frmName);
        }