Esempio n. 1
0
        public static ServiceTemplateCrmEvolutionItem Get(entitiesEvolveCentral ctx, int id)
        {
            var item = new ServiceTemplateCrmEvolutionItem();

            try
            {
                item = (from i in ctx.ServiceTemplateCrmEvolutionItems where i.Id == id orderby i.Name ascending select i).FirstOrDefault();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.ServiceTemplateCrmEvolution.Get(entitiesEvolveCentral ctx, int id)", ex.Message);
                item = null;
            }
            return(item);
        }
Esempio n. 2
0
        public static bool Delete(entitiesEvolveCentral ctx, ServiceTemplateCrmEvolutionItem item)
        {
            bool retval = true;

            try
            {
                ctx.ServiceTemplateCrmEvolutionItems.Remove(item);
                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.ServiceTemplateCrmEvolution.Delete(entitiesEvolveCentral ctx, ServiceTemplateCrmEvolutionItem item)", ex.Message);
                retval = false;
            }

            return(retval);
        }
Esempio n. 3
0
        public static bool Save(entitiesEvolveCentral ctx, ServiceTemplateCrmEvolutionItem item)
        {
            try
            {
                if (item.Id == 0)
                {
                    ctx.ServiceTemplateCrmEvolutionItems.Add(item);
                }

                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.ServiceTemplateCrmEvolution.Save(entitiesEvolveCentral ctx, ServiceTemplateCrmEvolutionItem item)", ex.Message);
                return(false);
            }
            return(true);
        }