예제 #1
0
 public EntityFullData(DictProp props, EntityState state, EntityMove mv, EntityReport report)
 {
     this.props  = props;
     this.state  = state;
     this.mv     = mv;
     this.report = report;
 }
예제 #2
0
        public System.Collections.Generic.List <byte> __encode()
        {
            var data = new System.Collections.Generic.List <byte>();

            if (this.props == null)
            {
                this.props = new DictProp();
            }
            data.AddRange(this.props.__encode());
            if (this.state == null)
            {
                this.state = new EntityState();
            }
            data.AddRange(this.state.__encode());
            if (this.mv == null)
            {
                this.mv = new EntityMove();
            }
            data.AddRange(this.mv.__encode());
            if (this.report == null)
            {
                this.report = new EntityReport();
            }
            data.AddRange(this.report.__encode());
            return(data);
        }
예제 #3
0
 public EntityFullData()
 {
     props  = new DictProp();
     state  = new EntityState();
     mv     = new EntityMove();
     report = new EntityReport();
 }
        internal EntityReport ToNewEntityReport(EntityReportDTO message)
        {
            var result = new EntityReport();

            result.SecurityObject      = new SecurityObject();
            result.SecurityObject.Type = (int)DatabaseObjectCategory.Report;
            result.TableDrivedEntityID = message.TableDrivedEntityID;
            result.ReportType          = (Int16)message.ReportType;
            result.Title = message.ReportTitle;

            return(result);
        }
예제 #5
0
 public int __decode(byte[] binData, ref int pos)
 {
     this.props = new DictProp();
     this.props.__decode(binData, ref pos);
     this.state = new EntityState();
     this.state.__decode(binData, ref pos);
     this.mv = new EntityMove();
     this.mv.__decode(binData, ref pos);
     this.report = new EntityReport();
     this.report.__decode(binData, ref pos);
     return(pos);
 }
        //private EntityReportDTO ToEntityReportDTO(EntityReport item)
        //{
        //    EntityReportDTO result = new EntityReportDTO();
        //    result.TableDrivedEntityID = item.TableDrivedEntityID;
        //    result.ID = item.ID;
        //    result.ReportType = (ReportType)item.ReportType;
        //    result.ReportTitle = item.Title;

        //        return result;
        //}

        internal void ToEntityReportDTO(EntityReport entityReport, EntityReportDTO entityReportDTO, bool withDetails)
        {
            entityReportDTO.ID                  = entityReport.ID;
            entityReportDTO.ReportType          = (ReportType)entityReport.ReportType;
            entityReportDTO.TableDrivedEntityID = entityReport.TableDrivedEntityID;
            entityReportDTO.ReportTitle         = entityReport.Title;
            if (entityReport.EntitySearchableReport != null)
            {
                entityReportDTO.SearchableReportType = (SearchableReportType)entityReport.EntitySearchableReport.SearchableReportType;
                if (withDetails == true)
                {
                    if (entityReport.EntitySearchableReport.SearchRepository != null)
                    {
                        entityReportDTO.SearchRepository = new BizSearchRepository().ToSearchRepositoryDTO(entityReport.EntitySearchableReport.SearchRepository);
                    }
                }
            }
            if (entityReport.EntityDataItemReport != null)
            {
                entityReportDTO.DataItemReportType = (DataItemReportType)entityReport.EntityDataItemReport.DataItemReportType;
            }
        }
        internal bool DataIsAccessable(DR_Requester requester, EntityReport entityReport)
        {
            //if (!entity.IsEnabled)
            //    return false;
            //else
            //{

            if (!bizTableDrivedEntity.DataIsAccessable(requester, entityReport.TableDrivedEntity))
            {
                return(false);
            }
            var permission = securityHelper.GetAssignedPermissions(requester, entityReport.ID, false);

            if (permission.GrantedActions.Any(y => y == SecurityAction.NoAccess))
            {
                return(false);
            }
            else
            {
                return(true);
            }
            //}
        }
