public AddOperationCompleted(Models.User curUser, Models.OrderItemOperation op, Models.Part prt, RadanMaster.DAL.RadanMasterContext ctx) { InitializeComponent(); currentUser = curUser; part = prt; //dbContext = new RadanMaster.DAL.RadanMasterContext(); dbContext = ctx; dbContext.Parts.Load(); dbContext.Operations.Load(); dbContext.OrderItemOperations.Load(); dbContext.OperationPerformeds.Load(); dbContext.OrderItemOperationPerformeds.Load(); textEditUser.Text = currentUser.UserName; textEditItemName.Text = prt.FileName; textEditOperation.Text = op.operation.Name; List <Models.OrderItemOperation> assignableOps = new List <Models.OrderItemOperation>(); assignableOps = dbContext.OrderItemOperations.Where(o => o.operationID == op.operationID).ToList(); //assignableOps = dbContext.OrderItemOperations.ToList(); gridControlAssignableOps.DataSource = null; gridControlAssignableOps.DataSource = assignableOps; }
public AddItem(RadanMaster.DAL.RadanMasterContext ctx, string itemName) { InitializeComponent(); List <RadanMaster.Models.Order> activeOrders = ctx.Orders.Where(o => o.IsComplete == false).ToList(); itemNameTxtBox.Text = itemName; RadanInterface radanInterface = new RadanInterface(); char[] thumbnailCharArray = radanInterface.GetThumbnailDataFromSym(itemName); if (thumbnailCharArray != null) { byte[] thumbnailByteArray = Convert.FromBase64CharArray(thumbnailCharArray, 0, thumbnailCharArray.Length); Image x = (Bitmap)((new ImageConverter()).ConvertFrom(thumbnailByteArray)); pictureEditThumbnail.Image = x; } else { pictureEditThumbnail.Image = null; } txtBoxQty.Text = qty; comboBoxOrderNum.Text = lastOrderNumber; foreach (Order o in activeOrders) { if (o.OrderNumber != null && o.OrderNumber != "") { if (!comboBoxOrderNum.Items.Contains(o.OrderNumber)) { comboBoxOrderNum.Items.Add(o.OrderNumber); } } } comboBoxSchedName.Text = lastSchedName; foreach (Order o in activeOrders) { if (o.ScheduleName != null && o.ScheduleName != "") { if (!comboBoxSchedName.Items.Contains(o.ScheduleName)) { comboBoxSchedName.Items.Add(o.ScheduleName); } } } comboBoxBatchName.Text = lastBatchName; foreach (Order o in activeOrders) { if (o.BatchName != null && o.BatchName != "") { if (!comboBoxBatchName.Items.Contains(o.BatchName)) { comboBoxBatchName.Items.Add(o.BatchName); } } } }
public TestReport5() { dbContext = new DAL.RadanMasterContext(); InitializeComponent(); }