Beispiel #1
0
        public bool Delete(int id)
        {
            var temp = false;

            using (var context = new db_cmaEntities())
            {
                DOBase <tb_message> tRole = new DOBase <tb_message>(context);
                tRole.Delete(id);

                temp = tRole.SaveChang() > 0 ? true : false;
            }
            return(temp);
        }
Beispiel #2
0
        public bool Add(MessageModel model)
        {
            var temp = false;

            using (var context = new db_cmaEntities())
            {
                DOBase <tb_message> tRole = new DOBase <tb_message>(context);
                tRole.Add(GetModel(model));
                context.Configuration.ValidateOnSaveEnabled = false;
                temp = tRole.SaveChang() > 0 ? true : false;
                context.Configuration.ValidateOnSaveEnabled = true;
            }
            return(temp);
        }
Beispiel #3
0
        public bool Edit(MessageModel model)
        {
            var temp = false;

            using (var context = new db_cmaEntities())
            {
                DOBase <tb_message> tRole = new DOBase <tb_message>(context);
                tRole.Edit(GetModel(model), new string[] { "Value", "Time" });

                temp = tRole.SaveChang() > 0 ? true : false;
                //context.Configuration.ValidateOnSaveEnabled = true;
            }
            return(temp);
        }