Пример #1
0
 public static ReportEntity Create(ReportEntity report)
 {
     //Place your Business logic here
     report.id = report.id;
     return(report);
 }
Пример #2
0
        public IEnumerable <DomainEntity.ReportEntity> GetReport(DomainEntity.ReportEntity entity)
        {
            try
            {
                var reportList = new List <DomainEntity.ReportEntity>();

                string query = String.Empty;

                using (JDAContext)
                {
                    if (DBOPEN(Function.getConnectionString(entity.login_entity), JDAContext))
                    {
                        if (entity.pONumber != 0)
                        {
                            query = " AND b.ASAUTO in ('S','C') AND a.PONUMB = " + entity.pONumber + " ";
                        }
                        else
                        {
                            if (entity.storeNumber != 0 && entity.vendorCode == 0)
                            {
                                query = " AND b.ASAUTO in ('S','C') AND c.STRNUM = " + entity.storeNumber + " AND  d.POSDAT BETWEEN " + entity.receivingDate + " AND " + entity.cancelDate + "";
                            }

                            if (entity.storeNumber == 0 && entity.vendorCode != 0)
                            {
                                query = " AND b.ASAUTO in ('S','C') AND b.ASNUM = " + entity.vendorCode + " AND  d.POSDAT BETWEEN " + entity.receivingDate + " AND " + entity.cancelDate + "";
                            }

                            if (entity.storeNumber != 0 && entity.vendorCode != 0)
                            {
                                query = " AND b.ASAUTO in ('S','C') AND b.ASNUM = " + entity.vendorCode + " AND  C.STRNUM = " + entity.storeNumber + " AND  d.POSDAT BETWEEN " + entity.receivingDate + " AND " + entity.cancelDate + "";
                            }
                        }

                        string querystring = "SELECT "
                                             + "a.PONUMB, "
                                             + "a.POMRCV, "
                                             + "case when b.ASAUTO = 'C' then 'CROSS DOCK' else 'STOCK OPERATION' end as ASAUTO , "
                                             + "a.POLOC, "
                                             + "c.STRNAM, "
                                             + "a.POVNUM, "
                                             + "b.ASNAME, "
                                             + "d.POSDAT, "
                                             + "d.POCDAT, "
                                             + "f.IVPLTI, "
                                             + "f.IVPLHI, "
                                             + "case when b.ASAUTO = 'C' then 'X-DOCK' else 'STOCK OP' end as LOCATION, "
                                             + "e.INUMBR, "
                                             + "f.IDESCR, "
                                             + "g.IUPC, "
                                             + "e.POMUM, "
                                             + "e.POMQTY/e.POMPK as ORDERQTY "
                                             + "FROM " + entity.login_entity.dBname + ".POMRCH a "
                                             + "INNER JOIN " + entity.login_entity.dBname + ".APSUPP b ON a.POVNUM = b.ASNUM "
                                             + "INNER JOIN " + entity.login_entity.dBname + ".TBLSTR c ON a.POLOC = c.STRNUM "
                                             + "INNER JOIN " + entity.login_entity.dBname + ".POMHDR d ON a.PONUMB = d.PONUMB "
                                             + "INNER JOIN " + entity.login_entity.dBname + ".POMRCD e ON a.PONUMB = e.PONUMB "
                                             + "INNER JOIN " + entity.login_entity.dBname + ".INVMST f ON e.INUMBR = f.INUMBR "
                                             + "INNER JOIN " + entity.login_entity.dBname + ".INVUPC g ON e.INUMBR = g.INUMBR "
                                             + "WHERE a.POSTAT = '3' and d.POSTAT = '3'" + query;

                        var JDACommand = new OdbcCommand(querystring, JDAContext);
                        JDACommand.CommandTimeout = 0;
                        var JDAReader = JDACommand.ExecuteReader();

                        while (JDAReader.Read())
                        {
                            var reportDetails = new DomainEntity.ReportEntity();
                            reportDetails.pONumber      = JDAReader.GetInt32(JDAReader.GetOrdinal("PONUMB"));
                            reportDetails.rANumber      = JDAReader.GetInt32(JDAReader.GetOrdinal("POMRCV"));
                            reportDetails.aSAuto        = JDAReader.GetString(JDAReader.GetOrdinal("ASAUTO"));
                            reportDetails.storeNumber   = JDAReader.GetInt32(JDAReader.GetOrdinal("POLOC"));
                            reportDetails.storeName     = JDAReader.GetString(JDAReader.GetOrdinal("STRNAM"));
                            reportDetails.vendorCode    = JDAReader.GetInt32(JDAReader.GetOrdinal("POVNUM"));
                            reportDetails.vendorName    = JDAReader.GetString(JDAReader.GetOrdinal("ASNAME"));
                            reportDetails.receivingDate = JDAReader.GetString(JDAReader.GetOrdinal("POSDAT"));
                            reportDetails.cancelDate    = JDAReader.GetString(JDAReader.GetOrdinal("POCDAT"));
                            reportDetails.ti            = JDAReader.GetInt32(JDAReader.GetOrdinal("IVPLTI"));
                            reportDetails.hi            = JDAReader.GetInt32(JDAReader.GetOrdinal("IVPLHI"));
                            reportDetails.Location      = JDAReader.GetString(JDAReader.GetOrdinal("LOCATION"));
                            reportDetails.iNumber       = JDAReader.GetInt32(JDAReader.GetOrdinal("INUMBR"));
                            reportDetails.iDecription   = JDAReader.GetString(JDAReader.GetOrdinal("IDESCR"));
                            reportDetails.upc           = JDAReader.GetString(JDAReader.GetOrdinal("IUPC"));
                            reportDetails.um            = JDAReader.GetString(JDAReader.GetOrdinal("POMUM"));
                            reportDetails.orderQty      = JDAReader.GetInt32(JDAReader.GetOrdinal("ORDERQTY"));
                            reportList.Add(reportDetails);
                        }

                        JDAReader.Close();
                        JDACommand.Dispose();
                    }
                }

                return(reportList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                JDAContext.Close();
            }
        }
Пример #3
0
 public void Add(DomainEntity.ReportEntity entity)
 {
     _rALDbContext.ReportTables.Add(_mapper.Map <DomainEntity.ReportEntity, LoginData.ReportTable>(entity));
 }
Пример #4
0
 public void Update(DomainEntity.ReportEntity entity)
 {
     throw new NotImplementedException();
 }