private void RecalcRemainsAllMatBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { String errRECALC = ""; for (int i = 0; WhMatGridView.RowCount > i; ++i) { var row = WhMatGridView.GetRow(i) as WhMatGet_Result; try { DB.SkladBase().RecalcRemainsMat(row.MatId); } catch { errRECALC += row.MatName + ", "; } } if (errRECALC != "") { MessageBox.Show("Не вдалось перерахувати залишки по деяким позиціям: " + errRECALC); } else { MessageBox.Show("Залишки по всім позиціям перераховано!"); } RefreshWhBtn.PerformClick(); }
private async Task GetMatOnWh() { int grp_id = 0; string grp = ""; grp_id = ByGrpBtn.Down ? focused_tree_node.Num : 0; wid = ByGrpBtn.Down ? 0 : focused_tree_node.Num; if (wh_list != "*") { wid = -1; } if (ViewDetailTree.Down && ByGrpBtn.Down && focused_tree_node.Num != 0) { grp = focused_tree_node.Num.ToString(); } WhMatGridView.BeginUpdate(); int top_row = WhMatGridView.TopRowIndex; wh_mat_list = await DB.SkladBase().WhMatGet(grp_id, wid, (int)whKagentList.EditValue, OnDateEdit.DateTime, ShowEmptyItemsCheck.Checked ? 1 : 0, wh_list, ShowAllItemsCheck.Checked ? 1 : 0, grp, DBHelper.CurrentUser.UserId, ViewDetailTree.Down ? 1 : 0).ToListAsync(); WhMatGetBS.DataSource = wh_mat_list; WhMatGridView.TopRowIndex = top_row; WhMatGridView.EndUpdate(); }
private void WhMatGridView_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle < 0) { return; } var wh_row = WhMatGridView.GetRow(e.RowHandle) as WhMatGet_Result; if (wh_row != null && wh_row.Remain < wh_row.MinReserv) { e.Appearance.ForeColor = Color.Red; } }
private void simpleButton4_Click(object sender, EventArgs e) { if (!panel9.Visible) { splitterControl1.Visible = true; panel9.Visible = true; WhMatGridControl.DataSource = DB.SkladBase().WhMatGet(0, 0, 0, DateTime.Now, 0, "*", 0, "", DBHelper.CurrentUser.UserId, 0).ToList(); WhMatGridView.ExpandAllGroups(); } else { splitterControl1.Visible = false; panel9.Visible = false; } }
public void SaveGridLayouts() { WbGridView.SaveLayoutToRegistry(IHelper.reg_layout_path + "WarehouseUserControl\\WbGridView"); WhMatGridView.SaveLayoutToRegistry(IHelper.reg_layout_path + "WarehouseUserControl\\WhMatGridView"); }
private void WarehouseUserControl_Load(object sender, EventArgs e) { WbGridView.RestoreLayoutFromRegistry(IHelper.reg_layout_path + "WarehouseUserControl\\WbGridView"); WhMatGridView.RestoreLayoutFromRegistry(IHelper.reg_layout_path + "WarehouseUserControl\\WhMatGridView"); if (!DesignMode) { custom_mat_list = new List <CustomMatListWH>(); MatListGridControl.DataSource = custom_mat_list; whContentTab.ShowTabHeader = DevExpress.Utils.DefaultBoolean.False; OnDateEdit.DateTime = DateTime.Now; whKagentList.Properties.DataSource = DBHelper.KagentsList;// new List<object>() { new { KaId = 0, Name = "Усі" } }.Concat(new BaseEntities().Kagent.Select(s => new { s.KaId, s.Name })); if (whKagentList.EditValue == null || whKagentList.EditValue == DBNull.Value) { whKagentList.EditValue = 0; } WhComboBox.Properties.DataSource = new List <checkedWhList>() { new checkedWhList { WId = "*", Name = "Усі", IsChecked = false } }.Concat(new BaseEntities().Warehouse.Select(s => new checkedWhList { WId = s.WId.ToString(), Name = s.Name, IsChecked = false }).ToList()); WhComboBox.EditValue = "*"; var whlist = new BaseEntities().Warehouse.Select(s => new checkedWhList { WId = s.WId.ToString(), Name = s.Name, IsChecked = false }).ToList(); foreach (var item in whlist) { checkedComboBoxEdit1.Properties.Items.Add(item.WId, item.Name, item.IsChecked ? CheckState.Checked : CheckState.Unchecked, true); } wbSatusList.Properties.DataSource = new List <object>() { new { Id = -1, Name = "Усі" }, new { Id = 1, Name = "Проведені" }, new { Id = 0, Name = "Непроведені" } }; wbSatusList.EditValue = -1; wbStartDate.EditValue = DateTime.Now.Date.AddDays(-1); wbEndDate.EditValue = DateTime.Now.Date.SetEndDay(); repositoryItemLookUpEdit1.DataSource = DBHelper.WhList; repositoryItemLookUpEdit2.DataSource = DB.SkladBase().PriceTypes.ToList(); AvgMatPriceGridColumn.Visible = (DBHelper.CurrentUser.ShowPrice == 1); AvgMatPriceGridColumn.OptionsColumn.ShowInCustomizationForm = AvgMatPriceGridColumn.Visible; SumMatRemainGridColumn.Visible = AvgMatPriceGridColumn.Visible; SumMatRemainGridColumn.OptionsColumn.ShowInCustomizationForm = AvgMatPriceGridColumn.Visible; if (WHTreeList.DataSource == null) { GetTree(1); } bandedGridColumn2.Caption = $"{bandedGridColumn2.Caption}, {DBHelper.NationalCurrency.ShortName}"; var user_settings = new UserSettingsRepository(DBHelper.CurrentUser.UserId, new BaseEntities()); WbGridView.Appearance.Row.Font = new Font(user_settings.GridFontName, (float)user_settings.GridFontSize); WhMatGridView.Appearance.Row.Font = new Font(user_settings.GridFontName, (float)user_settings.GridFontSize); MatListGridView.Appearance.Row.Font = new Font(user_settings.GridFontName, (float)user_settings.GridFontSize); } whContentTab.Visible = true; }