예제 #8
0
        public override void ReportOut(object entity)
        {
            string      _msg = "";
            ExWebClient wc   = null;

            try
            {
                if (entity != null)
                {
                    EntityReport _entity = (EntityReport)entity;

                    // 失敗
                    if (_entity._message != "" || _entity._ret == false)
                    {
                        reportView.Close();
                        if (this.utlParentFKey != null)
                        {
                            this.utlParentFKey.IsEnabled = true;
                        }
                        return;
                    }

                    switch (this.rptKbn)
                    {
                    case DataReport.geReportKbn.OutPut:
                        //ExHyperlinkButton link = new ExHyperlinkButton(_entity._downLoadUrl);
                        //link.ClickMe();
                        reportView.reportUrl      = _entity._downLoadUrl;
                        reportView.reportFileName = _entity._downLoadFileName;
                        reportView.reportFilePath = _entity._downLoadFilePath;
                        reportView.ViewReport();
                        break;

                    case DataReport.geReportKbn.Download:
                    case DataReport.geReportKbn.Csv:
                        string[] prm = new string[4];
                        prm[0]           = _entity._downLoadFileName;
                        prm[1]           = _entity._downLoadFilePath;
                        wc               = new ExWebClient();
                        wc.utlParentFKey = this.utlParentFKey;
                        webService.ProcessingDlgClose();
                        wc.FileDownLoad(this.rptKbn, pgId, prm);
                        break;
                    }

                    #region 印刷発行済セット

                    switch (pgId)
                    {
                    case DataPgEvidence.PGName.Estimate.EstimatePrint:
                        if (this.updPrintNo != null)
                        {
                            string   _no = (string)this.updPrintNo;
                            object[] prm = new object[2];
                            prm[0] = (int)Common.geUpdateType.Update;
                            prm[1] = _no;
                            webService.objPerent = this;
                            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateEstimatePrint,
                                                      ExWebService.geDialogDisplayFlg.No,
                                                      ExWebService.geDialogCloseFlg.No,
                                                      prm);
                        }
                        break;

                    case DataPgEvidence.PGName.Order.OrderPrint:
                        if (this.updPrintNo != null)
                        {
                            string   _no = (string)this.updPrintNo;
                            object[] prm = new object[2];
                            prm[0] = (int)Common.geUpdateType.Update;
                            prm[1] = _no;
                            webService.objPerent = this;
                            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateOrderPrint,
                                                      ExWebService.geDialogDisplayFlg.No,
                                                      ExWebService.geDialogCloseFlg.No,
                                                      prm);
                        }
                        break;

                    case DataPgEvidence.PGName.Sales.SalesPrint:
                        if (this.updPrintNo != null)
                        {
                            string   _no = (string)this.updPrintNo;
                            object[] prm = new object[2];
                            prm[0] = (int)Common.geUpdateType.Update;
                            prm[1] = _no;
                            webService.objPerent = this;
                            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateSalesPrint,
                                                      ExWebService.geDialogDisplayFlg.No,
                                                      ExWebService.geDialogCloseFlg.No,
                                                      prm);
                        }
                        break;

                    case DataPgEvidence.PGName.Invoice.InvoicePrint:
                        if (this.updPrintNo != null)
                        {
                            ObservableCollection <EntityInvoiceClose> lstPrm = (ObservableCollection <EntityInvoiceClose>) this.updPrintNo;
                            object[] prm = new object[2];
                            prm[0] = (int)Common.geUpdateType.Update;
                            prm[1] = lstPrm;
                            webService.objPerent = this;
                            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateInvoicePrint,
                                                      ExWebService.geDialogDisplayFlg.No,
                                                      ExWebService.geDialogCloseFlg.No,
                                                      prm);
                        }
                        break;

                    case DataPgEvidence.PGName.PurchaseOrder.PurchaseOrderPrint:
                        if (this.updPrintNo != null)
                        {
                            string   _no = (string)this.updPrintNo;
                            object[] prm = new object[2];
                            prm[0] = (int)Common.geUpdateType.Update;
                            prm[1] = _no;
                            webService.objPerent = this;
                            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdatePurchaseOrderPrint,
                                                      ExWebService.geDialogDisplayFlg.No,
                                                      ExWebService.geDialogCloseFlg.No,
                                                      prm);
                        }
                        break;

                    case DataPgEvidence.PGName.Payment.PaymentPrint:
                        if (this.updPrintNo != null)
                        {
                            ObservableCollection <EntityPaymentClose> lstPrm = (ObservableCollection <EntityPaymentClose>) this.updPrintNo;
                            object[] prm = new object[2];
                            prm[0] = (int)Common.geUpdateType.Update;
                            prm[1] = lstPrm;
                            webService.objPerent = this;
                            webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdatePaymentPrint,
                                                      ExWebService.geDialogDisplayFlg.No,
                                                      ExWebService.geDialogCloseFlg.No,
                                                      prm);
                        }
                        break;
                    }

                    #endregion
                }
                else
                {
                    // 失敗
                    switch (this.rptKbn)
                    {
                    case DataReport.geReportKbn.OutPut:
                        _msg = "レポート出力";
                        break;

                    case DataReport.geReportKbn.Download:
                        _msg = "レポートダウンロード";
                        break;

                    case DataReport.geReportKbn.Csv:
                        _msg = "CSVダウンロード";
                        break;
                    }
                    if (_msg != "")
                    {
                        ExMessageBox.Show(_msg + "で予期せぬエラーが発生しました。");
                    }
                    if (this.utlParentFKey != null)
                    {
                        this.utlParentFKey.IsEnabled = true;
                    }
                    return;
                }
            }
            catch
            {
                webService.ProcessingDlgClose();
                if (this.utlParentFKey != null)
                {
                    this.utlParentFKey.IsEnabled = true;
                }
            }
        }
 internal void ToUpdateEntityReport(EntityReport entityReport, EntityReportDTO message)
 {
     entityReport.Title = message.ReportTitle;
 }
        private void ReportOutCompleted(Object sender, ReportOutCompletedEventArgs e)
        {
            try
            {
                objReport = e.Result;
                if (DialogCloseFlg == geDialogCloseFlg.Yes & win != null)
                {
                    win.Close();
                    win = null;
                }

                if (objReport != null)
                {
                    if (objReport._message != "" && objReport._message != null)
                    {
                        // 失敗
                        ExMessageBox.Show(objReport._message);
                        objPerent.ReportOut((object)objReport);
                    }
                    else
                    {
                        // 成功
                        objPerent.ReportOut((object)objReport);
                    }
                }
                else
                {
                    objPerent.ReportOut(null);
                }

            }
            catch (Exception ex)
            {
                this.ProcessingDlgClose();
                ExMessageBox.Show(CLASS_NM + ".ReportOutCompleted" + Environment.NewLine + ex.ToString(), "エラー確認");
            }
            finally
            {
                if (DialogCloseFlg == geDialogCloseFlg.Yes & win != null)
                {
                    win.Close();
                    win = null;
                }
            }
        }
 private void ReportOut(string rptKbn, string pgId, string parameters)
 {
     try
     {
         objReport = null;   // 初期化
         svcReportClient svc = new svcReportClient();
         svc.ReportOutCompleted += new EventHandler<ReportOutCompletedEventArgs>(this.ReportOutCompleted);
         svc.ReportOutAsync(Common.gstrSessionString, rptKbn, pgId, parameters);
     }
     catch (Exception ex)
     {
         this.ProcessingDlgClose();
         ExMessageBox.Show(CLASS_NM + ".ReportOut" + Environment.NewLine + ex.ToString(), "エラー確認");
     }
 }
