protected void rptDays_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            DateTime date = (DateTime)e.Item.DataItem;

            CalendarManager manager = new CalendarManager();


            bool HideExternal = Query("hideexternal");
            bool HideInternal = Query("hideinternal");
            bool HideUntagged = Query("hideNonTagged");

            Repeater rptEvents = (Repeater)e.Item.FindControl("rptEvents");

            int type     = Convert.ToInt32(Request.QueryString["type"]);
            int tryAdmin = 0;

            Int32.TryParse(Request.QueryString["privacy"], out tryAdmin);

            int?calendarAdmin = null;

            if (tryAdmin != 0)
            {
                calendarAdmin = tryAdmin;
            }

            rptEvents.DataSource = manager.EventsPerDay(date, HideExternal, HideInternal, HideUntagged, type, null).OrderBy(d => d.StartDateTime);
            rptEvents.DataBind();
        }
示例#2
0
        /// <summary>
        /// Removes an event from the specified calendar.
        /// </summary>
        /// <param name="calendar">Calendar to remove event from</param>
        /// <param name="calendarEvent">Event to remove</param>
        /// <returns>True if successfully removed</returns>
        /// <exception cref="System.ArgumentException">Calendar is read-only</exception>
        /// <exception cref="System.UnauthorizedAccessException">Calendar access denied</exception>
        /// <exception cref="System.InvalidOperationException">Editing recurring events is not supported</exception>
        /// <exception cref="Plugin.Calendars.Abstractions.PlatformException">Unexpected platform-specific error</exception>
        public async Task <bool> DeleteEventAsync(Calendar calendar, CalendarEvent calendarEvent)
        {
            if (string.IsNullOrEmpty(calendar.ExternalID) || string.IsNullOrEmpty(calendarEvent.ExternalID))
            {
                return(false);
            }

            var existingCal = await GetCalendarByIdAsync(calendar.ExternalID).ConfigureAwait(false);

            if (existingCal == null)
            {
                return(false);
            }
            else if (!existingCal.CanEditEvents)
            {
                throw new ArgumentException("Cannot delete event from readonly calendar", "calendar");
            }
            else
            {
                CalendarManager calManager = null;

                try
                {
                    calManager = new CalendarManager();
                    calManager.Database.Delete(Event.Uri, Convert.ToInt32(calendarEvent.ExternalID));
                }
                finally
                {
                    calManager?.Dispose();
                    calManager = null;
                }
                return(true);
            }
        }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             if (Request.QueryString["Id"] != null && Request.QueryString["title"] != null && Request.QueryString["Is"] != null)
             {
                 id     = Convert.ToInt32(Request.QueryString["Id"]);
                 str    = Request.QueryString["title"];
                 strYes = Request.QueryString["Is"];
                 if (strYes.Equals("是"))
                 {
                     int num = CalendarManager.UpdateTime(id);
                     //if (num > 0)
                     //{
                     //    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('设置成功');", true);
                     //}
                     //else
                     //{
                     //    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('设置失败!');", true);
                     //}
                 }
             }
         }
         catch (Exception)
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('我明天不提醒你了!');", true);
         }
         this.TextMe.Value = str;
     }
 }
    // Use this for initialization
    void Start()
    {
        //ボタンのコンポーネント化、およびテキストサイズなど
        calendar = FindObjectOfType <CalendarManager>();
        text     = this.transform.GetChild(0).gameObject;
        text.GetComponent <TextMesh>().fontSize = 20;

        //カレンダーのマスのレイアウト変更
        this.ObserveEveryValueChanged(dateValue => dateValue.dateValue)
        .Subscribe(_ =>
        {
            text.GetComponent <TextMesh>().text  = dateValue.isDefault() ? "" : dateValue.Day.ToString();
            text.GetComponent <TextMesh>().color = GetColorDayOfWeek(dateValue.DayOfWeek);
            //今日の日付を目立たせる
            if (dateValue == DateTime.Today)
            {
                this.GetComponent <Renderer>().material.color = Color.yellow;
                this.transform.tag = "Today";
            }
            else
            {
                this.GetComponent <Renderer>().material.color = Color.white;
                this.transform.tag = "Untagged";
            }
        });
    }
