예제 #1
0
        public bool Update(SolutionKindNew solution_kind)
        {
            //
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    //

                    var solutionkind_new = _entity.SolutionKindNew
                                           .Where(e => e.Num == solution_kind.Num).FirstOrDefault();

                    solutionkind_new.Kind     = solution_kind.Kind;
                    solutionkind_new.Range    = solution_kind.Range;
                    solutionkind_new.Pic1     = solution_kind.Pic1;
                    solutionkind_new.DtUpdate = DateTime.Now;
                    solutionkind_new.UpdateBy = solution_kind.UpdateBy;



                    _entity.Entry(solutionkind_new).State = EntityState.Modified;
                    _entity.SaveChanges();

                    return(true);
                });

                return(_adapter.Catch <bool>(func));
            }
        }
예제 #2
0
        public bool Insert(SolutionKindNew solution_kind)
        {
            //
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    //

                    _entity.SolutionKindNew.Add(solution_kind);

                    _entity.SaveChanges();

                    return(true);
                });

                return(_adapter.Catch <bool>(func));
            }
        }
예제 #3
0
        public bool Delete(SolutionKindNew solution_kind)
        {
            //
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    //

                    var solution_kind_new = _entity.SolutionKindNew
                                            .Where(e => e.Num == solution_kind.Num && e.StatVoid == 0)
                                            .FirstOrDefault();

                    _entity.SolutionKindNew.Remove(solution_kind_new);

                    _entity.SaveChanges();

                    return(true);
                });

                return(_adapter.Catch <bool>(func));
            }
        }