예제 #12
0
        public EntityReport ReportOut(string random, string rptKbn, string pgId, string parameters)
        {
            EntityReport        entity;
            EntityReportSetting entitySetting;

            #region 認証処理

            string companyId           = "";
            string groupId             = "";
            string userId              = "";
            string ipAdress            = "";
            string sessionString       = "";
            int    reportSizeUser      = 0;
            int    idFigureCommodity   = 0;
            int    idFigureCustomer    = 0;
            int    idFigurePurchase    = 0;
            int    idFigureSlipNo      = 0;
            int    rpTotalAuthorityKbn = 0;

            try
            {
                companyId           = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]);
                groupId             = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]);
                userId              = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]);
                ipAdress            = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]);
                sessionString       = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]);
                reportSizeUser      = ExCast.zCInt(HttpContext.Current.Session[ExSession.REPORT_SAVE_SIZE_USER]);
                idFigureCommodity   = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_GOODS]);
                idFigureCustomer    = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_CUSTOMER]);
                idFigurePurchase    = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_PURCHASE]);
                idFigureSlipNo      = ExCast.zCInt(HttpContext.Current.Session[ExSession.ID_FIGURE_SLIP_NO]);
                rpTotalAuthorityKbn = ExCast.zCInt(HttpContext.Current.Session[ExSession.REPORT_TOTAL_AUTHORITY_KBN]);

                string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]));
                if (_message != "")
                {
                    entity         = new EntityReport();
                    entity.MESSAGE = _message;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".ReportOut(認証処理)", ex);
                entity         = new EntityReport();
                entity.MESSAGE = CLASS_NM + ".ReportOut : 認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();
                return(entity);
            }

            #endregion

            ExMySQLData db = ExSession.GetSessionDb(ExCast.zCInt(userId), sessionString);

            try
            {
                #region Get Report Setting

                entitySetting = GetReportSetting(random, pgId);

                if (entitySetting == null)
                {
                    entitySetting               = new EntityReportSetting();
                    entitySetting.user_id       = ExCast.zCInt(userId);
                    entitySetting.pg_id         = pgId;
                    entitySetting.group_id_from = ExCast.zCInt(groupId).ToString();
                    entitySetting.group_id_to   = ExCast.zCInt(groupId).ToString();
                }
                else if (entitySetting != null)
                {
                    if (!string.IsNullOrEmpty(entitySetting.MESSAGE))
                    {
                        entitySetting               = new EntityReportSetting();
                        entitySetting.user_id       = ExCast.zCInt(userId);
                        entitySetting.pg_id         = pgId;
                        entitySetting.group_id_from = ExCast.zCInt(groupId).ToString();
                        entitySetting.group_id_to   = ExCast.zCInt(groupId).ToString();
                    }
                    else
                    {
                        if (ExCast.zCInt(entitySetting.group_id_from) == 0 && ExCast.zCInt(entitySetting.group_id_to) == 0)
                        {
                            entitySetting.group_id_from = ExCast.zCInt(groupId).ToString();
                            entitySetting.group_id_to   = ExCast.zCInt(groupId).ToString();
                        }
                    }
                }

                if (rpTotalAuthorityKbn < 2)
                {
                    entitySetting.group_id_from = ExCast.zCInt(groupId).ToString();
                    entitySetting.group_id_to   = ExCast.zCInt(groupId).ToString();
                }

                #endregion

                entity = new EntityReport();

                DataReport.geReportKbn kbn    = (DataReport.geReportKbn)ExCast.zCInt(rptKbn);
                ExReportManeger        rptMgr = new ExReportManeger();
                rptMgr.idFigureCommodity = idFigureCommodity;
                rptMgr.idFigureCustomer  = idFigureCustomer;
                rptMgr.idFigurePurchase  = idFigurePurchase;
                rptMgr.idFigureSlipNo    = idFigureSlipNo;
                rptMgr.entitySetting     = entitySetting;
                rptMgr.rptKbn            = kbn;

                #region Report FilePath Setting

                bool _ret = rptMgr.GetReportFilePath(pgId, companyId, userId);
                if (_ret == false)
                {
                    entity.MESSAGE = CommonUtl.gstrErrMsg;
                    return(entity);
                }
                entity.downLoadFilePath = rptMgr.reportFilePath;
                entity.downLoadFileName = rptMgr.reportFileName;
                entity.downLoadFileSize = rptMgr.reportFileSize.ToString();
                entity.downLoadUrl      = CommonUtl.gstrMainUrl + rptMgr.reportDir;

                #endregion

                DataSet ds = db.GetDataSet(rptMgr.ReportSQL(pgId, companyId, groupId, parameters), rptMgr.GetPGIDXsd(pgId));

                #region Export xsd

                System.IO.StreamWriter xmlSW = null;
                try
                {
                    xmlSW = new System.IO.StreamWriter(CommonUtl.gstrReportTemp + rptMgr.GetPGIDXsd(pgId) + ".xsd");
                    ds.WriteXmlSchema(xmlSW);
                    xmlSW.Close();
                }
                catch (Exception ex)
                {
                    CommonUtl.ExLogger.Error(CLASS_NM + ".WriteXmlSchema", ex);
                }
                finally
                {
                    if (xmlSW != null)
                    {
                        xmlSW.Dispose();
                        xmlSW = null;
                    }
                }

                #endregion

                if (ds.Tables[0].Rows.Count == 0)
                {
                    entity.MESSAGE = "データが存在しません。";
                    entity.ret     = false;
                    return(entity);
                }

                string _fileType     = "";
                string _DownloadType = "";
                switch (kbn)
                {
                case DataReport.geReportKbn.OutPut:
                    _fileType     = "PDF";
                    _DownloadType = "出力";

                    if (rptMgr.ReportToPdf(ds, pgId) == true)
                    {
                        entity.ret = true;
                    }
                    else
                    {
                        entity.MESSAGE = CommonUtl.gstrErrMsg;
                        entity.ret     = false;
                    }
                    break;

                case DataReport.geReportKbn.Download:
                    _fileType     = "PDF";
                    _DownloadType = "ダウンロード";

                    if (rptMgr.ReportToPdf(ds, pgId) == true)
                    {
                        entity.ret = true;
                    }
                    else
                    {
                        entity.MESSAGE = CommonUtl.gstrErrMsg;
                        entity.ret     = false;
                    }
                    break;

                case DataReport.geReportKbn.Csv:
                    _fileType     = "CSV";
                    _DownloadType = "ダウンロード";

                    if (rptMgr.DataTableToCsv(ds.Tables[0]) == true)
                    {
                        entity.ret = true;
                    }
                    else
                    {
                        entity.MESSAGE = CommonUtl.gstrErrMsg;
                        entity.ret     = false;
                    }
                    break;

                default:
                    break;
                }

                //entity.downLoadFilePath = @"d:\HostingSpaces\Users\EW20121725\Sales.system-innovation.net\wwwroot\temp\顧客マスタ一覧.csv";
                //System.IO.FileInfo fi = new System.IO.FileInfo(entity.downLoadFilePath);
                //entity.downLoadFileSize = fi.Length.ToString();
                if (reportSizeUser < ExCast.zCDbl(entity.downLoadFileSize) / 1000000)
                {
                    entity.MESSAGE = _fileType + "ファイルのサイズが" + reportSizeUser.ToString() + "Mバイトを超える為、" + _DownloadType + "できません。";
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".ReportOut", ex);
                entity         = new EntityReport();
                entity.MESSAGE = CLASS_NM + ".ReportOut : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message.ToString();
                return(entity);
            }

            return(entity);
        }
