I have this public class below and I want to include a condition which placed it inside and it doesn't work. Any suggestions?
public SummaryDates GetSummaryDates()
{
SummaryDates result = new SummaryDates();
var getDay = 3;
DateTime now = DateTime.UtcNow.Date;
var getMonth = 0;
var getQuarter = 0;
var quarterNow = now.AddMonths(3 * getQuarter);
var quarterNumber = Math.Ceiling(quarterNow.Month / 3m);
var quarterLabel2 = 0;
var quarterLabel1 = 0;
var quarterLabelA = 0;
var quarterLabelB = 0;
result.summaryDates = new SummaryDates
{
startOfQuarter2 = now,
endOfQuarter2 = now,
endOfQuarter2Plus1Day = now,
endOfQuarter1Plus1Day = now,
startOfQuarter1 = now,
endOfQuarter1 = now,
startOfQuarterA = now,
startOfQuarterB = now,
endOfQuarterA = now,
endOfQuarterB = now,
endOfQuarterAPlus1Day = now,
endOfQuarterBPlus1Day = now,
if (quarterNumber == 4)
{
startOfQuarter2 = new DateTime(getSummaryDates.quarter2Year, 10, 01);
endOfQuarter2 = new DateTime(getSummaryDates.quarter2Year, 12, 31);
endOfQuarter2Plus1Day = getSummaryDates.endOfQuarter2.AddDays(1);
quarterLabel2 = Convert.ToInt16(Math.Ceiling(getSummaryDates.endOfQuarter2.Month / 3m));
}
return result;
}
}
I've placed the conditions inside. It doesn't work.
This problem is driving me nuts... I don't know how to fix it. I'm trying to create an inventory movement journal entry using the ProfitLossJournalService.
The code below runs, but it shows the transaction in the "inventory adjustment" journal. I want it in the inventory movement jounal.
public void UpdateInventoryForConsumableItem(InventoryUpdate update)
{
var svc = new ProfitLossJournalServiceClient();
var cc = new CallContext {Company = "SS"};
var journal = new AxdProfitLossJournal();
var table = new AxdEntity_InventJournalTable
{
InventDimFixedSpecified = false,
InventSiteId = "MC",
InventLocationId = "MAIN WH",
JournalType = AxdEnum_InventJournalType.Movement,
JournalNameId = "InvMovJour",
Description = Constants.InventoryMovementJournalDescription,
NumOfLines = 1,
NumOfLinesSpecified = true,
JournalTypeSpecified = true,
JournalId = "InvMovJour",
JournalIdOrignal = "InvMovJour",
action = AxdEnum_AxdEntityAction.update
};
var inventoryDims = new AxdEntity_InventDim
{
InventLocationId = "MAIN WH",
InventDimId = update.InventoryDimId,
InventColorId = update.Color,
InventSiteId = "MC",
InventSizeId = update.Size,
InventStyleId = update.Style,
action = AxdEnum_AxdEntityAction.create
};
var entry = new AxdEntity_InventJournalTrans
{
InventDimId = update.InventoryDimId,
TransDate = DateTime.Now,
ItemId = update.ItemId,
CostMarkupSpecified = false,
InventRefTypeSpecified = false,
LineNumSpecified = false,
JournalType = AxdEnum_InventJournalType.Movement,
JournalTypeSpecified = true,
Qty = update.Quantity,
QtySpecified = true,
InventDim = new AxdEntity_InventDim[1] {inventoryDims}
};
table.InventJournalTrans = new[] {entry};
journal.InventJournalTable = new[] {table};
try
{
var result = svc.create(cc, journal);
Logger.LogTrace(string.Format("sending InventoryTransferJournal {0}", result.GetValue(0)));
Logger.LogEvent(Logger.SentConsumableInventoryUpdateToDynamics);
}
catch (Exception e)
{
Logger.LogException(e);
throw;
}
}
When you use the ProfitLossJournalService that is essentially what you are creating, an Inventory adjustment.
If you want to create an inventory movement journal, unfortunately there is no standard AIF service that does that. You would need to implement that yourself and expose it to AIF.
I'm using MvcxGridView to bind a DataTable model and I have a problem with a DataColumn with datatype System.Byte[].
When I view data, gridview does not show a value and only displays System.Byte[]. I want the GridView to display a picture in that column.
When I save data, I get this message:
Invalid cast from 'System.String' to 'System.Byte[]'
How can I solve these problems?
Here is my code in view:
#using System.Data;
#model TestPA6MVC.Models.EntityModelForViewDataSettingGrid
#functions{
MVCxGridViewCommandColumn CreateCommandColumn(string AllowEdit,string AllowAdd)
{
MVCxGridViewCommandColumn column = new MVCxGridViewCommandColumn();
column.Visible = true;
column.NewButton.Visible = (AllowAdd.ToLower()=="true")?true:false;
column.DeleteButton.Visible = (AllowEdit.ToLower() == "true") ? true : false; ;
//column.EditButton.Visible = true;
return column;
}
}
#{
var grid = Html.DevExpress().GridView(
settings => {
settings.Name = "gvEditing";
settings.CallbackRouteValues = new {
Controller = "Home", Action = "GridViewPartial",
ViewName = Model.ViewName,
PrimaryKeyCollection = Model.PrimaryKeyCollection,
TableEditorList = Model.TableEditorList,
ColumnComboBoxCollection = Model.ColumnComboBoxCollection,
ColumnReadOnlyCollection = Model.ColumnReadOnlyCollection,
ColumnHideCollection = Model.ColumnHideCollection,
ParamNameCollection = Model.ParamNameCollection,
DataForParamCollection = Model.DataForParamCollection,
ParamTypeCollection = Model.ParamTypeCollection,
AllowAdd = Model.AllowAdd,
AllowEdit = Model.AllowEdit
};
settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Home", Action = "GridViewPartialAddNew", ViewName = Model.ViewName };
settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Home", Action = "GridViewPartialUpdate", ViewName = Model.ViewName };
settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Home", Action = "GridViewPartialDelete", ViewName = Model.ViewName };
settings.SettingsEditing.BatchUpdateRouteValues = new {
Controller = "Home", Action = "BatchEditingUpdateModel",
ViewName = Model.ViewName,
PrimaryKeyCollection = Model.PrimaryKeyCollection,
TableEditorList = Model.TableEditorList,
ColumnComboBoxCollection = Model.ColumnComboBoxCollection,
ColumnReadOnlyCollection = Model.ColumnReadOnlyCollection,
ColumnHideCollection = Model.ColumnHideCollection,
ParamNameCollection = Model.ParamNameCollection,
DataForParamCollection = Model.DataForParamCollection,
ParamTypeCollection = Model.ParamTypeCollection,
AllowAdd = Model.AllowAdd,
AllowEdit = Model.AllowEdit
};
if (Model.AllowEdit.ToLower() == "true")
{
settings.SettingsEditing.Mode = GridViewEditingMode.Batch;//Kieu view chinh sua
}
else { settings.SettingsEditing.Mode = GridViewEditingMode.PopupEditForm; }
settings.SettingsBehavior.ConfirmDelete = true;//Cho phep hien thi thong bao xac nhan
settings.SettingsBehavior.ColumnResizeMode = ColumnResizeMode.Control;//Cho phep chinh sua do rong cot
settings.Width = 800;//Chieu rong cua gridview
settings.Settings.HorizontalScrollBarMode = ScrollBarMode.Auto;
settings.SettingsPager.Mode = GridViewPagerMode.ShowPager;
settings.SettingsPager.PageSize = 50;
settings.Settings.VerticalScrollableHeight = 300;
settings.Settings.VerticalScrollBarMode = ScrollBarMode.Auto;
settings.SettingsPager.Visible = true;
settings.Settings.ShowGroupPanel = true;
settings.Settings.ShowFilterRow = true;
settings.Settings.ShowHeaderFilterButton = true;//Hien thi bo loc cho column
//Tao cot gia de tranh tinh trang hien thi lai cac Column an khi Callback
MVCxGridViewColumn fakeco = new MVCxGridViewColumn();
fakeco.Visible = false;
fakeco.Width = 0;
fakeco.EditFormSettings.Visible = DefaultBoolean.False;
settings.Columns.Add(fakeco);
settings.SettingsBehavior.AllowSelectByRowClick = true;
settings.DataBound = (sender, e) =>
{
//Build Column Tool Automatic
((MVCxGridView)sender).Columns.Insert(0, CreateCommandColumn(Model.AllowEdit,Model.AllowAdd));
//Add custom Column
foreach (var child in Model.ModelForDisplayColumnList)
{
MVCxGridViewColumn dc = new MVCxGridViewColumn();
dc.Caption = child.Caption;
dc.FieldName = child.ColumnName;
if(child.IsHidden)//Neu de an hoan toan se khong lay duoc du lieu da chinh sua
{ dc.Width = 0; }
//dc.Visible = !child.IsHidden;
dc.ReadOnly = child.IsReadOnly;
switch (child.DataType)
{
case "datetime":
dc.ColumnType = MVCxGridViewColumnType.DateEdit;
var DateEditProperties = dc.PropertiesEdit as DateEditProperties;
DateEditProperties.DisplayFormatString = "dd/MM/yyyy hh:mm tt";
//Cho phep chinh ngay, gio
DateEditProperties.UseMaskBehavior = true;
//Dinh dang hien thi khi chinh sua
DateEditProperties.EditFormat = EditFormat.Custom;
DateEditProperties.EditFormatString = "dd/MM/yyyy hh:mm tt";
DateEditProperties.TimeSectionProperties.Visible = true;//Hien khung chinh gio
break;
case "combobox":
dc.ColumnType = MVCxGridViewColumnType.ComboBox;
var DropDownEditProperties = dc.PropertiesEdit as ComboBoxProperties;
DropDownEditProperties.DataSource = child.DataSourceForComboBoxColumn;
DropDownEditProperties.ValueField = child.DataSourceForComboBoxColumn.Columns[0].ColumnName;
DropDownEditProperties.TextFormatString = "{0}";
foreach (DataColumn childcolumn in child.DataSourceForComboBoxColumn.Columns)
{
DropDownEditProperties.Columns.Add(childcolumn.ColumnName, childcolumn.ColumnName);
}
break;
case "boolean":
case "bit":
dc.ColumnType = MVCxGridViewColumnType.CheckBox;
break;
case "byte[]":
dc.ColumnType = MVCxGridViewColumnType.BinaryImage;
//var ImageEditProperties = dc.PropertiesEdit as BinaryImageEditProperties;
//ImageEditProperties.ImageWidth = 50;
//ImageEditProperties.ImageHeight = 50;
break;
//case "string":
// dc.ColumnType = MVCxGridViewColumnType.ComboBox;
// var ComboBoxEditProperties = dc.PropertiesEdit as ComboBoxProperties;
// ComboBoxEditProperties.DataSource = ModelForDisplayColumnList;
// ComboBoxEditProperties.TextField = "DataType";
// ComboBoxEditProperties.ValueField = "Caption";
// break;
}
((MVCxGridView)sender).Columns.Add(dc);
}
};
settings.KeyFieldName = Model.PrimaryKeyCollection;
});
if (ViewData["EditError"] != null){
grid.SetEditErrorText((string)ViewData["EditError"]);
}
}
#grid.Bind(Model.DataSourceForGrid).GetHtml()
Question Edit because simple table doesnt make things simpler..
The issue is i have to pick dynamic column value..
the column name came from prev page (DropDownList) => Current Page (HiddenField)
This is my Current Codes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Data;
public partial class ViewChart : System.Web.UI.Page
{
BlupDataContext database = new BlupDataContext();
protected void Page_Load(object sender, EventArgs e)
{
HiddenFieldWCellName.Value = Request.QueryString["WCEL_Name"];
HiddenFieldSeries1.Value = Request.QueryString["Series1"];
HiddenFieldSeries2.Value = Request.QueryString["Series2"];
var q = from x in database.RSRAN079s
join y in database.RSRAN084s
on x.WCEL_Name equals y.WCEL_Name
where x.WCEL_Name == HiddenFieldWCellName.Value
select new
{
RSRAN079_ID = x.RSRAN079_ID,
PeriodStartTime = x.PeriodStartTime,
PLMN_Name = x.PLMN_Name,
RNC_Name = x.RNC_Name,
WBTS_Name = x.WBTS_Name,
WBTS_ID = x.WBTS_ID,
WCEL_Name = x.WCEL_Name,
WCEL_ID = x.WCEL_ID,
RRC_Conn_Access_Completitions = x.RRC_Conn_Access_Completitions,
RRC_Active_Drops_IU_FR = x.RRC_Active_Drops_IU_FR,
RRC_Active_Drops_IU_Fails = x.RRC_Active_Drops_IU_Fails,
RRC_Active_Drops_Radio_FR = x.RRC_Active_Drops_Radio_FR,
RRC_Active_Drops_Radio_Fails = x.RRC_Active_Drops_Radio_Fails,
RRC_Active_Drops_BTS_FR = x.RRC_Active_Drops_BTS_FR,
RRC_Active_Drops_BTS_Fails = x.RRC_Active_Drops_BTS_Fails,
RRC_Active_Drops_IUR_FR = x.RRC_Active_Drops_IUR_FR,
RRC_Active_Drops_IUR_Fails = x.RRC_Active_Drops_IUR_Fails,
RRC_Active_Drops_CIPH_FR = x.RRC_Active_Drops_CIPH_FR,
RRC_Active_Drops_CIPH_Fails = x.RRC_Active_Drops_CIPH_Fails,
RRC_Active_Drops_RNC_FR = x.RRC_Active_Drops_RNC_FR,
RRC_Active_Drops_RNC_Fails = x.RRC_Active_Drops_RNC_Fails,
RRC_Active_Drops_UE_FR = x.RRC_Active_Drops_UE_FR,
RRC_Active_Drops_UE_Fails = x.RRC_Active_Drops_UE_Fails,
RAB_Retainability_CS_Voice_SR = x.RAB_Retainability_CS_Voice_SR,
RAB_Retainability_CS_Conv_SR = x.RAB_Retainability_CS_Conv_SR,
RAB_Retainability_PS_SR = x.RAB_Retainability_PS_SR,
AMR_RAB_Setup_Access_Completitions = x.AMR_RAB_Setup_Access_Completitions,
AMR_RAB_Drop_Active_Drops_IF_FR = x.AMR_RAB_Drop_Active_Drops_IF_FR,
AMR_RAB_Drop_Active_Drops_IU_Fails = x.AMR_RAB_Drop_Active_Drops_IU_Fails,
AMR_RAB_Drop_Active_Drops_Radio_FR = x.AMR_RAB_Drop_Active_Drops_Radio_FR,
AMR_RAB_Drop_Active_Drops_Radio_Fails = x.AMR_RAB_Drop_Active_Drops_Radio_Fails,
AMR_RAB_Drop_Active_Drops_BTS_FR = x.AMR_RAB_Drop_Active_Drops_BTS_FR,
AMR_RAB_Drop_Active_Drops_BTS_Fails = x.AMR_RAB_Drop_Active_Drops_BTS_Fails,
AMR_RAB_Drop_Active_Drops_IUR_FR = x.AMR_RAB_Drop_Active_Drops_IUR_FR,
AMR_RAB_Drop_Active_Drops_IUR_Fails = x.AMR_RAB_Drop_Active_Drops_IUR_Fails,
AMR_RAB_Drop_Active_Drops_RNC_FR = x.AMR_RAB_Drop_Active_Drops_RNC_FR,
AMR_RAB_Drop_Active_Drops_RNC_Fails = x.AMR_RAB_Drop_Active_Drops_RNC_Fails,
AMR_RAB_Drop_Active_Drops_UE_FR = x.AMR_RAB_Drop_Active_Drops_UE_FR,
AMR_RAB_Drop_Active_Drops_UE_Fails = x.AMR_RAB_Drop_Active_Drops_UE_Fails,
CS_Conv_RAB_Setup_Access_Completitions = x.CS_Conv_RAB_Setup_Access_Completitions,
CS_Conv_RAB_Retainability_Completitions = x.CS_Conv_RAB_Retainability_Completitions,
CS_Conv_RAB_Active_Drops_IU_FR = x.CS_Conv_RAB_Active_Drops_IU_FR,
CS_Conv_RAB_Active_Drops__IU_Fails = x.CS_Conv_RAB_Active_Drops__IU_Fails,
CS_Conv_RAB_Active_Drops_Radio_FR = x.CS_Conv_RAB_Active_Drops_Radio_FR,
CS_Conv_RAB_Active_Drops_Radio_Fails = x.CS_Conv_RAB_Active_Drops_Radio_Fails,
CS_Conv_RAB_Active_Drops_BTS_FR = x.CS_Conv_RAB_Active_Drops_BTS_FR,
CS_Conv_RAB_Active_Drops_BTS_Fails = x.CS_Conv_RAB_Active_Drops_BTS_Fails,
CS_Conv_RAB_Active_Drops_IUR_FR = x.CS_Conv_RAB_Active_Drops_IUR_FR,
CS_Conv_RAB_Active_Drops_IUR_Fails = x.CS_Conv_RAB_Active_Drops_IUR_Fails,
CS_Conv_RAB_Active_Drops_RNC_FR = x.CS_Conv_RAB_Active_Drops_RNC_FR,
CS_Conv_RAB_Active_Drops_RNC_Fails = x.CS_Conv_RAB_Active_Drops_RNC_Fails,
CS_Conv_RAB_Active_Drops_UE_FR = x.CS_Conv_RAB_Active_Drops_UE_FR,
CS_Conv_RAB_Active_Drops_UE_Fails = x.CS_Conv_RAB_Active_Drops_UE_Fails,
Packet_Service_RAB_Setup_Access_Completitions = x.Packet_Service_RAB_Setup_Access_Completitions,
Packet_Service_RAB_Retainability_Completitions = x.Packet_Service_RAB_Retainability_Completitions,
Packet_Service_RAB_Active_Drops_IU_FR = x.Packet_Service_RAB_Active_Drops_IU_FR,
Packet_Service_RAB_Active_Drops_Fails = x.Packet_Service_RAB_Active_Drops_Fails,
Packet_Service_RAB_Active_Drops_Radio_FR = x.Packet_Service_RAB_Active_Drops_Radio_FR,
Packet_Service_RAB_Active_Drops_Radio_Fails = x.Packet_Service_RAB_Active_Drops_Radio_Fails,
Packet_Service_RAB_Active_Drops_BTS_FR = x.Packet_Service_RAB_Active_Drops_BTS_FR,
Packet_Service_RAB_Active_Drops_BTS_Fails = x.Packet_Service_RAB_Active_Drops_BTS_Fails,
Packet_Service_RAB_Active_Drops_IUR_FR = x.Packet_Service_RAB_Active_Drops_IUR_FR,
Packet_Service_RAB_Active_Drops_IUR_Fails = x.Packet_Service_RAB_Active_Drops_IUR_Fails,
Packet_Service_RAB_Active_Drops_RNC_FR = x.Packet_Service_RAB_Active_Drops_RNC_FR,
Packet_Service_RAB_Active_Drops_RNC_Fails = x.Packet_Service_RAB_Active_Drops_RNC_Fails,
Packet_Service_RAB_Active_Drops_UE_FR = x.Packet_Service_RAB_Active_Drops_UE_FR,
Packet_Service_RAB_Active_Drops_UE_Fails = x.Packet_Service_RAB_Active_Drops_UE_Fails,
Packet_Session_Rel_HSDSCH_EDCH = x.Packet_Session_Rel_HSDSCH_EDCH,
Packet_Session_Rel_HSDSCH_DCH = x.Packet_Session_Rel_HSDSCH_DCH,
Packet_Session_Rel_Alloc_Rel = x.Packet_Session_Rel_Alloc_Rel,
Packet_Session_Success_Ratio_SR = x.Packet_Session_Success_Ratio_SR,
Packet_Session_Drops_HSDSCH_EDCH_DR = x.Packet_Session_Drops_HSDSCH_EDCH_DR,
Packet_Session_Drops_HSDSCH_EDCH_Drops = x.Packet_Session_Drops_HSDSCH_EDCH_Drops,
Packet_Session_Drops_HSDSCH_DCH_DR = x.Packet_Session_Drops_HSDSCH_DCH_DR,
Packet_Session_Drops_HSDSCH_DCH_Drops = x.Packet_Session_Drops_HSDSCH_DCH_Drops,
Packet_Session_Drops_DCH_DR = x.Packet_Session_Drops_DCH_DR,
Packet_Session_Drops_DCH_Drops = x.Packet_Session_Drops_DCH_Drops,
Packet_Session_Drops_HSDSCH_EDCH_Other_DR = x.Packet_Session_Drops_HSDSCH_EDCH_Other_DR,
Packet_Session_Drops_HSDSCH_EDCH_Other_Drops = x.Packet_Session_Drops_HSDSCH_EDCH_Other_Drops,
Packet_Session_Drops_HSDSCH_DCH_Other_DR = x.Packet_Session_Drops_HSDSCH_DCH_Other_DR,
Packet_Session_Drops_HSDSCH_DCH_Other_Drops = x.Packet_Session_Drops_HSDSCH_DCH_Other_Drops,
Packet_Session_Drops_DCH_Other_DR = x.Packet_Session_Drops_DCH_Other_DR,
Packet_Session_Drops_DCH_Other_Drops = x.Packet_Session_Drops_DCH_Other_Drops,
HSDSCH_Alloc_Rel = x.HSDSCH_Alloc_Rel,
HSDPA_Retain_NW = x.HSDPA_Retain_NW,
HSDPA_Retain_RL_FR = x.HSDPA_Retain_RL_FR,
HSDPA_Retain_Non_RL_FR = x.HSDPA_Retain_Non_RL_FR,
HSDPA_Retain_Mobility_FR = x.HSDPA_Retain_Mobility_FR,
HSDPA_Retain_PRE_EMPTION_FR = x.HSDPA_Retain_PRE_EMPTION_FR,
HSDPA_Retain_Other_Mob_FR = x.HSDPA_Retain_Other_Mob_FR,
EDCH_Alloc_Rel = x.EDCH_Alloc_Rel,
HSUPA_Retain_NW = x.HSUPA_Retain_NW,
HSUPA_Retain_RL_FR = x.HSUPA_Retain_RL_FR,
HSUPA_Retain_EDCH_Rel_HSDSCH_SCC = x.HSUPA_Retain_EDCH_Rel_HSDSCH_SCC,
HSUPA_Retain_Other_FR = x.HSUPA_Retain_Other_FR,
HSDSCH_SCC_UE_FR = x.HSDSCH_SCC_UE_FR,
HSDSCH_SCC_UE_Fails = x.HSDSCH_SCC_UE_Fails,
HSDSCH_SCC_BTS_FR = x.HSDSCH_SCC_BTS_FR,
HSDSCH_SCC_BTS_Fails = x.HSDSCH_SCC_BTS_Fails,
HSDSCH_SCC_Trans_FR = x.HSDSCH_SCC_Trans_FR,
HSDSCH_SCC_Trans_Fails = x.HSDSCH_SCC_Trans_Fails,
HSDSCH_SCC_AC_FR = x.HSDSCH_SCC_AC_FR,
HSDSCH_SCC_AC_Fails = x.HSDSCH_SCC_AC_Fails,
HSDSCH_SCC_Other_FR = x.HSDSCH_SCC_Other_FR,
HSDSCH_SCC_Other_Fails = x.HSDSCH_SCC_Other_Fails,
R99_Alloc_Rel = x.R99_Alloc_Rel,
R99_Retain_NW = x.R99_Retain_NW,
Inter_RNC_SCC_Fail = x.Inter_RNC_SCC_Fail,
Inter_RNC_SCC_Drop = x.Inter_RNC_SCC_Drop,
RSRAN084_ID = y.RSRAN084_ID,
PeriodStartTime2 = y.PeriodStartTime,
RNC_Name2 = y.RNC_Name,
WBTS_Name2 = y.WBTS_Name,
WBTS_ID2 = y.WBTS_ID,
WCEL_Name2 = y.WCEL_Name,
WCEL_ID2 = y.WCEL_ID,
Cell_Availability = y.Cell_Availability,
Cell_Availability_Exclude = y.Cell_Availability_Exclude,
RRC_Set_Att = y.RRC_Set_Att,
RRC_Set_Acc_CR_NW = y.RRC_Set_Acc_CR_NW,
RRC_Set_Acc_CR_UE = y.RRC_Set_Acc_CR_UE,
RRC_Conn_Setup_SR = y.RRC_Conn_Setup_SR,
RRC_Conn_SR = y.RRC_Conn_SR,
RRC_Reg_Att = y.RRC_Reg_Att,
Regist_SR = y.Regist_SR,
RAB_Att_Voice = y.RAB_Att_Voice,
RAB_STP_and_ACC_CR_Voice = y.RAB_STP_and_ACC_CR_Voice,
RAB_SR_AMR_Voice = y.RAB_SR_AMR_Voice,
Min_per_Drop_Voice = y.Min_per_Drop_Voice,
CS_Serv_Dur_Voice = y.CS_Serv_Dur_Voice,
RAB_Att_UDI = y.RAB_Att_UDI,
RAB_Stp_Acc_SR = y.RAB_Stp_Acc_SR,
RAB_SR_UDI = y.RAB_SR_UDI,
Min_Per_Drop_UDI = y.Min_Per_Drop_UDI,
CS_Serv_Dur_UDI = y.CS_Serv_Dur_UDI,
PS_NRT_RAB_Att = y.PS_NRT_RAB_Att,
PS_NRT_RAB_CR = y.PS_NRT_RAB_CR,
PS_NRT_RAB_SR_NW = y.PS_NRT_RAB_SR_NW,
PS_NRT_RAB_SR_User = y.PS_NRT_RAB_SR_User,
Packet_Session_Att = y.Packet_Session_Att,
Packet_Session_Stp_SR = y.Packet_Session_Stp_SR,
RAB_Att_Stream = y.RAB_Att_Stream,
RAB_Stp_Acc_SR_Stream = y.RAB_Stp_Acc_SR_Stream,
RAB_SR_Stream = y.RAB_SR_Stream,
M_RAB_Att = y.M_RAB_Att,
M_RAB_Stp_Acc_SR = y.M_RAB_Stp_Acc_SR,
M_RAB_SR = y.M_RAB_SR,
SHO_Update_Att_RT = y.SHO_Update_Att_RT,
SHO_Update_Att_NRT = y.SHO_Update_Att_NRT,
SHO_SR_RT = y.SHO_SR_RT,
SHO_SR_NRT = y.SHO_SR_NRT,
SHO_Overhead = y.SHO_Overhead,
Inter_Sys_HHO_Att_RT = y.Inter_Sys_HHO_Att_RT,
Inter_Sys_HHO_Att_NRT = y.Inter_Sys_HHO_Att_NRT,
Inter_Sys_HHO_RT_SR = y.Inter_Sys_HHO_RT_SR,
Inter_Sys_HHOO_NRT_SR = y.Inter_Sys_HHOO_NRT_SR,
Inter_Sys_HHO_RT_DR = y.Inter_Sys_HHO_RT_DR,
Inter_Sys_HHO_NRT_DR = y.Inter_Sys_HHO_NRT_DR,
Inc_IS_Change_Att = y.Inc_IS_Change_Att,
Intra_Sys_HHO_Att = y.Intra_Sys_HHO_Att,
Intra_Sys_HHO_SR = y.Intra_Sys_HHO_SR,
R99_Allo_DL_DCH_Cap_Data_Call = y.R99_Allo_DL_DCH_Cap_Data_Call,
R99_Allo_UL_DCH_Cap_Data_Call = y.R99_Allo_UL_DCH_Cap_Data_Call,
HSDSCH_Selections = y.HSDSCH_Selections,
HSDPA_Res_Acc_NRT = y.HSDPA_Res_Acc_NRT,
HSDPA_Res_Retain_NRT = y.HSDPA_Res_Retain_NRT,
HSDPA_Res_Retain_RT = y.HSDPA_Res_Retain_RT,
HSDPA_Attempt = y.HSDPA_Attempt,
HSDPA_SR = y.HSDPA_SR,
Avg_MAC_D_THP = y.Avg_MAC_D_THP,
Act_HSDSCH_MAC_D_THP_NW = y.Act_HSDSCH_MAC_D_THP_NW,
HSDPA_DL_DATA_Rcvd_NodeB = y.HSDPA_DL_DATA_Rcvd_NodeB,
HSDPA_MAC_HS_Data_Vol_at_RNC = y.HSDPA_MAC_HS_Data_Vol_at_RNC,
HSPDA_MAC_HS_Efficiency = y.HSPDA_MAC_HS_Efficiency,
HARQ_Non_Ack_Ratio_Mean = y.HARQ_Non_Ack_Ratio_Mean,
HSDPA_SCC_Att = y.HSDPA_SCC_Att,
E_DCH_Selections = y.E_DCH_Selections,
HSUPA_Res_Acc_NRT = y.HSUPA_Res_Acc_NRT,
HSUPA_Res_Retain_NRT = y.HSUPA_Res_Retain_NRT,
HSUPA_Res_Retain_RT = y.HSUPA_Res_Retain_RT,
HSUPA_Att = y.HSUPA_Att,
HSUPA_SR = y.HSUPA_SR,
HSUPA_MAC_es_Data_Vol_RNC = y.HSUPA_MAC_es_Data_Vol_RNC,
HSUPA_MAC_es_BLER = y.HSUPA_MAC_es_BLER,
E_DCH_HARQ_Non_Ack_Ratio = y.E_DCH_HARQ_Non_Ack_Ratio,
HSUPA_SCC_Att = y.HSUPA_SCC_Att,
AVG_CS_Traffic = y.AVG_CS_Traffic,
Inc_SMS_Att = y.Inc_SMS_Att
};
Chart1.DataSource = q;
Chart1.Series[0].XValueMember = "PeriodStartTime";
Chart1.Series[0].YValueMembers = HiddenFieldSeries1.Value.ToString();
Chart1.Series.Add(HiddenFieldSeries2.Value);
Chart1.Series[1].XValueMember = "PeriodstartTime2";
Chart1.Series[1].YValueMembers = HiddenFieldSeries2.Value.ToString();
}
}
Can We simplify Linq Select New codes?? while i only need 4 columns only.. :(
Your question dosen't make too much sense as far as your comments/labeling, so I took my best guess:
DDLLessons.DataSource = lesson;
DDLLessons.DataBind();
var query = from x in db.Scores
where x.StudentName == DDLStudentName.SelectedItem.Value
select new {
Day = x.Day,
Class = DDLLessons.SelectedItem.Value
};
Are you looking for selecting table name dynamically using strings (this is what I understood). If yes, have a look at this and select the table object from the string:
How can I dynamically select my Table at runtime with Dynamic LINQ
From the above link, this is what is relevant to you:
'' get the table from a type (which corresponds to a table in your database)
Dim typeName = "DatabaseTest.AdventureWorks." & tableName & ", DatabaseTest"
Dim entityType = Type.GetType(typeName)
Dim table = dc.GetTable(entityType)
Dim query As IQueryable = table
(credit for the code goes to original poster of the answer on the link that I've provided)
UPDATE: C# version of code:
// get the table from a type (which corresponds to a table in your database)
string typeName = "DatabaseTest.AdventureWorks." + tableName + ", DatabaseTest";
Type entityType = Type.GetType(typeName);
object table = dc.GetTable(entityType);
IQueryable query = table as IQueryable;