示例#5
0
    // Use this for initialization

    void Start()
    {
        calendar = FindObjectOfType <CalendarManager>();

        button = GetComponent <Button>();

        text = button.GetComponentInChildren <Text>();

        text.fontSize = 30;

        this.ObserveEveryValueChanged(date => date.dateValue)

        .Subscribe(_ =>

        {
            text.text = dateValue.isDefault() ? "" : dateValue.Day.ToString();

            text.color = GetColorDayOfWeek(dateValue.DayOfWeek);

            if (dateValue == DateTime.Today)

            {
                GetComponent <Image>().enabled = true;
            }

            else

            {
                GetComponent <Image>().enabled = false;
            }
        });
    }
示例#6
0
    protected void btnSubmit_Click1(object sender, EventArgs e)
    {
        UserInfo user = Session["user"] as UserInfo;

        Model.Calendar calendar = new Model.Calendar();
        calendar.UId.UID      = user.UID;
        calendar.CalTheme     = txtTitle.Text.Trim();
        calendar.CalContent   = txDes.Value;
        calendar.TransactTime = Convert.ToDateTime(txtTime.Value);
        calendar.RemaindTime  = Convert.ToDateTime(txtJackTime.Value.Trim() + " " + txtHour.Text.Trim() + ":" + txtSecond.Text.Trim());

        calendar.CalType = droType.SelectedValue;
        calendar.Repeat  = rdoRepeat.SelectedValue;

        int flag = CalendarManager.AddCalendar(calendar);

        if (flag > 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功!');location.href='SelectCalender.aspx';</script>");
            //增加操作日志
            //UserInfo users = (UserInfo)Session["CurUser"];
            //string operateName = users.LoginID;
            //DateTime operateTime = Convert.ToDateTime(DateTime.Now.ToString());
            //string operateType = users.LoginID + "添加了日程管理";
            //LogManage.AddSystemLog(operateName, operateTime, operateType);
            Response.Redirect("SelectCalender.aspx");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加失败!');</script>");
        }
    }
示例#7
0
        public string DeleteCalendarItem(Guid calendarID)
        {
            var manager = new CalendarManager(new UnitOfWork());

            manager.Remove(calendarID);
            return("آیتم انتخاب شده با موفقیت حذف شد");
        }
示例#8
0
    void Start()
    {
        calendarManager = FindObjectOfType <CalendarManager> ();
        calendarButton  = FindObjectOfType <CalendarButton> ();

        StartCoroutine("Access");               //コルーチン
    }
        public void Execute(object parameter)
        {
            string season = parameter as string;

            switch (season)
            {
            case "Spring":
                CalendarManager.resetSeasonNotes(CalendarManager.Spring);
                break;

            case "Summer":
                CalendarManager.resetSeasonNotes(CalendarManager.Summer);
                break;

            case "Fall":
                CalendarManager.resetSeasonNotes(CalendarManager.Fall);
                break;

            case "Winter":
                CalendarManager.resetSeasonNotes(CalendarManager.Winter);
                break;

            default:
                break;
            }
        }
        public List <Calendar> GetAll()
        {
            UnitOfWork uow             = new UnitOfWork();
            var        calendarManager = new CalendarManager(uow);

            return(calendarManager.GetAll().ToList());
        }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     OptionsMenu.saveConfig();
     collectionsXML.saveCollectionXML();
     CalendarManager.saveCalendarXML();
     farmPlanner.Close();
     Environment.Exit(0);
 }
示例#12
0
        public IEnumerable <CalendarJson> GetCalendarItems()
        {
            var manager   = new CalendarManager(this._uow);
            var calenders = manager.GetAll();
            var result    = CalendarAssembler.ToJsons(calenders, this._uow);

            return(result);
        }
示例#13
0
    IEnumerator FinishDay()
    {
        yield return(new WaitUntil(() => Input.anyKeyDown));

        DataManager.SaveAllData();
        CalendarManager.NextDay();
        RoutineManager.MoveScene(1);
    }
示例#14
0
        public string SaveCalendar(CalendarJson json)
        {
            var manager  = new CalendarManager(new UnitOfWork());
            var calendar = CalendarAssembler.ToCalender(json);

            manager.SaveCalendar(calendar);
            return("بروزرسانی با موفقیت انجام شد.");
        }
示例#15
0
        public IEnumerable <CalendarJson> GetCalendarItems()
        {
            var manager   = new CalendarManager(new UnitOfWork());
            var calenders = manager.GetAll();
            var result    = CalendarAssembler.ToJsons(calenders);

            return(result);
        }
