public PersSalesReport(DataRow row) { LpuRRList lpuRRList = LpuRRList.GetUniqueInstance(); int idLpuRR; int.TryParse(row[0].ToString(), out idLpuRR); _lpuRR = lpuRRList.GetItem(idLpuRR) as LpuRR; UserList userList = UserList.GetUniqueInstance(); int idUser; int.TryParse(row[1].ToString(), out idUser); _user = userList.GetItem(idUser) as User; RegionRRList regionRRList = RegionRRList.GetUniqueInstance(); int idRegionRR; int.TryParse(row[2].ToString(), out idRegionRR); _regionRR = regionRRList.GetItem(idRegionRR) as RegionRR; int idSDiv; int.TryParse(row[3].ToString(), out idSDiv); _sdiv = (SDiv)idSDiv; int idRD; int.TryParse(row[4].ToString(), out idRD); _rd = userList.GetItem(idRD) as User; int.TryParse(row[5].ToString(), out _year); double.TryParse(row[6].ToString(), out _euro); double.TryParse(row[7].ToString(), out _rub); }
public UserLpuRR(DataRow row) : base(row) { int idUser; int.TryParse(row[1].ToString(), out idUser); UserList userList = UserList.GetUniqueInstance(); _user = userList.GetItem(idUser) as User; int idLpuRR; int.TryParse(row[2].ToString(), out idLpuRR); LpuRRList lpuRRList = LpuRRList.GetUniqueInstance(); _lpuRR = lpuRRList.GetItem(idLpuRR) as LpuRR; int idSdiv; int.TryParse(row[3].ToString(), out idSdiv); _sdiv = (SDiv)idSdiv; int.TryParse(row[4].ToString(), out _year1); int.TryParse(row[5].ToString(), out _year2); }
private void loadData2() { User user = GetUser(); RegionRR regionRR = GetRegionRR(); SDiv sdiv = GetSDiv(); _dgv2 = _userLpuRRListController.ToDataGridView(user, regionRR, sdiv); }
public DataTable ToDataTable(User user, RegionRR regionRR, SDiv sdiv) { var list = List.Select(item => (item as UserLpuRR)).ToList(); list = list.Where(item => item.User == user && item.LpuRR.RegionRR == regionRR && item.Sdiv == sdiv).OrderBy(item => item.LpuRR.Name).ToList(); return(CreateTable(list)); }
public DataTable ToDataTable(User user, RegionRR regionRR, SDiv sdiv) { var list = List.Select(item => (item as UserLpuRR)).ToList(); list = list.Where(item => item.User == user && item.LpuRR.RegionRR == regionRR && item.Sdiv == sdiv).OrderBy(item => item.LpuRR.Name).ToList(); return CreateTable(list); }
public UserLpuRR(User user, LpuRR lpuRR, SDiv sdiv) { _user = user; _lpuRR = lpuRR; _sdiv = sdiv; Name = string.Empty; _year1 = DateTime.Today.Year; _year2 = DateTime.Today.Year; }
public DataGridView ToDataGridView(User user, RegionRR regionRR, SDiv sdiv) { DataTable dt = _userLpuRRList.ToDataTable(user, regionRR, sdiv); _dgv.DataSource = dt; _dgv.Columns[0].Visible = false; _dgv.Columns[1].Width = 50; _dgv.Columns[2].Width = 88; _dgv.Columns[3].Width = 200; _dgv.Columns[4].Width = 65; _dgv.Columns[5].Width = 65; SetStyle(); return _dgv; }
public DataGridView ToDataGridView(User user, RegionRR regionRR, SDiv sdiv) { DataTable dt = _userLpuRRList.ToDataTable(user, regionRR, sdiv); _dgv.DataSource = dt; _dgv.Columns[0].Visible = false; _dgv.Columns[1].Width = 50; _dgv.Columns[2].Width = 88; _dgv.Columns[3].Width = 200; _dgv.Columns[4].Width = 65; _dgv.Columns[5].Width = 65; SetStyle(); return(_dgv); }
private void btnAddUserLPU_Click(object sender, EventArgs e) { LpuRR lpuRR = GetLpuRR(); if (lpuRR.StatusLPU == StatusLPU.Неактивен) { MessageBox.Show("Невозможно прикрепить ЛПУ к пользователю, ЛПУ имеет статус \"Неактивен\"", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } User user = GetUser(); SDiv sdiv = GetSDiv(); UserLpuRR userLpuRR = new UserLpuRR(user, lpuRR, sdiv); userLpuRR.Save(UserLogged.Get()); loadData2(); }
static SExpr ParseMulExpr(ParseContext context) { var lhs = ParseAppExpr(context); while ((context.TokenData.Type == TokenType.AST) || (context.TokenData.Type == TokenType.SLS)) { var type = context.TokenData.Type; context.NextToken(); var rhs = ParseAppExpr(context); if (type == TokenType.AST) { lhs = new SMul(lhs, rhs); break; } else if (type == TokenType.SLS) { lhs = new SDiv(lhs, rhs); break; } } return(lhs); }