Ejemplo n.º 1
0
        }                                                                    // Statuses

        public override void Execute()
        {
            DB.ForEachRowSafe(
                (sr, bRowsetStart) => {
                IdNameModel e = sr.Fill <IdNameModel>();
                Actions.Add(e);
                return(ActionResult.Continue);
            },
                "CrmLoadActions",
                CommandSpecies.StoredProcedure
                );

            DB.ForEachRowSafe(
                (sr, bRowsetStart) => {
                IdNameModel e = sr.Fill <IdNameModel>();
                Ranks.Add(e);
                return(ActionResult.Continue);
            },
                "CrmLoadRanks",
                CommandSpecies.StoredProcedure
                );

            var oStatuses = new SortedDictionary <int, CrmStatusGroup>();

            DB.ForEachRowSafe(
                (sr, bRowsetStart) => {
                int nGroupID = sr["GroupID"];

                CrmStatusGroup grp = null;

                if (oStatuses.ContainsKey(nGroupID))
                {
                    grp = oStatuses[nGroupID];
                }
                else
                {
                    grp = new CrmStatusGroup {
                        Id       = nGroupID,
                        Name     = sr["GroupName"],
                        Priority = sr["Priority"],
                        IsBroker = ((bool?)sr["IsBroker"]) ?? false,
                        Statuses = new List <IdNameModel>(),
                    };

                    oStatuses[grp.Id] = grp;
                }                         // if

                grp.Statuses.Add(new IdNameModel {
                    Id   = sr["StatusID"],
                    Name = sr["StatusName"],
                });

                return(ActionResult.Continue);
            },
                "CrmLoadStatuses",
                CommandSpecies.StoredProcedure
                );

            Statuses = oStatuses.Values.ToList();
        } // Execute
Ejemplo n.º 2
0
        public int AddTag(IdNameModel tag)
        {
            var entry = new Tag()
            {
                Id = tag.Id, Name = tag.Name, Status = (int)TagStatus.NeedVerify
            };

            _repository.Add(entry);
            _repository.Commit();
            return(entry.Id);
        }
Ejemplo n.º 3
0
        private string GetShortCode(IdNameModel client, IdNameModel project, IdNameModel task)
        {
            var k = new Triple {
                Client = client, Project = project, Task = task
            };

            if (tripleToShortCode.TryGetValue(k, out string v))
            {
                return(v);
            }

            return("???");
        }
Ejemplo n.º 4
0
 public int Post(IdNameModel tag)
 {
     return(_tagService.AddTag(tag));
 }
Ejemplo n.º 5
0
        // GET api/values
        //public IEnumerable<string> Get()
        //{
        //    return new string[] { "value1", "value2" };
        //}

        // GET api/values/5
        public string Get([FromUri] IdNameModel model)
        {
            return("as");
        }