DataSet dataSetMachine = new DataSet();
dataSetMachine = new MachineSystem().GetDataMachineStatusperCompanyPlantSectionLine(3100,3110,"A","");
DataTable tabelMachine= new DataTable();
tabelMachine = dataSetMachine.Tables[0];
foreach (DataRow drMachine in tabelMachine.Rows)
{
string machineId = drMachine["MachineId"].ToString();
string status = drMachine["Status"].ToString();
int sts = Convert.ToInt32(status);
DataGridViewCell cell = repeaterMachineDasboard.Rows[e.RowIndex].Cells[e.ColumnIndex];
if ((string)cell.Value == machineId && sts == 4) // mesin bagus
{
//e.CellStyle.BackColor = Color.Red;
repeaterMachineDasboard.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = Color.LightGreen;
}
else if ((string)cell.Value == machineId && sts == 3) // mesin sedang diperbaiki
{
//e.CellStyle.BackColor = Color.Red;
repeaterMachineDasboard.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = Color.Orange;
}
else if ((string)cell.Value == machineId && sts == 2) // mesin baru diketahui rusak
{
//e.CellStyle.BackColor = Color.Red;
repeaterMachineDasboard.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = Color.Yellow;
}
else if ((string)cell.Value == machineId && sts == 1) // mesin bermasalah atau rusak
{
//e.CellStyle.BackColor = Color.Red;
repeaterMachineDasboard.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = Color.Red;
}
}
Tuesday, 13 September 2016
Tuesday, 6 September 2016
Solve combobox return object
Selama ini selected value yang aku gunakan di combobox selalu return object, dan hal itu ternyata disebabkan oleh menempatan display member dan value member setelah datasource,
jadi seharusnya set display member, value member baru kemudian datasource.
http://stackoverflow.com/questions/26870157/combobox-selectedvalue-returning-an-object-and-not-the-value
jadi seharusnya set display member, value member baru kemudian datasource.
http://stackoverflow.com/questions/26870157/combobox-selectedvalue-returning-an-object-and-not-the-value
Monday, 5 September 2016
c# - DataGridView - Use DataPropertyName to show child element property
class MyClass
{
public int Id;
public MyOtherClass OtherClass;
}
class MyOtherClass
{
public string Name;
public int Number;
}
This code help me....
private void dgv_CellFormatting( object sender, DataGridViewCellFormattingEventArgs e )
{
MyClass data = dgv.Rows[ e.RowIndex ].DataBoundItem as MyClass;
dgv.Rows[ e.RowIndex ].Cells[ "colName" ].Value = data.OtherClass.Name;
dgv.Rows[ e.RowIndex ].Cells[ "colNumber" ].Value = data.OtherClass.Number;
}
Thursday, 25 August 2016
Belajar Android
Saya sih belum pernah ngerjakan aplikasi android, tapi siapa tahu ada yang butuh,,, :) :)
Belajar Android
Belajar Android
Friday, 3 June 2016
ganti nama project
ganti nama project aja ribet, hehhe
untung nemu ini,,,
tapi saran, setelah tahap ini semua,
hapus dulu isi folder bin, kemudian buka project nya kemudian REBUILD.
https://ithinkyoushouldknowit.wordpress.com/2015/04/07/rename-project-dan-direktori-solution-di-visual-studio/
untung nemu ini,,,
tapi saran, setelah tahap ini semua,
hapus dulu isi folder bin, kemudian buka project nya kemudian REBUILD.
https://ithinkyoushouldknowit.wordpress.com/2015/04/07/rename-project-dan-direktori-solution-di-visual-studio/
Sunday, 24 April 2016
Change Port HTTP
Buka IIS
Selanjutnya Pilih Default Website
Kemudian klik Bindings di sebelah kanan dan selanjutnya akan muncul kotak dialog Site Bindings.
Pada kotak dialog Site Bindings, klik Port Http yang akan diganti.
Selanjutnya klik button Edit dan kemudian akan muncul kotak dialog Edit Site Bindings.
Ganti port Http kemudian klik button Ok.
Semoga bermanfaat. :)
Subscribe to:
Posts (Atom)