示例#16
0
 private void fetchEventsToCalendar()
 {
     m_CalendarManager = new CalendarManager(m_LoggedInUser);
     foreach (Event evnt in m_LoggedInUser.Events)
     {
         monthCalendarEvents.AddBoldedDate((DateTime)evnt.StartTime);
     }
 }
示例#17
0
        public CalendarJson BuildCalendar()
        {
            var manager  = new CalendarManager(new UnitOfWork());
            var calender = manager.BuildCalendar();

            var json = CalendarAssembler.ToJson(calender);

            return(json);
        }
 public MainWindow()
 {
     collectionsXML.loadCollectionsXML();
     CalendarManager.buildCalendar();
     FarmManager.loadFarmInformation();
     OptionsMenu.loadConfig();
     InitializeComponent();
     farmPlanner = new FarmPlanner();
 }
示例#19
0
        public CalendarJson BuildCalendar()
        {
            var manager  = new CalendarManager(this._uow);
            var calender = manager.BuildCalendar();

            var json = CalendarAssembler.ToJson(calender, this._uow);

            return(json);
        }
示例#20
0
文件: Program.cs 项目: azalac/sq3ms
        /// <summary>
        /// Contains the program main
        /// </summary>
        ///
        static void Main(string[] args)
        {
            //Create and load database
            DatabaseManager database = new DatabaseManager();

            database.LoadAll();

            //Declare database infomation
            if (populate_test_data)
            {
                DatabaseTable patients = database["Patients"];

                DatabaseTable appointments = database["Appointments"];

                DatabaseTable master = database["BillingMaster"];

                DatabaseTable billing = database["Billing"];


                //Create first patient
                patients.Insert(1, "5534567890EE", "Parmenter", "Billy", 'A', "May 6, 1996", SexTypes.M, 1);

                //Create first appointment
                appointments.Insert(1, CalendarManager.ConvertYearMonthToMonth(2017, 11), 3, 0, 1, 1);

                //Create first billing row
                billing.Insert(1, 1, "A665", BillingCodeResponse.NONE);

                //Second appointment
                appointments.Insert(2, CalendarManager.ConvertYearMonthToMonth(2017, 11), 5, 0, 1, 1);

                //second row
                billing.Insert(2, 2, "A005", BillingCodeResponse.NONE);

                //second patient
                patients.Insert(2, "1234567890KV", "Blanski", "Bob", 'A', "May 6, 1996", SexTypes.F, 1);

                //third appointment
                appointments.Insert(3, CalendarManager.ConvertYearMonthToMonth(2017, 11), 4, 0, 2, 1);

                //third and fourth rows (both assumed in same appointment)
                billing.Insert(3, 3, "A665", BillingCodeResponse.NONE);
                billing.Insert(4, 3, "A005", BillingCodeResponse.NONE);
            }

            InterfaceStart.InitConsole();

            InterfaceStart _interface = new InterfaceStart(StandardConsole.INSTANCE, database);

            _interface.WaitUntilExit();

            InterfaceStart.ResetConsole();

            //database.SaveAll();
        }
示例#21
0
		public static void Main (string[] args)
		{
			var man = new CalendarManager ();
			using (var ns = NamespaceBinding.Create("calendar")) {
				ns
					.HandleTopic<CalendarReference> ("calendar", q => 
					                                 new CalendarViewModel (man.GetCalendar (q)))
						.HandleTopic<CalendarDateRange> ("available-dates", q => GetAvailableDates(man,q))
						.RunService ()
						.Wait();
			}
		}
    private IEnumerator Start()
    {
        barNum.text    = "";
        bar.fillAmount = 0;
        pressAnyKey.SetActive(false);

        holiday.SetActive(CalendarManager.IsHolidayScheduled());
        passedDays     = CalendarManager.passedDays;
        yestPassedDays = CalendarManager.yestPassedDays;

        StartCoroutine(CountUp());
        yield return(null);
    }
