Beispiel #1
0
 public void SetStatus(int id, string value)
 {
     var task = DbUtil.Db.Tasks.Single(t => t.Id == id);
     var cvc = new CodeValueModel();
     var ts = cvc.TaskStatusCodes();
     var statusid = ts.Single(t => t.Value == value).Id;
     var sb = new StringBuilder();
     ChangeTask(sb, task, "StatusId", statusid);
     NotifyIfNeeded(sb, task);
     DbUtil.Db.SubmitChanges();
 }
Beispiel #2
0
 public IEnumerable<SelectListItem> TaskStatusCodes()
 {
     var c = new CodeValueModel();
     return top.Union(c.TaskStatusCodes().Select(cv =>
         new SelectListItem {Text = cv.Value, Value = cv.Id.ToString()}));
     ;
 }
Beispiel #3
0
 public string JsonStatusCodes()
 {
     var cv = new CodeValueModel();
     var sb = new StringBuilder("{");
     foreach (var c in cv.TaskStatusCodes())
     {
         if (sb.Length > 1)
             sb.Append(",");
         sb.AppendFormat("'{0}':'{1}'", c.Value, c.Value);
     }
     sb.Append("}");
     return sb.ToString();
 }