Пример #1
0
        public static WorkReport CloneAsNew(WorkReportInfo source)
        {
            WorkReport clon = WorkReport.New();

            clon.CopyFrom(source);

            clon.GetNewCode();

            clon.MarkNew();

            if (source.Lines == null)
            {
                source.LoadChilds(typeof(WorkReportResources), false);
            }

            foreach (WorkReportResourceInfo item in source.Lines)
            {
                if (item.EEntityType != ETipoEntidad.OutputDelivery)
                {
                    clon.Lines.NewItem(clon, item);
                }
            }

            clon.Lines.MarkAsNew();

            return(clon);
        }
        protected void CopyValues(WorkReportInfo source)
        {
            if (source == null)
            {
                return;
            }

            _base.CopyValues(source);
        }
Пример #3
0
        protected virtual void CopyFrom(WorkReportInfo source)
        {
            if (source == null)
            {
                return;
            }

            OidOwner     = source.OidOwner;
            OidExpedient = source.OidExpedient;
            Serial       = source.Serial;
            Code         = source.Code;
        }
Пример #4
0
        public void CopyValues(WorkReportInfo source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);

            _expedient     = source.Expedient;
            _owner         = source.Owner;
            _category_name = source.CategoryName;
        }
        public static WorkReportResourceList GetChildList(WorkReportInfo parent, bool childs)
        {
            CriteriaEx criteria = WorkReportResource.GetCriteria(WorkReportResource.OpenSession());

            criteria.Query  = SELECT(parent);
            criteria.Childs = childs;

            WorkReportResourceList list = DataPortal.Fetch <WorkReportResourceList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Пример #6
0
        /*private static void FormatReport(WorkReportRpt rpt, string logo)
        {
            string path = Images.GetRootPath() + "\\" + Resources.Paths.LOGO_EMPRESAS + logo;

            if (File.Exists(path))
            {
                Image image = Image.FromFile(path);
                int width = rpt.Section1.ReportObjects["Logo"].Width;
                int height = rpt.Section1.ReportObjects["Logo"].Height;

                rpt.Section1.ReportObjects["Logo"].Width = 15 * image.Width;
                rpt.Section1.ReportObjects["Logo"].Height = 15 * image.Height;
                rpt.Section1.ReportObjects["Logo"].Left += (width - 15 * image.Width) / 2;
                rpt.Section1.ReportObjects["Logo"].Top += (height - 15 * image.Height) / 2;
            }
        }*/

        #endregion

        #region Business Methods

        public ReportClass GetDetailReport(WorkReportInfo item)
        {
            if (item == null) return null;
			
            WorkReportRpt doc = new WorkReportRpt();
            
            List<WorkReportPrint> pList = new List<WorkReportPrint>();

            pList.Add(WorkReportPrint.New(item));
            doc.SetDataSource(pList);		
			
			List<WorkReportResourcePrint> pLines = new List<WorkReportResourcePrint>();
            
			foreach (WorkReportResourceInfo child in item.Lines)
			{
                pLines.Add(WorkReportResourcePrint.New(child));
			}

            doc.Subreports["LinesSubRpt"].SetDataSource(pLines);

            return doc;
        }
Пример #7
0
 internal static string SELECT(long oid, bool lockTable)
 {
     return(SELECT(new QueryConditions {
         WorkReport = WorkReportInfo.New(oid)
     }, lockTable));
 }
 public static string SELECT(WorkReportInfo parent)
 {
     return(WorkReportResource.SELECT(new QueryConditions {
         WorkReport = parent
     }, false));
 }