示例#23
0
		static object GetAvailableDates (CalendarManager man, CalendarDateRange q)
		{
			var cal = man.GetCalendar (q.Calendar);
			var result = new List<DateTime> ();
			var oneDay = TimeSpan.FromDays (1);
			for (var current = q.From; current <= q.To; current += oneDay) {
				if (!cal.FreeBusy.Any (fb => fb.GetFreeBusyStatus (
					new Period (new iCalDateTime(current), oneDay)) != FreeBusyStatus.Free)) {
					result.Add (current);
				}
			}
			return result;
		}
        public void Execute(object parameter)
        {
            Crop crop = parameter as Crop;

            if (crop.IsChecked)
            {
                CalendarManager.updateNote(crop, "remove", false);
            }
            else
            {
                CalendarManager.updateNote(crop, "add", false);
            }
        }
        private async Task <string> SynchronizeTaskWithCalendar(ITaskItem taskItem)
        {
            if (taskItem == null)
            {
                return(string.Empty);
            }

            var appointment = CalendarManager.GetAppointment(taskItem.Title, taskItem.DueDate.Date);

            appointment.Details = taskItem.Notes;

            return(await CalendarManager.EditNewAppointmentAsync(appointment));
        }
示例#26
0
        public override void DataBind()
        {
            if (this._bound)
            {
                return;
            }
            _bound = true;

            int    _itemId = -1;
            object obj     = DataBinder.Eval(this.NamingContainer, "DataItem.Id");

            if (!String.IsNullOrEmpty(obj.ToString()))
            {
                _itemId = (int)obj;
            }
            else
            {
                return;
            }

            CalendarManager cMgr = new CalendarManager();
            DataRow         _event;

            _event = cMgr.GetEventDetails(_itemId);

            DateTime datefrom = (DateTime)_event["DateFrom"];
            DateTime?dateto   = null;

            if (_event["DateTo"] != System.DBNull.Value)
            {
                try
                {
                    dateto = (DateTime)_event["DateTo"];
                }
                catch
                {
                }
            }
            if (datefrom.CompareTo(dateto) == 0)
            {
                this.Text = string.Format(Format, datefrom);
            }
            else
            {
                this.Text = string.Format(Format + Format2, datefrom, dateto);
            }

            base.DataBind();
        }
示例#27
0
        /// <summary>
        /// Reinterperits the billable procedure table as a dictionary between
        /// a billable procedure (one per day:patient:code) and a list of the pks
        /// for each procedure which share the attributes.
        /// </summary>
        /// <param name="target_month">The current month</param>
        /// <returns>The dictionary.</returns>
        private Dictionary <BillableProcedure, List <int> > BillingDBAsDict(int target_month)
        {
            //Creates a new dictionary
            Dictionary <BillableProcedure, List <int> > dict = new Dictionary <BillableProcedure, List <int> >();

            //Loop through the keys
            foreach (object pk in procedures.Keys)
            {
                //Create a new billable procedure
                BillableProcedure bp = new BillableProcedure();

                //Save the aptid
                int aptid = (int)procedures[pk, "AppointmentID"];

                //Save the month
                int month = (int)appointments[aptid, "Month"];

                //If the month isnt the current month
                if (month != target_month)
                {
                    continue;
                }

                //Obtain all of the information needed
                bp.year  = CalendarManager.ConvertMonthToYear(ref month);
                bp.month = month;

                bp.day = (int)appointments[aptid, "Day"];

                bp.HCN = (string)people[appointments[aptid, "PatientID"], "HCN"];

                bp.code = (string)procedures[pk, "BillingCode"];

                bp.sex = people[appointments[aptid, "PatientID"], "sex"].ToString()[0];

                bp.fee = (string)billingMaster[bp.code, "DollarAmount"];

                //Create a list that will hold this information
                List <int> pks = dict.ContainsKey(bp) ? dict[bp] : new List <int>();

                //Add the information to the list
                pks.Add((int)pk);

                //Save the information into a dictionary
                dict[bp] = pks;
            }

            return(dict);
        }
