Ejemplo n.º 1
0
 public void ClearData()
 {
     CurrentObject = new GovernmentReport();
     //  this.ucOfferCommissionEntityProp1.ClearData();
     ucViewGovReportPic1.ClearData();
     ucWordDocEntityProp1.ClearData();
     tabControl1.SelectedTab = tpPictures;
 }
Ejemplo n.º 2
0
 public void ClearData()
 {
     try
     {
         BindingSource.Position = 0;
         CurrentObject          = new GovernmentReport();
         ClearAll();
     }
     catch
     { }
 }
Ejemplo n.º 3
0
        public void FillObject(GovernmentReport gRep)
        {
            if (CurrentObject == gRep)
            {
                return;
            }
            //if (!SCUtility.CheckIsChangedObject(CurrentObject , gRep))
            //    return;

            ClearData();

            if (gRep == null)
            {
                gRep = new GovernmentReport();
            }

            ReadOnly = true;

            ucViewGovReportPic1.FillObject(gRep, false);

            CurrentObject = gRep;
        }
Ejemplo n.º 4
0
        public void FillObject(GovernmentReport gRep, bool isRefresh)
        {
            //if (!SCUtility.CheckIsChangedObject(CurrentObject, gRep))
            //    return;



            ClearData();


            CurrentObject = gRep;
            if (gRep.Pictures != null && gRep.Pictures.Count > 0)
            {
                if (gRep.Pictures.Count == 1)
                {
                    ThumbnailsView          = false;
                    AllowViewContinusePages = false;
                    // ImageViewer.ViewContinusePages = false;
                }
                else
                {
                    //   ThumbnailsView = true;
                    AllowViewContinusePages = true;



                    try
                    {
                        PropertyDescriptorCollection properties
                            = TypeDescriptor.GetProperties(typeof(GovernmentReportPicture));
                        PropertyDescriptor propertyDesc = properties.Find("OrderInDocument", true);
                        PropertyComparer <GovernmentReportPicture> pc = new PropertyComparer <GovernmentReportPicture>(propertyDesc, ListSortDirection.Ascending);
                        gRep.Pictures.Sort(pc);
                    }
                    catch
                    {
                    }
                }


                var imgs = new ImageDocument[gRep.Pictures.Count];
                int i    = 0;

                try
                {
                    foreach (var letPic in gRep.Pictures)
                    {
                        var img = new ImageDocument();

                        img.OrderInDocument = letPic.OrderInDocument;
                        img.ID              = letPic.ID;
                        img.layers          = letPic.layers;
                        img.Stream          = letPic.Stream;
                        img.Tag             = letPic.Tag;
                        img.OrderInDocument = letPic.OrderInDocument;
                        img.Title           = letPic.Title;
                        img.GUid            = letPic.GUid;
                        if (letPic.ThumbnailStream != null && letPic.ThumbnailStream.Length > 10)
                        {
                            img.ThumbnailStream = letPic.ThumbnailStream;
                        }


                        imgs[i] = img;

                        i++;
                    }


                    AddImageRange(imgs);

                    if (AllowViewContinusePages)
                    {
                        ImageViewer.ViewContinusePages = AllowViewContinusePages;
                    }
                    ImageViewer.FitToWidth();

                    //if (imgs.Length <= 1)
                    //{
                    //    ThumbnailsView = false;
                    //    tsbtnShowContinusPages.Checked = false;
                    //}
                    //else
                    //{
                    //    ThumbnailsView = true;
                    //    tsbtnShowContinusPages.Checked = true;

                    //}
                }
                catch
                {
                    throw;
                }
            }

            CurrentObject = gRep;



            ImageViewer.FitToWidth();
        }
Ejemplo n.º 5
0
 public GovernmentReport Save(GovernmentReport obj)
 {
     return(null);
 }