예제 #1
0
        public Arss BuildFromRow(DataRow row)
        {
            var returnRecord = Arss.BuildArssFromRow(row);

            returnRecord = this.BuildExtraFromRow <Arss>(returnRecord, row);
            return(returnRecord);
        }
예제 #2
0
        public Arss Insert(Arss record)
        {
            DataRow row = this.dataSet.ttblarss.NewttblarssRow();

            this.UpdateToRow(ref row, record);
            this.ExtraUpdateToRow(ref row, record);
            this.dataSet.ttblarss.AddttblarssRow((pdsarssDataSet.ttblarssRow)row);
            this.SaveChanges();
            return(this.dataSet.ttblarss.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblarss.Rows[0]) : null);
        }
예제 #3
0
        public Arss GetByRowId(string rowId, string fldList)
        {
            var  row  = this.GetRowByRowId(rowId, fldList);
            Arss arss = null;

            if (row != null)
            {
                arss = this.BuildFromRow(row);
            }
            return(arss);
        }
예제 #4
0
        protected Arss Fetch(string where, int batchsize, string fldList)
        {
            this.FetchWhere(where, batchsize, fldList);
            var  row  = this.dataSet.ttblarss.AsEnumerable().SingleOrDefault();
            Arss arss = null;

            if (row != null)
            {
                arss = this.BuildFromRow(row);
            }
            return(arss);
        }
예제 #5
0
        private void DeleteUseRowID(Arss record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row == null)
            {
                row = this.dataSet.ttblarss.NewttblarssRow();
                Arss.BuildMinimalRow(ref row, record);
                this.dataSet.ttblarss.AddttblarssRow((pdsarssDataSet.ttblarssRow)row);
            }
            row.Delete();
            this.SaveChanges();
        }
예제 #6
0
        public Arss Update(Arss record)
        {
            var row = this.GetRowByRowpointer(record.rowpointer, string.Empty);

            if (row != null)
            {
                this.UpdateToRow(ref row, record);
                this.ExtraUpdateToRow(ref row, record);
                this.SaveChanges();
                return(this.dataSet.ttblarss.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblarss.Rows[0]) : null);
            }
            ErrorReportingHelper.ReportErrors("global.update.doesnotexist", 421);
            return(null);
        }
예제 #7
0
 public void Delete(Arss record)
 {
     this.adapter.Delete(record);
 }
예제 #8
0
 public Arss Update(Arss record)
 {
     return(this.adapter.Update(record));
 }
예제 #9
0
 public Arss Insert(Arss record)
 {
     return(this.adapter.Insert(record));
 }
예제 #10
0
        public AretLookupResponseAPI LookupInvoiceSequence(Aretlookupcriteria aretlookupcriteria)
        {
            var arsc   = new Arsc();
            var arsses = new List <Arss>();

            var sb = new StringBuilder();

            sb.AppendFormatWithEscape("aret.cono = {0}", this.aretRepository.Cono);
            sb.AppendFormatWithEscape(" AND aret.invno = {0}", aretlookupcriteria.invno);
            sb.AppendFormatWithEscape(" AND aret.invsuf = {0}", aretlookupcriteria.invsuf);
            sb.AppendFormatWithEscape(" AND aret.seqno >= {0}", aretlookupcriteria.seqno);
            sb.AppendFormatWithEscape(" AND aret.custno = {0}", aretlookupcriteria.custno);
            sb.AppendFormatWithEscape(" AND aret.statustype = {0}", aretlookupcriteria.statustype);
            sb.AppendFormatWithEscape(" AND aret.transcd = {0}", aretlookupcriteria.transcd);
            var where = sb.ToString();
            var resultFetchWhere = this.aretRepository.GetList(where, aretlookupcriteria.IsAutoComplete ? 10 : aretlookupcriteria.recordcountlimit, aretlookupcriteria.IsAutoComplete ? "seqno" : "seqno,amount,rowID,custno,invdt,invno,invsuf,jrnlno,notesfl,refer,shipto,statustype,transcd,notesfl").ToList();

            if (resultFetchWhere.Count > 0 && !aretlookupcriteria.IsAutoComplete)
            {
                arsc = this.arscRepository.Get(0, aretlookupcriteria.custno, false, 1, "custno,name,notefl") ?? new Arsc();
            }

            var results = new AretLookupResponseAPI();

            foreach (var fwResult in resultFetchWhere)
            {
                var result = new Aretlookupresults {
                    seqno = fwResult.seqno
                };

                if (!aretlookupcriteria.IsAutoComplete)
                {
                    var arss = arsses.FirstOrDefault(x => x.shipto == fwResult.shipto);
                    if (arss == null)
                    {
                        if (string.IsNullOrEmpty(fwResult.shipto))
                        {
                            arss = new Arss {
                                shipto = "", name = string.Empty
                            };
                        }
                        else
                        {
                            arss = this.arssRepository.Get(0, fwResult.custno, fwResult.shipto, 1, "shipto,name") ?? new Arss {
                                shipto = fwResult.shipto, name = string.Empty
                            };
                        }
                        arsses.Add(arss);
                    }

                    result.amount      = fwResult.amount;
                    result.aretRowid   = fwResult.rowID;
                    result.custno      = fwResult.custno;
                    result.invdt       = fwResult.invdt;
                    result.invno       = fwResult.invno;
                    result.invsuf      = fwResult.invsuf;
                    result.jrnlno      = fwResult.jrnlno;
                    result.notesfl     = fwResult.notesfl;
                    result.refer       = fwResult.refer;
                    result.shipto      = fwResult.shipto;
                    result.statustype  = fwResult.statustype;
                    result.transcd     = fwResult.transcd;
                    result.arscName    = arsc.name;
                    result.custnotesfl = arsc.notesfl;
                    result.arssName    = arss.name;
                }
                results.aretlookupresults.Add(result);
            }
            return(results);
        }
예제 #11
0
 public void UpdateToRow(ref DataRow row, Arss record)
 {
     Arss.UpdateRowFromArss(ref row, record);
     this.ExtraUpdateToRow(ref row, record);
 }
예제 #12
0
 public void Delete(Arss record)
 {
     this.repository.Delete(record);
 }
예제 #13
0
 public Arss Update(Arss record)
 {
     return(this.repository.Update(record));
 }
예제 #14
0
 public Arss Insert(Arss record)
 {
     return(this.repository.Insert(record));
 }