Beispiel #1
0
        protected virtual void CopyFrom(ToolInfo source)
        {
            if (source == null)
            {
                return;
            }

            Oid         = source.Oid;
            Serial      = source.Serial;
            ID          = source.ID;
            Status      = source.Status;
            Name        = source.Name;
            Description = source.Description;
            From        = source.From;
            Till        = source.Till;
            Cost        = source.Cost;
            Comments    = source.Comments;
        }
        public static WorkReport GetByResource(long oidResource, ETipoEntidad entityType, bool childs = true)
        {
            QueryConditions conditions = new QueryConditions();

            switch (entityType)
            {
            case moleQule.Common.Structs.ETipoEntidad.Empleado:
                conditions.Acreedor = ProviderBaseInfo.New(oidResource, ETipoAcreedor.Empleado);
                break;

            case moleQule.Common.Structs.ETipoEntidad.OutputDelivery:
                conditions.Add(oidResource, ETipoEntidad.OutputDelivery);
                break;

            case moleQule.Common.Structs.ETipoEntidad.Tool:
                conditions.Tool = ToolInfo.New(oidResource);
                break;
            }

            return(Get(SELECT(conditions, true), childs));
        }
        /*private static void FormatReport(ToolRpt 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 Tool

        public ToolRpt GetDetailReport(ToolInfo item)
        {
            if (item == null)
            {
                return(null);
            }

            ToolRpt doc = new ToolRpt();

            List <ToolPrint> pList = new List <ToolPrint>();

            pList.Add(ToolPrint.New(item));
            doc.SetDataSource(pList);
            doc.SetParameterValue("Empresa", Schema.Name);



            //FormatReport(doc, empresa.Logo);

            return(doc);
        }
Beispiel #4
0
 internal static string SELECT(long oid, bool lockTable)
 {
     return(SELECT(new QueryConditions {
         Tool = ToolInfo.New(oid)
     }, lockTable));
 }