コード例 #1
0
        public List <MyTaskList> GetTaskList()

        {
            var response = auth.service.Tasklists.List();
            var result   = response.Execute();
            var items    = result.Items;

            if (items != null && items.Count > 0)
            {
                List <MyTaskList> myLists = new List <MyTaskList>();

                foreach (var i in items)
                {
                    MyTaskList a = new MyTaskList();
                    a.Id    = i.Id;
                    a.title = i.Title;

                    myLists.Add(a);
                }


                return(myLists);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        public void SaveTask()
        {
            MyTaskModel.ID = (MyTaskList.Count > 0) ? MyTaskList.FindLast(x => x.TaskDate < MyTaskModel.TaskDate).ID + 1 : MyTaskList.Count + 1;

            WorkedHourValue();

            MyTaskList.Add(MyTaskModel);
            SaveViewModelToIsolatedStorage();
            RenewTaskModel();
        }
コード例 #3
0
        public MyTaskList SingleTaskList(string id)
        {
            var        response = auth.service.Tasklists.Get(id);
            var        result   = response.Execute();
            MyTaskList list     = new MyTaskList();

            list.title = result.Title;
            list.Id    = result.Id;
            return(list);
        }
コード例 #4
0
        public string InsertTaskList([FromBody] MyTaskList _list)
        {
            TaskList list = new TaskList {
                Title = _list.title
            };
            var response = auth.service.Tasklists.Insert(list);
            var result   = response.Execute();
            var items    = result.Id;

            return("Your Task is successfull inserted ");
        }
コード例 #5
0
ファイル: WebApi.aspx.cs プロジェクト: lai123456789/2019-7-17
        /// <summary>
        /// 检查用户并保持会话
        /// </summary>
        private void CheckUser()
        {
            string     errmsg  = "";
            ResultInfo outjson = new ResultInfo();

            if (Session["userinfo"] != null)
            {
                UserInfo userinfo = new UserInfo();
                userinfo        = (UserInfo)Session["userinfo"];
                outjson.errcode = 0;
                string        unnotify    = "";
                BLLUserManage mybll       = new BLLUserManage();
                bool          result      = mybll.GetUserUnNotifyV2(userinfo.usercode, ref unnotify, ref errmsg);
                NotifyList    info_notify = ObjectSeriallizeHelper.JsonToObject <NotifyList>(unnotify);
                outjson.notify = ObjectSeriallizeHelper.ObjectToJson(info_notify.data);

                string tasknotify = "";
                result = mybll.GetUserTaskNotifyV2(userinfo.usercode, ref tasknotify, ref errmsg);
                TaskNotifyList info_task = ObjectSeriallizeHelper.JsonToObject <TaskNotifyList>(tasknotify);
                outjson.tasknotify = ObjectSeriallizeHelper.ObjectToJson(info_task.data);

                string mytaskunfinished = "";
                result = mybll.GetMyTaskUnfinishedListV2(userinfo.usercode, ref mytaskunfinished, ref errmsg);
                MyTaskList info_mytask = ObjectSeriallizeHelper.JsonToObject <MyTaskList>(mytaskunfinished);
                outjson.mytaskunfinished = ObjectSeriallizeHelper.ObjectToJson(info_mytask.data);

                string myacceptnotify = "";
                result = mybll.GetMyAcceptTaskListV2(userinfo.usercode, ref myacceptnotify, ref errmsg);
                MyAcceptTaskList info_myaccepttask = ObjectSeriallizeHelper.JsonToObject <MyAcceptTaskList>(myacceptnotify);
                outjson.myaccepttask = ObjectSeriallizeHelper.ObjectToJson(info_myaccepttask.data);
            }
            else
            {
                outjson.errcode = -1;
                outjson.errmsg  = "未登录";
            }
            Response.Write(ObjectSeriallizeHelper.ObjectToJson(outjson));
            Response.End();
        }
コード例 #6
0
        public Page3()
        {
            this.InitializeComponent();

            myTaskList = new MyTaskList();
        }
コード例 #7
0
 public void DeleteTask(MyTask task)
 {
     MyTaskList.Remove(task);
     SaveViewModelToIsolatedStorage();
 }