예제 #13
0
        private DataValidationReport ValidateStringValues(HttpResponseMessage httpRequest, JsonSchema4 schema, IEnumerable <ExpandoObject> jsonData, HashSet <string> requiredProperties, IDictionary <string, DataDescriptor> modelDescriptors)
        {
            var totalProperties        = 0;
            var totalEntities          = 0;
            var entityReportCollection = new EntityReportCollection();

            foreach (var dataItem in jsonData)
            {
                var entityErrors = new EntityReport(dataItem);
                //var entityWarnings = new EntityWarning(dataItem);

                //	Sets Errors for missing properties in json data
                var missingProperties = HasRequiredProperties(requiredProperties, dataItem);
                if (missingProperties.Any())
                {
                    entityErrors.Properties.AddRange(missingProperties);
                }

                //	Sets Errors for invalid data types in values
                foreach (var property in dataItem)
                {
                    totalProperties++;

                    if (modelDescriptors.ContainsKey(property.Key))
                    {
                        var DataDescriptor = modelDescriptors[property.Key];
                        var isTypeMatch    = false;
                        try
                        {
                            if (!DataDescriptor.IsNullable || property.Value != null)
                            {
                                isTypeMatch = TryDataConversion(DataDescriptor, property.Value);
                            }

                            //	Valid if property is nullable and value is null
                            if (DataDescriptor.IsNullable && property.Value == null)
                            {
                                continue;
                            }

                            //	Add to Errors if conversion fails
                            if (!isTypeMatch)
                            {
                                entityErrors.Properties.Add(new PropertyError(property.Key, property.Value.ToString(), DataDescriptor.DataType));
                            }
                        }
                        catch (InvalidCastException)
                        {
                            entityErrors.Properties.Add(new PropertyError(property.Key, property.Value.ToString(), DataDescriptor.DataType));
                        }
                        catch (NullReferenceException)
                        {
                            entityErrors.Properties.Add(new PropertyError(property.Key, "NULL", DataDescriptor.DataType));
                        }
                    }
                    else
                    {
                        var value = property.Value == null ? null : property.Value.ToString();
                        entityErrors.Properties.Add(new UnknownProperty(property.Key, value));
                    }
                }

                //	Add to validation results if there are errors
                if (entityErrors.HasItems)
                {
                    entityReportCollection.Add(entityErrors);
                }

                totalEntities++;
            }

            //	TODO: Rethink this
            var dataValidationReport = new DataValidationReport(httpRequest, schema, totalEntities, totalProperties);;

            dataValidationReport.EntityReports = entityReportCollection;

            return(dataValidationReport);
        }