Exemplo n.º 1
0
        public Pdsa BuildFromRow(DataRow row)
        {
            var returnRecord = Pdsa.BuildPdsaFromRow(row);

            returnRecord = this.BuildExtraFromRow <Pdsa>(returnRecord, row);
            return(returnRecord);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Shared,Gap,Plan,Doing,Study")] Pdsa pdsa)
        {
            if (id != pdsa.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pdsa);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PdsaExists(pdsa.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pdsa));
        }
Exemplo n.º 3
0
        public Pdsa Insert(Pdsa record)
        {
            DataRow row = this.dataSet.ttblpdsa.NewttblpdsaRow();

            this.UpdateToRow(ref row, record);
            this.ExtraUpdateToRow(ref row, record);
            this.dataSet.ttblpdsa.AddttblpdsaRow((pdspdsaDataSet.ttblpdsaRow)row);
            this.SaveChanges();
            return(this.dataSet.ttblpdsa.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblpdsa.Rows[0]) : null);
        }
Exemplo n.º 4
0
        public Pdsa GetByRowId(string rowId, string fldList)
        {
            var  row  = this.GetRowByRowId(rowId, fldList);
            Pdsa pdsa = null;

            if (row != null)
            {
                pdsa = this.BuildFromRow(row);
            }
            return(pdsa);
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("Id,Name,Shared,Gap,Plan,Doing,Study")] Pdsa pdsa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pdsa);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(pdsa));
        }
Exemplo n.º 6
0
        protected Pdsa Fetch(string where, int batchsize, string fldList)
        {
            this.FetchWhere(where, batchsize, fldList);
            var  row  = this.dataSet.ttblpdsa.AsEnumerable().SingleOrDefault();
            Pdsa pdsa = null;

            if (row != null)
            {
                pdsa = this.BuildFromRow(row);
            }
            return(pdsa);
        }
Exemplo n.º 7
0
        public void Delete(Pdsa record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row == null)
            {
                row = this.dataSet.ttblpdsa.NewttblpdsaRow();
                Pdsa.BuildMinimalRow(ref row, record);
                this.dataSet.ttblpdsa.AddttblpdsaRow((pdspdsaDataSet.ttblpdsaRow)row);
            }
            row.Delete();
            this.SaveChanges();
        }
Exemplo n.º 8
0
        public Pdsa Update(Pdsa record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row != null)
            {
                this.UpdateToRow(ref row, record);
                this.ExtraUpdateToRow(ref row, record);
                this.SaveChanges();
                return(this.dataSet.ttblpdsa.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblpdsa.Rows[0]) : null);
            }
            ErrorReportingHelper.ReportErrors("global.update.doesnotexist", 421);
            return(null);
        }
Exemplo n.º 9
0
 public Pdsa Update(Pdsa record)
 {
     return(this.repository.Update(record));
 }
Exemplo n.º 10
0
 public Pdsa Insert(Pdsa record)
 {
     return(this.repository.Insert(record));
 }
Exemplo n.º 11
0
 public void Delete(Pdsa record)
 {
     this.repository.Delete(record);
 }
Exemplo n.º 12
0
 public void UpdateToRow(ref DataRow row, Pdsa record)
 {
     Pdsa.UpdateRowFromPdsa(ref row, record);
     this.ExtraUpdateToRow(ref row, record);
 }
Exemplo n.º 13
0
 public void Delete(Pdsa record)
 {
     this.adapter.Delete(record);
 }
Exemplo n.º 14
0
 public Pdsa Update(Pdsa record)
 {
     return(this.adapter.Update(record));
 }
Exemplo n.º 15
0
 public Pdsa Insert(Pdsa record)
 {
     return(this.adapter.Insert(record));
 }