public ShopAddSubForm(ref InstaMarketDbContext dbContext, ref Shop shop, ref IInstaApi instaApi) { InitializeComponent(); this.instaApi = instaApi; this.dbContext = dbContext; this.shop = shop; }
public MainForm(ref IInstaApi InstaApi) { InitializeComponent(); instaApi = InstaApi; dbContext = new InstaMarketDbContext(); List <Model.Good> goods = dbContext.Goods.ToList(); List <Model.Dimension> dimensions = dbContext.Dimensions.ToList(); List <Model.Good_Dimension> good_Dimensions = dbContext.Good_Dimensions.ToList(); List <Model.Good_Dimension_Publication> good_Dimension_Publications = dbContext.Good_Dimension_Publications.ToList(); List <Model.Shop> shops = dbContext.Shops.ToList(); List <Model.Publication> publications = dbContext.Publications.ToList(); List <Model.Order> orders = dbContext.Orders.ToList(); List <Model.Order_Status> order_Statuses = dbContext.Order_Statuses.ToList(); List <Model.Receipt> receipts = dbContext.Receipts.ToList(); List <Model.Delivery> deliveries = dbContext.Deliveries.ToList(); List <Model.Publication_Image> publication_Images = dbContext.Publication_Images.ToList(); List <Model.Publication_Video> publication_Videos = dbContext.Publication_Videos.ToList(); List <Model.Chat> chats = dbContext.Chats.ToList(); List <Model.Chat_Status> chat_Statuses = dbContext.Chat_Statuses.ToList(); List <Model.User> users = dbContext.Users.ToList(); List <Model.Comment> comments = dbContext.Comments.ToList(); // Order panel var orderStatuses = dbContext.Order_Statuses.ToList(); orderStatuses.Add(new Model.Order_Status { Order_Status_Id = 0, Name = "All" }); orderPanelOrderStatusComboBox.DataSource = orderStatuses; orderPanelOrderStatusComboBox.SelectedItem = orderStatuses.First(os => os.Order_Status_Id == 0); // Publication panel publicationComboBox.SelectedIndex = 0; }
public PublicationSubForm(ref InstaMarketDbContext dbContext, ref Publication publication) { InitializeComponent(); this.dbContext = dbContext; this.publication = publication; if (publication.Publication_Images != null && publication.Publication_Images.Count > 0) { publicationPictureBox.ImageLocation = publication.Publication_Images[imageIndex].Path; } if (publication.Good_Dimension_Publications == null) { publication.Good_Dimension_Publications = new List <Good_Dimension_Publication>(); } if (publication.Publication_Videos == null) { publication.Publication_Videos = new List <Publication_Video>(); } if (publication.Publication_Images == null) { publication.Publication_Images = new List <Publication_Image>(); } publicationGoodDimensionsDataGridView.DataSource = new BindingList <Good_Dimension_Publication>(publication.Good_Dimension_Publications); publicationGoodDimensionsDataGridView.Columns["Publication"].Visible = false; if (publication.Publication_Videos != null) { foreach (Publication_Video video in publication.Publication_Videos) { videosRichTextBox.Text += video.Path + "\n"; } } }
public Good_DimensionAddSubForm(ref InstaMarketDbContext dbContext) { InitializeComponent(); this.dbContext = dbContext; vendorDimensionsDataGridView.DataSource = dbContext.Dimensions.Local.ToBindingList(); vendorGoodsDataGridView.DataSource = dbContext.Goods.Local.ToBindingList(); }
public ShopConfirmationSubForm(ref InstaMarketDbContext dbContext, InstaUser shop, ShopAddSubForm parentForm) { InitializeComponent(); this.shop = shop; this.dbContext = dbContext; this.parentForm = parentForm; shopPictureBox.ImageLocation = shop.ProfilePicture; usernameLabel.Text = shop.UserName; fullNameLabel.Text = shop.FullName == null? "" : shop.FullName; }
public DimensionSubForm(ref InstaMarketDbContext dbContext, ref Dimension dimension, bool isNewElement) { InitializeComponent(); this.dbContext = dbContext; this.dimension = dimension; this.isNewElement = isNewElement; if (!isNewElement) { dimensionIdLabel.Text += dimension.Dimension_Id; dimensionMeasureTextBox.Text = dimension.Measure == null ? "" : dimension.Measure; dimensionAmountTextBox.Text = dimension.Amount; } }
public GoodSubForm(ref InstaMarketDbContext dbContext, ref Good good, bool isNewElement) { InitializeComponent(); this.dbContext = dbContext; this.good = good; this.isNewElement = isNewElement; if (!isNewElement) { goodIdLabel.Text += good.Good_Id; descriptionRichTextBox.Text = good.Description == null ? "" : good.Description; goodNameTextBox.Text = good.Name; } }
public DeliverySubForm(ref InstaMarketDbContext dbContext, ref Delivery delivery, bool isNewElement) { InitializeComponent(); this.dbContext = dbContext; this.delivery = delivery; this.isNewElement = isNewElement; if (!isNewElement) { deliveryIdLabel.Text += delivery.Delivery_Id; deliveryNameTextBox.Text = delivery.Name; deliveryCityTextBox.Text = delivery.City; deliveryNumberNumericUpDown.Value = delivery.Num; } }
public GoodDimensionEditSubForm(ref InstaMarketDbContext dbContext, ref Good_Dimension good_dimension) { InitializeComponent(); this.dbContext = dbContext; this.good_dimension = good_dimension; goodDimensionIdLabel.Text += good_dimension.Good_Dimension_Id; goodIdLabel.Text += good_dimension.Good_Id; goodLabel.Text += good_dimension.Good.ToString(); dimensionIdLabel.Text += good_dimension.Dimension_Id; dimensionLabel.Text += good_dimension.Dimension.ToString(); priceNumericUpDown.Value = good_dimension.Price; amountNumericUpDown.Value = good_dimension.Available; }
public OrderSubForm(ref InstaMarketDbContext dbContext, ref Order order, bool isNewElement) { InitializeComponent(); this.ControlBox = false; this.isNewElement = isNewElement; this.dbContext = dbContext; this.order = order; changes = new List<ReceiptChange>(); dateLabel.Text += " "+order.Date; fullPriceLabel.Text = "Full price: " + order.Receipts.Sum(o => o.Position_Price); receiptsDataGridView.DataSource = new BindingList<Receipt>(order.Receipts); deliveryLabel.Text += order.Delivery == null ? "" : order.Delivery.ToString(); orderStatusComboBox.DataSource = dbContext.Order_Statuses.Local.ToBindingList(); orderDeliveryDataGridView.DataSource = dbContext.Deliveries.Local.ToBindingList(); orderDeliveryDataGridView.Columns["Delivery_Id"].Visible = false; if (order.User != null) { usernameTextBox.Text = order.User.User_Name; usernameTextBox.Enabled = false; } if (order.Email != null) { emailTextBox.Text = order.Email; } if (!isNewElement) { orderIdLabel.Text += order.Order_Id; lastNameTextBox.Text = order.Last_Name; nameTextBox.Text = order.First_Name; phoneTextBox.Text = order.Phone_Number; orderStatusComboBox.SelectedItem = order.Order_Status; } receiptsDataGridView.Columns["Order"].Visible = false; receiptsDataGridView.Columns["Order_Id"].Visible = false; }
public TextOrder(string text, InstaMarketDbContext dbContext) { Text = text.Trim(); this.dbContext = dbContext; }
public ClientApiHandler(ref IInstaApi InstaApi, ref InstaMarketDbContext dbContext, int timeout) { this.instaApi = InstaApi; this.dbContext = dbContext; Timeout = timeout; }