コード例 #1
0
        /// <summary>
        /// use for setting up default value
        /// </summary>
        /// <returns></returns>
        public ActionResult Update(int Id, string TargetID = "ScheduleTasklist")
        {
            ScheduleTask objItem = ScheduleTaskManager.GetById(Id, CurrentUser.CompanyID);

            objItem.TargetDisplayID = TargetID;
            return(View(ViewFolder + "Create.cshtml", objItem));
        }
コード例 #2
0
        public ActionResult ScheduleTaskEvt(int[] Id, string Action)
        {
            // You have your books IDs on the deleteInputs array
            switch (Action.ToLower())
            {
            case "delete":

                if (Id != null && Id.Length > 0)
                {
                    int          length = Id.Length;
                    ScheduleTask objItem;
                    for (int i = 0; i <= length - 1; i++)
                    {
                        objItem = ScheduleTaskManager.GetById(Id[i], CurrentUser.CompanyID);
                        if (objItem != null)
                        {
                            ScheduleTaskManager.Delete(objItem);
                        }
                    }
                    return(View(ViewFolder + "list.cshtml", ScheduleTaskManager.GetAll(CurrentUser.CompanyID)));
                }
                break;
            }


            return(View("PostFrm"));
        }
コード例 #3
0
        public ActionResult Create(ScheduleTask model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    model.CompanyID = CurrentUser.CompanyID;

                    if (model.Id != 0)
                    {
                        //get default value
                        ScheduleTask objOldScheduleTask = ScheduleTaskManager.GetById(model.Id, CurrentUser.CompanyID);
                        if (objOldScheduleTask != null)
                        {
                            model.CreatedDate = objOldScheduleTask.CreatedDate;
                            model.CreatedUser = objOldScheduleTask.CreatedUser;
                        }

                        ScheduleTaskManager.Update(model);
                    }
                    else
                    {
                        // TODO: Add insert logic here
                        model.CreatedUser = CurrentUser.EmployeeCode;
                        model.CreatedDate = SystemConfig.CurrentDate;
                        ScheduleTaskManager.Add(model);
                    }
                    return(View(ViewFolder + "list.cshtml", ScheduleTaskManager.GetAll(CurrentUser.CompanyID)));
                }
            }
            catch (Exception ObjEx)
            {
                //LogHelper.AddLog(new IfindLog() {LinkUrl=Request.Url.AbsoluteUri,Exception= ObjEx.Message,Message = ObjEx.StackTrace});
                return(View(model));
            }
            return(View(model));
        }
コード例 #4
0
        public ActionResult Get(int Id, string action)
        {
            ScheduleTask objItem = ScheduleTaskManager.GetById(Id, CurrentUser.CompanyID);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
コード例 #5
0
        public ActionResult Get(int Id)
        {
            ScheduleTask objItem = ScheduleTaskManager.GetById(Id, CurrentUser.CompanyID);

            return(View(objItem));
        }