Nethaji chennai
foreach (DataRow dr in dt.Rows)
{
if (buffer == string.Empty || buffer != dr["SectionName"].ToString())
{
parent = 0;
ProSchedular.Add(new Production(i + 4, dr["SectionName"].ToString(),emptydata,emptydata,emptydata,emptydata, dr["sdate"].ToString(),
dr["edate"].ToString(), parent));
parent = i + 4;
ProSchedular.Add(new Production(i + 5, dr["machines"].ToString(), dr["JobNo"].ToString(), dr["OrderNumber"].ToString(), dr["ItemName"].ToString(),
dr["ProductionQuantity"].ToString(), dr["sdate"].ToString(), dr["edate"].ToString(),parent));
buffer = dr["SectionName"].ToString();
}
else
ProSchedular.Add(new Production(i + 6, dr["machines"].ToString(), dr["JobNo"].ToString(), dr["OrderNumber"].ToString(), dr["ItemName"].ToString(),
dr["ProductionQuantity"].ToString(), dr["sdate"].ToString(), dr["edate"].ToString(), parent));
i = i + 7;
}
return ProSchedular;
}
catch (Exception ex)
{
logwriter.Debug(ex.Message.ToString());
//objMas.PrintLog(" Pageid : " + pageid + " First Time page load Fetch Details From CardMaster : ",ex.Message.ToString());
return ProSchedular;
}
}
public class Production//pagedetail
{
public int id = 0;
public string start_date = "", end_date = "", text = "", Job = "", ONumber = "", Itm = "", Qty = "";
public int parent;
public bool open;
public string buffer = "";
public Production(int i,string section,string jobNumber,string OrdNum,string Item ,string qty,string SDate, string EDate,int p)
{
if (buffer == string.Empty || buffer != section)
{
id = i; text = section; Job = jobNumber; ONumber = OrdNum; Itm = Item; Qty = qty; start_date = SDate; end_date = EDate;open = true;
parent = p;buffer = section;
}
else
{
id = i; text = section; Job = jobNumber; ONumber = OrdNum; Itm = Item; Qty = qty; start_date = SDate; end_date = EDate; open = true;
parent = p;
}
}
}