protected void FormViewSheetInfo_DataBound(object sender, EventArgs e) { int sheetid = 0; if (Session["UserId"] == null) return; else sheetid = Convert.ToInt32(Session["UserId"]); tb_repairsheetTableAdapter repairsheetTableAdapter = new tb_repairsheetTableAdapter(); AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow repairsheetRow = (AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow)repairsheetTableAdapter.GetDataByid(sheetid).Rows[0]; int stateid = repairsheetRow.repairstateid; Label lbrepairstateid = (Label)this.Master.FindControl("ContentPlaceHolderContent").FindControl("FormViewSheetInfo").FindControl("repairstateidLabel"); if (lbrepairstateid != null) { tb_repairstateTableAdapter repairstateTableAdapter = new tb_repairstateTableAdapter(); if (repairstateTableAdapter.GetDatabyid(stateid).Rows.Count > 0) { AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow repairstateRow = (AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow) repairstateTableAdapter.GetDatabyid(stateid).Rows[0]; lbrepairstateid.Text = repairstateRow.description; } } }
protected void ListViewRepairSheet_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem DataItem = (ListViewDataItem)e.Item; DataRowView dv = (DataRowView)DataItem.DataItem; AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow repairsheetRow = (AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow)dv.Row; tb_repairstateTableAdapter repairstateTableAdapter = new tb_repairstateTableAdapter(); if (repairstateTableAdapter.GetDatabyid(repairsheetRow.repairstateid).Rows.Count > 0) { AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow repairstateRow = (AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow) repairstateTableAdapter.GetDatabyid(repairsheetRow.repairstateid).Rows[0]; Label lb = (Label)e.Item.FindControl("repairstateidLabel"); if (lb != null) { lb.Text = repairstateRow.description; } } tb_customTableAdapter customTableAdapter = new tb_customTableAdapter(); if (customTableAdapter.GetDataByid(repairsheetRow.customid).Rows.Count > 0) { AfterSaleServiceSystem.DAL.dsCustomer.tb_customRow customRow = (AfterSaleServiceSystem.DAL.dsCustomer.tb_customRow) customTableAdapter.GetDataByid(repairsheetRow.customid).Rows[0]; Label lb = (Label)e.Item.FindControl("customidLabel"); if (lb != null) { lb.Text = customRow.company; } } } }
protected void FormViewSheetInfo_DataBound(object sender, EventArgs e) { int sheetid = 0; if (Session["UserId"] == null) { return; } else { sheetid = Convert.ToInt32(Session["UserId"]); } tb_repairsheetTableAdapter repairsheetTableAdapter = new tb_repairsheetTableAdapter(); AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow repairsheetRow = (AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow)repairsheetTableAdapter.GetDataByid(sheetid).Rows[0]; int stateid = repairsheetRow.repairstateid; Label lbrepairstateid = (Label)this.Master.FindControl("ContentPlaceHolderContent").FindControl("FormViewSheetInfo").FindControl("repairstateidLabel"); if (lbrepairstateid != null) { tb_repairstateTableAdapter repairstateTableAdapter = new tb_repairstateTableAdapter(); if (repairstateTableAdapter.GetDatabyid(stateid).Rows.Count > 0) { AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow repairstateRow = (AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow) repairstateTableAdapter.GetDatabyid(stateid).Rows[0]; lbrepairstateid.Text = repairstateRow.description; } } }
protected void ListViewRepairSheet_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem DataItem = (ListViewDataItem)e.Item; DataRowView dv = (DataRowView)DataItem.DataItem; AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow repairsheetRow = (AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow)dv.Row; tb_repairstateTableAdapter repairstateTableAdapter = new tb_repairstateTableAdapter(); if (repairstateTableAdapter.GetDatabyid(repairsheetRow.repairstateid).Rows.Count > 0) { AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow repairstateRow = (AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow) repairstateTableAdapter.GetDatabyid(repairsheetRow.repairstateid).Rows[0]; Label lb = (Label)e.Item.FindControl("repairstateidLabel"); if (lb != null) lb.Text = repairstateRow.description; } tb_customTableAdapter customTableAdapter = new tb_customTableAdapter(); if (customTableAdapter.GetDataByid(repairsheetRow.customid).Rows.Count > 0) { AfterSaleServiceSystem.DAL.dsCustomer.tb_customRow customRow = (AfterSaleServiceSystem.DAL.dsCustomer.tb_customRow) customTableAdapter.GetDataByid(repairsheetRow.customid).Rows[0]; Label lb = (Label)e.Item.FindControl("customidLabel"); if (lb != null) lb.Text = customRow.company; } } }