コード例 #1
0
 protected override void RowConverter(InvoiceGrpReport item, DataRow row)
 {
     item.FILE_TYPE      = row["FILE_TYPE"].ToString();
     item.INVOICE_GRP_ID = int.Parse(row["INVOICE_GRP_ID"].ToString());
     item.REPORT_TYPE_ID = int.Parse(row["REPORT_TYPE_ID"].ToString());
     item.TAB_ORDER      = int.Parse(row["TAB_ORDER"].ToString());
 }
コード例 #2
0
        public override InvoiceGrpReport GetByIds(int reportId, int groupId)
        {
            string sql = String.Format("select * from SPHRSBILLING.invoice_grp_report where INVOICE_GRP_ID={0} and REPORT_TYPE_ID={1}", reportId, groupId);

            DataTable dt = OracleHelper.ExecuteQuery(base.ConnectionString.Value, sql, null);

            if (dt.Rows.Count > 0)
            {
                InvoiceGrpReport igr = new InvoiceGrpReport();
                RowConverter(igr, dt.Rows[0]);
                return(igr);
            }
            return(null);
        }
コード例 #3
0
 public override void Remove(InvoiceGrpReport entity)
 {
     try
     {
         string sql = String.Format("DELETE FROM {0}.invoice_grp_report WHERE REPORT_TYPE_ID = :REPORT_TYPE_ID and INVOICE_GRP_ID = :INVOICE_GRP_ID", SchemaName);
         List <OracleParameter> parameters = new List <OracleParameter>();
         parameters.Add(OracleHelper.CreateParameter(":REPORT_TYPE_ID", entity.REPORT_TYPE_ID, OracleType.Int32, ParameterDirection.Input));
         parameters.Add(OracleHelper.CreateParameter(":INVOICE_GRP_ID", entity.INVOICE_GRP_ID, OracleType.Int32, ParameterDirection.Input));
         OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
     }
     catch (OracleException ex)
     {
         throw ex;
     }
 }
コード例 #4
0
        private void SaveInvoice()
        {
            CurrentGroupItem.ChangedBy = DB.OracleSession.UserName;
            CurrentGroupItem.ChangedOn = DateTime.Now;

            foreach (ReportType reportType in ReportTypes)
            {
                bool bExists = false;
                foreach (InvoiceGrpReport igr in IgReports)
                {
                    if (igr.REPORT_TYPE_ID == reportType.REPORT_TYPE_ID)
                    {
                        bExists = true;
                        // Did they DESELECT the invoiceGroup??
                        if (reportType.IsSelected == false)
                        {
                            this.InvoiceGrpReportsTarget.Remove(igr);
                            break;
                        }
                    }
                }
                // Add this invoiceGroup - it was not there previously
                if (bExists == false && reportType.IsSelected == true)
                {
                    InvoiceGrpReport igr = new InvoiceGrpReport();
                    igr.INVOICE_GRP_ID = CurrentGroupItem.InvoiceGrpId;
                    igr.REPORT_TYPE_ID = reportType.REPORT_TYPE_ID;

                    this.InvoiceGrpReportsTarget.Add(igr);
                }
            }


            if (CurrentGroupItem.InvoiceGrpId == 0)
            {
                DataTarget.Add(CurrentGroupItem);
            }
            else
            {
                DataTarget.Update(CurrentGroupItem);
            }
            CurrentGroupItem.Modified = false;
            GroupVM.EnablePicker      = true;
            RaisePropertyChanged("IsNotAddingNew");
        }
コード例 #5
0
 public override void Update(InvoiceGrpReport entity)
 {
     try
     {
         string sql = String.Format("update {0}.invoice_grp_report set "
                                    + "  TAB_ORDER = :TAB_ORDER "
                                    + "  FILE_TYPE = :FILE_TYPE "
                                    + "where REPORT_TYPE_ID = :REPORT_TYPE_ID and INVOICE_GRP_ID = :INVOICE_GRP_ID"
                                    , SchemaName);
         List <OracleParameter> parameters = new List <OracleParameter>();
         parameters.Add(OracleHelper.CreateParameter(":TAB_ORDER", entity.TAB_ORDER, OracleType.Int32, ParameterDirection.Input));
         parameters.Add(OracleHelper.CreateParameter(":FILE_TYPE", entity.FILE_TYPE, OracleType.Int32, ParameterDirection.Input));
         OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
     }
     catch (OracleException ex)
     {
         throw ex;
     }
 }
コード例 #6
0
        public override void Add(InvoiceGrpReport entity)
        {
            {
                // INVOICE_GRP_ID  NUMBER
                // REPORT_TYPE_ID  INTEGER
                // TAB_ORDER       INTEGER
                // FILE_TYPE       CHAR 4
                string sql = String.Format("insert into {0}.invoice_grp_report "
                                           + "  (INVOICE_GRP_ID"
                                           + "  ,REPORT_TYPE_ID"
                                           + "  ,TAB_ORDER"
                                           + "  ,FILE_TYPE) "
                                           + "values "
                                           + "  (:INVOICE_GRP_ID"
                                           + "  ,:REPORT_TYPE_ID"
                                           + "  ,:TAB_ORDER"
                                           + "  ,:FILE_TYPE)"
                                           , SchemaName);
                try
                {
                    List <OracleParameter> parameters = new List <OracleParameter>();
                    parameters.Add(OracleHelper.CreateParameter(":INVOICE_GRP_ID", entity.INVOICE_GRP_ID, OracleType.Number, ParameterDirection.Input));
                    parameters.Add(OracleHelper.CreateParameter(":REPORT_TYPE_ID", entity.REPORT_TYPE_ID, OracleType.Int32, ParameterDirection.Input));
                    parameters.Add(OracleHelper.CreateParameter(":TAB_ORDER", entity.TAB_ORDER, OracleType.Int32, ParameterDirection.Input));
                    parameters.Add(OracleHelper.CreateParameter(":FILE_TYPE", entity.FILE_TYPE, OracleType.NVarChar, ParameterDirection.Input));

                    OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value,
                                                                                       sql,
                                                                                       parameters.ToArray <OracleParameter>());
                }
                catch (OracleException ex)
                {
                    throw ex;
                }
            }
        }
コード例 #7
0
 public override InvoiceGrpReport Get(InvoiceGrpReport entity)
 {
     throw new NotImplementedException();
 }