/// <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); } }
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); }
internal static LabelInfo FetchLabelInfo(Data.Label data) { var result = new LabelInfo(); result.Fetch(data); return(result); }
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); }
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); }
private BlockUIContainer AddLabel(Label label) { BlockUIContainer container = null; if (isSimple) { container = GetSimpleLabel(label); } else { container = GetSatinLabel(label); } return(container); }
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); } }
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); }
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(); } }
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(); } }
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); } }
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(); } }
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 }); }
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); }
public void Delete(Data.Label label) { Data.Label labelDelete = GetCartonLabelById(label.ID); _context.Labels.Remove(labelDelete); SaveChanges(); }
/// <summary> /// Add /// </summary> /// <param name="label"></param> public void Add(Data.Label label) { _context.Labels.Add(label); SaveChanges(); }
protected void Update(Data.Label data) { if (this.IsSelfDirty) { } }
protected void Update(Data.Label data, Task parent) { if (this.IsSelfDirty) { } }
private void Child_Fetch(Data.Label data) { this.Fetch(data); this.BusinessRules.CheckRules(); }
internal static TaskLabel FetchTaskLabel(Data.Label data) { return(Csla.DataPortal.FetchChild <TaskLabel>(data)); }