Exemple #1
0
        public Result SaveTask(Task task)
        {
            Result result = new Result();

            try {
                string sql = "";
                if (task.Id != 1)
                {
                    sql = DBUtil.BuildUpdateQuery(task, new String[] { "SUBJECT", "ASSIGNOR", "DESCRIPTION", "PRIORITY", "SCHEDULESTART", "SCHEDULEEND", "RESULT", "STATUS", "DELETEFLAG", "USERINFO_ID" });
                }
                else
                {
                    sql = DBUtil.BuildInsertQuery(task);
                }

                int cnt = DBUtil.Execute(sql);
                result.Success = cnt > 0;
            }
            catch (Exception e) {
                result.Success  = false;
                result.ErrorMsg = e.Message;
            }
            return(result);
        }