示例#1
0
        private void suspend()
        {
            TaskInfoManager mgr = new TaskInfoManager();

            List <TaskInfo> lstUsers = new List <TaskInfo>();

            Entity         = new TaskInfo();
            Entity.Task_Id = Convert.ToInt32(EventArgument);
            //if (mgr.validate(Entity, "delete"))
            {
                Entity        = mgr.GetTaskByID(Entity.Task_Id);
                Entity.Status = true;
                mgr.Update(Entity, "suspend");
            }
            //else
            // {
            //     IsValid = false;
            // }
            ValidationErrors = mgr.ValidationErrors;
            if (ValidationErrors.Count > 0)
            {
                IsValid = false;
            }
            ListMode();
        }
示例#2
0
        private void Save(string evntArgument)
        {
            try
            {
                //List<TrainingProduct> lstproduct = new List<TrainingProduct>();
                TaskInfoManager mgr = new TaskInfoManager();
                if (string.IsNullOrEmpty(EventCommand))
                {
                    EventCommand = "list";
                }
                if (Convert.ToString(EventCommand).ToLower() == "save" && evntArgument.ToLower() != "edit")
                //if (Mode == "Add")
                {
                    Entity.Parent_ID = Parent_TaskID;
                    mgr.Insert(Entity, IsParentTask, TaskUser_Id);
                    //mgr.Insert(Entity, out lstproduct);
                    //Products = lstproduct;
                }
                else
                {
                    //mgr.Update(Entity, out lstproduct);
                    mgr.Update(Entity, "");
                    //Products = lstproduct;
                }
                ValidationErrors = mgr.ValidationErrors;
                if (ValidationErrors.Count > 0)
                {
                    IsValid = false;
                }

                if (!IsValid)
                {
                    if (Mode == "Add")
                    {
                        AddMode();
                    }
                    else
                    {
                        EditMode();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }