예제 #1
0
파일: FormInput.cs 프로젝트: imatary/work
        /// <summary>
        ///
        /// </summary>
        /// <param name="createdDate"></param>
        /// <param name="boxQuantity"></param>
        /// <param name="cno"></param>
        /// <param name="deliveryDate"></param>
        /// <param name="finalConsignee"></param>
        /// <param name="supplier"></param>
        /// <param name="grossWeight"></param>
        /// <param name="manufactureDate"></param>
        /// <param name="partNo"></param>
        /// <param name="poNo"></param>
        /// <param name="poQuantity"></param>
        private void InsertToDatabase(string createdDate, string boxQuantity, string cno, string deliveryDate, string finalConsignee, string supplier, string grossWeight, string manufactureDate, string partNo, string poNo, string poQuantity)
        {
            var label = new Data.Label()
            {
                CreatedDate     = createdDate,
                BoxQuantity     = boxQuantity,
                CNO             = cno,
                DeliveryDate    = deliveryDate,
                FinalConsignee  = finalConsignee,
                Supplier        = supplier,
                GrossWeight     = grossWeight,
                ManufactureDate = manufactureDate,
                PartNo          = partNo,
                PoNo            = poNo,
                POQuantity      = poQuantity,
            };

            try
            {
                _cartonLabelService.Add(label);
                ResetControls();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(string.Format("Lỗi {0}", ex.Message), "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        private View.Label GetLabel(Label label, double left, double top, double right, double bottom)
        {
            View.Label viewLabel = new View.Label
            {
                Margin = new Thickness(ConvertMmToPixel(left),
                                       ConvertMmToPixel(top),
                                       ConvertMmToPixel(right),
                                       ConvertMmToPixel(bottom))
            };

            viewLabel.Border.BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(label.Color.ColorHEX));

            viewLabel.FirstName.Text       = label.FirstName;
            viewLabel.FirstName.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(label.Color.ColorHEX));
            viewLabel.FirstName.FontFamily = new FontFamily(new Uri(label.Font.BaseURI), "./" + label.Font.Path);
            viewLabel.FirstName.FontSize   = label.Font.FontSize;

            viewLabel.LastName.Text       = label.LastName;
            viewLabel.LastName.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(label.Color.ColorHEX));
            viewLabel.LastName.FontFamily = new FontFamily(new Uri(label.Font.BaseURI), "./" + label.Font.Path);
            viewLabel.LastName.FontSize   = label.Font.FontSize;

            if (!string.IsNullOrEmpty(label.ImagePath))
            {
                viewLabel.Image.Source = new BitmapImage(new Uri(Environment.CurrentDirectory + "\\img\\" + label.ImagePath + ".png", UriKind.RelativeOrAbsolute));
            }

            return(viewLabel);
        }
예제 #3
0
        internal static LabelInfo FetchLabelInfo(Data.Label data)
        {
            var result = new LabelInfo();

            result.Fetch(data);
            return(result);
        }
예제 #4
0
 private void Fetch(Data.Label data)
 {
     this.LoadProperty(SourceIdProperty, data.SourceId);
     this.LoadProperty(SourceTypeProperty, data.SourceType);
     this.LoadProperty(NameProperty, data.Name);
     this.LoadProperty(CreatedByProperty, data.CreatedBy);
     this.LoadProperty(CreatedByNameProperty, data.CreatedByUser.Name);
     this.LoadProperty(CreatedDateProperty, data.CreatedDate);
 }
예제 #5
0
        protected void Insert(Data.Label data)
        {
            data.SourceId    = this.ReadProperty(SourceIdProperty);
            data.SourceType  = (int)this.ReadProperty(SourceTypeProperty);
            data.Name        = this.ReadProperty(NameProperty);
            data.CreatedBy   = ((BusinessIdentity)Csla.ApplicationContext.User.Identity).UserId;
            data.CreatedDate = DateTime.Now;

            this.Update(data);
        }
예제 #6
0
        private BlockUIContainer AddLabel(Label label)
        {
            BlockUIContainer container = null;

            if (isSimple)
            {
                container = GetSimpleLabel(label);
            }
            else
            {
                container = GetSatinLabel(label);
            }

            return(container);
        }
예제 #7
0
        protected override void DataPortal_Insert()
        {
            using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities>
                             .GetManager(Database.ApplicationConnection, false))
            {
                var data = new Data.Label();

                this.Insert(data);

                ctx.ObjectContext.AddToLabels(data);

                ctx.ObjectContext.SaveChanges();

                this.LoadProperty(CreatedByProperty, data.CreatedBy);
                this.LoadProperty(CreatedDateProperty, data.CreatedDate);
            }
        }
예제 #8
0
        private BlockUIContainer GetSimpleLabel(Label label)
        {
            WrapPanel wrapPanel = new WrapPanel
            {
                Margin = new Thickness(ConvertMmToPixel(5))
            };

            for (int i = 0; i < 55; i++)
            {
                View.Label viewLabel = GetLabel(label, 3.7, 0, 3.7, 2.4);

                wrapPanel.Children.Add(viewLabel);
            }
            BlockUIContainer container = new BlockUIContainer(wrapPanel);

            return(container);
        }
예제 #9
0
        protected override void DataPortal_DeleteSelf()
        {
            using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities>
                             .GetManager(Database.ApplicationConnection, false))
            {
                var data = new Data.Label
                {
                    SourceId   = this.ReadProperty(SourceIdProperty),
                    SourceType = (int)this.ReadProperty(SourceTypeProperty),
                    Name       = this.ReadProperty(NameProperty)
                };

                ctx.ObjectContext.Labels.DeleteObject(data);

                ctx.ObjectContext.SaveChanges();
            }
        }
예제 #10
0
        protected override void DataPortal_DeleteSelf()
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                        .GetManager(Database.ApplicationConnection, false))
            {
                var data = new Data.Label
                {
                    SourceId = this.ReadProperty(SourceIdProperty),
                    SourceType = (int)this.ReadProperty(SourceTypeProperty),
                    Name = this.ReadProperty(NameProperty)
                };

                ctx.ObjectContext.Labels.DeleteObject(data);

                ctx.ObjectContext.SaveChanges();
            }
        }
예제 #11
0
        protected override void DataPortal_Insert()
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                        .GetManager(Database.ApplicationConnection, false))
            {
                var data = new Data.Label();

                this.Insert(data);

                ctx.ObjectContext.AddToLabels(data);

                ctx.ObjectContext.SaveChanges();

                this.LoadProperty(CreatedByProperty, data.CreatedBy);
                this.LoadProperty(CreatedDateProperty, data.CreatedDate);
            }
        }
예제 #12
0
        protected void Child_Update(Task parent)
        {
            using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities>
                             .GetManager(Database.ApplicationConnection, false))
            {
                var data = new Data.Label
                {
                    SourceId   = parent.SourceId,
                    SourceType = (int)parent.SourceType,
                    Name       = this.ReadProperty(NameProperty)
                };

                ctx.ObjectContext.Labels.Attach(data);

                this.Update(data, parent);

                ctx.ObjectContext.SaveChanges();
            }
        }
예제 #13
0
 public static LabelList FromDataLabel(Data.Label label, Image labelThumbnail)
 {
     return(new LabelList
     {
         Id = label.RoadieId,
         Label = new DataToken
         {
             Text = label.Name,
             Value = label.RoadieId.ToString()
         },
         SortName = label.SortName,
         CreatedDate = label.CreatedDate,
         LastUpdated = label.LastUpdated,
         ArtistCount = label.ArtistCount,
         ReleaseCount = label.ReleaseCount,
         TrackCount = label.TrackCount,
         Thumbnail = labelThumbnail
     });
 }
예제 #14
0
        private BlockUIContainer GetSatinLabel(Label label)
        {
            StackPanel stackPanel = new StackPanel
            {
                Margin = new Thickness(ConvertMmToPixel(3), ConvertMmToPixel(7), ConvertMmToPixel(3), ConvertMmToPixel(6))
            };

            for (int i = 0; i < 9; i++)
            {
                WrapPanel wrapPanel = new WrapPanel
                {
                    Margin = new Thickness(0)
                };

                wrapPanel.Children.Add(GetLabel(label, 10, 2, 29.5, 1.5));
                wrapPanel.Children.Add(GetBorder(0.5, 20));
                wrapPanel.Children.Add(GetLabel(label, 29.5, 2, 29.5, 1.5));
                wrapPanel.Children.Add(GetBorder(0.5, 20));
                wrapPanel.Children.Add(GetLabel(label, 29.5, 2, 10, 1.5));

                stackPanel.Children.Add(wrapPanel);

                WrapPanel wrapPanel1 = new WrapPanel
                {
                    Margin = new Thickness(0)
                };

                wrapPanel1.Children.Add(GetBorder(4, 0.5, 0, 0, 42, 1.5));
                wrapPanel1.Children.Add(GetBorder(4, 0.5, 41.5, 0, 53, 1.5));
                wrapPanel1.Children.Add(GetBorder(4, 0.5, 52.5, 0, 42, 1.5));
                wrapPanel1.Children.Add(GetBorder(4, 0.5, 42, 0, 0, 1.5));

                stackPanel.Children.Add(wrapPanel1);
            }
            BlockUIContainer container = new BlockUIContainer(stackPanel);

            return(container);
        }
예제 #15
0
 public void Delete(Data.Label label)
 {
     Data.Label labelDelete = GetCartonLabelById(label.ID);
     _context.Labels.Remove(labelDelete);
     SaveChanges();
 }
예제 #16
0
 /// <summary>
 /// Add
 /// </summary>
 /// <param name="label"></param>
 public void Add(Data.Label label)
 {
     _context.Labels.Add(label);
     SaveChanges();
 }
예제 #17
0
 protected void Update(Data.Label data)
 {
     if (this.IsSelfDirty)
     {
     }
 }
예제 #18
0
파일: FormInput.cs 프로젝트: cuongpv88/work
 /// <summary>
 /// 
 /// </summary>
 /// <param name="createdDate"></param>
 /// <param name="boxQuantity"></param>
 /// <param name="cno"></param>
 /// <param name="deliveryDate"></param>
 /// <param name="finalConsignee"></param>
 /// <param name="supplier"></param>
 /// <param name="grossWeight"></param>
 /// <param name="manufactureDate"></param>
 /// <param name="partNo"></param>
 /// <param name="poNo"></param>
 /// <param name="poQuantity"></param>
 private void InsertToDatabase(string createdDate, string boxQuantity, string cno, string deliveryDate, string finalConsignee, string supplier, string grossWeight, string manufactureDate, string partNo, string poNo, string poQuantity)
 {
     var label = new Data.Label()
     {
         CreatedDate = createdDate,
         BoxQuantity = boxQuantity,
         CNO = cno,
         DeliveryDate = deliveryDate,
         FinalConsignee = finalConsignee,
         Supplier = supplier,
         GrossWeight = grossWeight,
         ManufactureDate = manufactureDate,
         PartNo = partNo,
         PoNo = poNo,
         POQuantity = poQuantity,
     };
     try
     {
         _cartonLabelService.Add(label);
         ResetControls();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(string.Format("Lỗi {0}", ex.Message), "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #19
0
 protected void Update(Data.Label data, Task parent)
 {
     if (this.IsSelfDirty)
     {
     }
 }
예제 #20
0
        private void Child_Fetch(Data.Label data)
        {
            this.Fetch(data);

            this.BusinessRules.CheckRules();
        }
예제 #21
0
 internal static TaskLabel FetchTaskLabel(Data.Label data)
 {
     return(Csla.DataPortal.FetchChild <TaskLabel>(data));
 }