private async void ActivityObjectNameOnGetValue(object sender, GetValueEventArgs e) { var log = (activity_log) e.Row; var cred = log.credential; var name = ""; switch ((LoginType)cred.login_type) { case LoginType.Edu: var edu = await Repo.GetEdu(cred.ref_id.Value); if (edu != null) { name = edu.sys_name; } break; case LoginType.Municipality: var munit = await Repo.GetMunicipality(cred.ref_id.Value); if (munit != null) { name = munit.name; } break; case LoginType.Ministry: name = "Минобр"; break; case LoginType.Region: var region = await Repo.GetRegion(cred.ref_id.Value); name = region.name; break; } e.Value = name; }
private void cfThoiGianHoanThanhTong_GetValue(object sender, GetValueEventArgs e) { DateTime ngayBatDau = (DateTime)e.GetColumnValue("NgayBatDau"); DateTime ngayHoanThanh; try { ngayHoanThanh = (DateTime)e.GetColumnValue("NgayHoanThanh"); TimeSpan interval = ngayHoanThanh.Subtract(ngayBatDau); string thoiGian = ""; if (interval.Days != 0) { thoiGian = interval.Days + " ngày"; } else { thoiGian = interval.Hours + " giờ"; } e.Value = thoiGian; } catch { e.Value = null; } }
private void calculatedField1_GetValue(object sender, GetValueEventArgs e) { DetailItemClass currentRow = e.Row as DetailItemClass; List <ParentItemClass> ds = (List <ParentItemClass>)e.Report.DataSource; List <DetailItemClass> childRows = ds.Single(x => x.ItemID == currentRow.ParentID).DetailItems; e.Value = GetCurrentRowIndex(currentRow, childRows); }
protected override object GetValue <THeader>(THeader tObj, string propertyName) { if (GetHeaderValueCallback != null) { GetValueEventArgs <object> args = new GetValueEventArgs <object>(tObj, propertyName); GetHeaderValueCallback(this, args); if (args.Handled) { return(args.Value); } } return(base.GetValue <THeader>(tObj, propertyName)); }
private void cfNguoiNhan_GetValue(object sender, GetValueEventArgs e) { ICollection <PHANCONG> dsPC = (ICollection <PHANCONG>)e.GetColumnValue("PHANCONG"); string nguoiNhan = ""; foreach (PHANCONG pc in dsPC) { if (nguoiNhan != "") { nguoiNhan += ", "; } nguoiNhan += pc.NHANVIEN.HoTen; } e.Value = nguoiNhan; }
private void SummaryField_GetValue(object sender, GetValueEventArgs e) { switch (Mode) { case SummaryFieldMode.Immediate: e.Value = GetImmediateModeSummary(e.Report); break; case SummaryFieldMode.Incremental: e.Value = GetIncrementalModeSummary(e.Report); break; default: throw new InvalidEnumValueException(Mode); } }
private void calculatedField2_GetValue(object sender, GetValueEventArgs e) { string expression = calculatedField_Base.Expression; object currentRow = GetCurrentRow(); object dataSource = calculatedField_Base.DataSource == null ? DataSource : calculatedField_Base.DataSource; string dataMember = calculatedField_Base.DataMember; PropertyDescriptorCollection props; using (DataContext context = new DataContext()) { props = context.GetListItemProperties(dataSource, dataMember); } object result = new ExpressionEvaluator(props, CriteriaOperator.Parse(expression)).Evaluate(currentRow); e.Value = result; }
private static void ParseJson(object sender, GetValueEventArgs e) { { if (e.Row is ResultRow row) { var text = row.ToArray()[19] as string ?? string.Empty; if (IsValidJson(text)) { var r = JsonConvert.DeserializeObject <SessionReport>(text); e.Value = r.FormatForReport(); } else { e.Value = text; } } }; }
protected override object GetValue(TBody tObj, string propertyName) { if (GetValueCallback != null) { GetValueEventArgs <TBody> args = new GetValueEventArgs <TBody>(tObj, propertyName); GetValueCallback(this, args); if (args.Handled) { return(args.Value); } } if (isDataRow) { return((tObj as DataRow)[propertyName]); } else { return(tObj.GetValue(propertyName)); } }
private void cfTrangThai_GetValue(object sender, GetValueEventArgs e) { int tienDo = (int)e.GetColumnValue("TienDo"); string trangthai = ""; if (tienDo != 100) { DateTime ngayHetHan = (DateTime)e.GetColumnValue("NgayHetHan"); if (DateTime.Compare(ngayHetHan, DateTime.Now) < 0) { trangthai = "Chậm tiến độ"; } else { trangthai = "Đang tiến hành"; } } else { trangthai = "Đã hoàn thành"; } e.Value = trangthai; }
private void calculatedField1_GetValue(object sender, GetValueEventArgs e) { CONGVIEC cv = (CONGVIEC)e.GetColumnValue("CONGVIEC"); bool tt = (bool)e.GetColumnValue("TrangThai"); string trangthai = ""; if (!tt) { if (DateTime.Compare(cv.NgayHetHan, DateTime.Now) < 0) { trangthai = "Chậm tiến độ"; } else { trangthai = "Đang tiến hành"; } } else { trangthai = "Đã hoàn thành"; } e.Value = trangthai; //e.Value = (int)((DateTime)columnValue).DayOfWeek; }
private void calculatedField1_GetValue(object sender, GetValueEventArgs e) { DataRowView view = e.Row as DataRowView; e.Value = GetCurrentColumnValue("CategoryName") + " " + view.Row["UnitPrice"]; }
private void carddetails_GetValue(object sender, GetValueEventArgs e) { }
/// <summary> /// Regresa el nombre de la sucursal asociado una fila del origen de datos /// </summary> /// <param name="sender">Objeto que genero el evento</param> /// <param name="e">Argumentos relacionados con el evento</param> private void SucursalNombre_GetValue(object sender, GetValueEventArgs e) { ReporteRDSucursalDS.Modelo_SucursalRow row = ((e.Row as DataRowView).Row as ReporteRDSucursalDS.Modelo_SucursalRow); e.Value = row.SucursalesRow.Nombre; }
private void Week_GetValue(object sender, GetValueEventArgs e) { DateTimeFormatInfo dfi = DateTimeFormatInfo.CurrentInfo; e.Value = dfi.Calendar.GetWeekOfYear((DateTime)this.startTime.Value, dfi.CalendarWeekRule, dfi.FirstDayOfWeek); }
private void WordsUnitPrice_GetValue(object sender, GetValueEventArgs e) { e.Value = NumberToWords(Convert.ToInt32(e.GetColumnValue("UnitPrice"))); }