示例#28
0
        /// <summary>
        /// Matches the procedures
        /// </summary>
        /// <param name="month"> The month being searched </param>
        /// <param name="response"> The response being created </param>
        /// <param name="logger"> Used to log any errors or success messages </param>
        ///

        private void MatchProcedures(int month, Dictionary <BillableProcedure, List <string> > response, Logging logger = null)
        {
            //Create a dictionary of pks
            Dictionary <BillableProcedure, List <int> > pks = BillingDBAsDict(month);

            //Set information to variable
            int year = CalendarManager.ConvertMonthToYear(ref month);

            //Loop through each billable procedure
            foreach (BillableProcedure bp in response.Keys)
            {
                //If the month or the year doesn't match
                if (bp.month != month || bp.year != year)
                {
                    logger?.Log(LoggingInfo.ErrorLevel.ERROR, "Invalid date for response");
                    continue;
                }

                //If the response doesn't match
                if (!response.ContainsKey(bp))
                {
                    logger?.Log(LoggingInfo.ErrorLevel.WARN, "Could not match " + bp + " to known procedures");
                    continue;
                }

                //If the count of pks doesn't match the count of responses
                if (pks[bp].Count != response[bp].Count)
                {
                    logger?.Log(LoggingInfo.ErrorLevel.ERROR, "Billable procedure response and database data mismatched for procedure " + bp);
                    continue;
                }

                //Save information into a variable
                var zipped = response[bp].Zip(pks[bp], (s, i) => new Tuple <int, string>(i, s));

                //Loop through each procedure
                foreach (Tuple <int, string> procedure in zipped)
                {
                    procedures[procedure.Item1, "CodeResponse"] = (BillingCodeResponse)Enum.Parse(typeof(BillingCodeResponse), procedure.Item2);
                }

                //Log the success
                logger?.Log(LoggingInfo.ErrorLevel.INFO, "Successfully merged billable procedures for " + pks[bp] + " and " + response[bp]);
            }

            //Log that done
            logger?.Log(LoggingInfo.ErrorLevel.INFO, "Finished merging billable procedure responses");
        }
        private async void Delete_Click(object sender, RoutedEventArgs e)
        {
            bool res, chck;

            AddRitual.IsEnabled    = false;
            AddAlert.IsEnabled     = false;
            ViewAbout.IsEnabled    = false;
            DeleteButton.IsEnabled = false;
            var sb = StatusBar.GetForCurrentView();

            sb.ProgressIndicator.ProgressValue = null;
            sb.ProgressIndicator.Text          = "Deleting...";
            await sb.ProgressIndicator.ShowAsync();

            var r = (sender as FrameworkElement).DataContext as Ritual;

            res = await ServiceManager.TryDeleteRitualAsync(ritualTable, r);

            if (res == false)
            {
                await new MessageDialog("Check Your Network Connection! \n Failed To Delete").ShowAsync();
            }
            else
            {
                RitualCollection.Remove(r);
                chck = await CalendarManager.TryDeleteAppointmentAsync(r);

                if (chck == true)
                {
                    await new MessageDialog("Appointment Deleted Sucessfully...").ShowAsync();
                }
                else
                {
                    await new MessageDialog("Appointment Not Deleted Successfully...").ShowAsync();
                }
            }

            AddRitual.IsEnabled    = true;
            AddAlert.IsEnabled     = true;
            ViewAbout.IsEnabled    = true;
            DeleteButton.IsEnabled = true;


            await sb.ProgressIndicator.HideAsync();

            sb = null;
        }
示例#30
0
        public static void SendEventsToCalendar(List <Event> events, Calendar calendarName, CalendarAccount google, bool splitEvents, bool enableReminders, string customEventName)
        {
            //split events by day if checked
            if (splitEvents)
            {
                events = EventManager.SplitEventsByDay(events);
            }

            //pass thread canceler, so that sending can be stopped if needed
            CalendarManager.threadCanceler = threadCanceler;

            //start sending
            CalendarManager.AddEventsToCalenderGoogle(events, calendarName.Id, enableReminders, customEventName);

            //fire event to let others know event sending is done
            SendingEventsCompleted.Invoke();
        }
示例#31
0
        public override void DataBind()
        {
            if (_bound)
            {
                return;
            }
            _bound = true;

            CalendarManager nMgr = new CalendarManager();

            if (CalendarId != null)
            {
                this.DataItem = nMgr.GetEventDetails(CalendarId.Value);
            }

            base.DataBind();
        }
示例#32
0
        public Api()
        {
            Projects = new ProjectManager(this);
            ToDoLists = new ToDoListManager(this);
            People = new PeopleManager(this);
            Events = new EventManager(this);
            Accesses = new AccessManager(this);
            Calendars = new CalendarManager(this);
            Topics = new TopicManager(this);
            Messages = new MessageManager(this);
            Attachments = new AttachmentManager(this);
            Uploads = new UploadManager(this);
            Comments = new CommentManager(this);
            Documents = new DocumentManager(this);

            MimeTypeResolver = new MimeTypeResolver();
            ResponseCache = Api.DefaultResponseCache;
        }