示例#1
0
        public SeqControl BuildFromRow(DataRow row)
        {
            var returnRecord = SeqControl.BuildSeqControlFromRow(row);

            returnRecord = this.BuildExtraFromRow <SeqControl>(returnRecord, row);
            return(returnRecord);
        }
示例#2
0
        public SeqControl Insert(SeqControl record)
        {
            DataRow row = this.dataSet.ttblseq_control.Newttblseq_controlRow();

            this.UpdateToRow(ref row, record);
            this.ExtraUpdateToRow(ref row, record);
            this.dataSet.ttblseq_control.Addttblseq_controlRow((pdsseq_controlDataSet.ttblseq_controlRow)row);
            this.SaveChanges();
            return(this.dataSet.ttblseq_control.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblseq_control.Rows[0]) : null);
        }
示例#3
0
        public SeqControl GetByRowId(string rowId, string fldList)
        {
            var        row        = this.GetRowByRowId(rowId, fldList);
            SeqControl seqControl = null;

            if (row != null)
            {
                seqControl = this.BuildFromRow(row);
            }
            return(seqControl);
        }
示例#4
0
        protected SeqControl Fetch(string where, int batchsize, string fldList)
        {
            this.FetchWhere(where, batchsize, fldList);
            var        row        = this.dataSet.ttblseq_control.AsEnumerable().SingleOrDefault();
            SeqControl seqControl = null;

            if (row != null)
            {
                seqControl = this.BuildFromRow(row);
            }
            return(seqControl);
        }
示例#5
0
        public static int GetNextId(IronChurchContext dbContext, string table_name)
        {
            var nextId        = dbContext.SeqControl.Where(x => x.ObjName == table_name).FirstOrDefault().NextId + 1;
            var newSeqcontrol = new SeqControl()
            {
                ObjName = "table_name", NextId = nextId
            };

            dbContext.Entry(newSeqcontrol).Property(x => x.NextId).IsModified = true;
            dbContext.SaveChangesAsync();

            return(nextId);
        }
示例#6
0
        public void Delete(SeqControl record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row == null)
            {
                row = this.dataSet.ttblseq_control.Newttblseq_controlRow();
                SeqControl.BuildMinimalRow(ref row, record);
                this.dataSet.ttblseq_control.Addttblseq_controlRow((pdsseq_controlDataSet.ttblseq_controlRow)row);
            }
            row.Delete();
            this.SaveChanges();
        }
示例#7
0
        public SeqControl Update(SeqControl 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.ttblseq_control.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblseq_control.Rows[0]) : null);
            }
            ErrorReportingHelper.ReportErrors("global.update.doesnotexist", 421);
            return(null);
        }
示例#8
0
 public SeqControl Update(SeqControl record)
 {
     return(this.repository.Update(record));
 }
示例#9
0
 public SeqControl Insert(SeqControl record)
 {
     return(this.repository.Insert(record));
 }
示例#10
0
 public void Delete(SeqControl record)
 {
     this.repository.Delete(record);
 }
示例#11
0
 public void Delete(SeqControl record)
 {
     this.adapter.Delete(record);
 }
示例#12
0
 public SeqControl Update(SeqControl record)
 {
     return(this.adapter.Update(record));
 }
示例#13
0
 public SeqControl Insert(SeqControl record)
 {
     return(this.adapter.Insert(record));
 }
示例#14
0
 public void UpdateToRow(ref DataRow row, SeqControl record)
 {
     SeqControl.UpdateRowFromSeqControl(ref row, record);
     this.ExtraUpdateToRow(ref row, record);
 }