public override void BindControl() { RefineDAL dal = new RefineDAL(); var result = dal.GetRefineBySource(SourceType, SourceNo); string enqNo = string.Empty; List <Refine> refines2 = new List <Refine>(); Order ord = new Order(); if (string.Equals(SourceType, SysConst.SourceTypeEnquiry, StringComparison.OrdinalIgnoreCase)) { ord = new OrderDAL().GetOrderByEnq(SourceNo); if (ord != null) { refines2 = dal.GetRefineBySource(SysConst.SourceTypeOrder, ord.Order_No); } } else if (string.Equals(SourceType, SysConst.SourceTypeOrder, StringComparison.OrdinalIgnoreCase)) { ord = new OrderDAL().GetOrderByNo(SourceNo); if (!string.IsNullOrEmpty(ord.EnqNo)) { var enq = new EnquiryDAL().GetEnquiryByNo(ord.EnqNo); refines2 = dal.GetRefineByEnq(enq.Enquiry_No); } } result.AddRange(refines2); result = result.Distinct(new RefineComparer()).OrderBy(r => r.Refine_No).ToList(); Utility.BindDataToRepeater(rpRefinement, result); }
public override void BindControl() { if (IsRefineInstead) { ddlRefineList.Visible = true; txtRefineIntro.Visible = true; //btnSave.Visible = true; RefineDAL refDAL = new RefineDAL(); var refineList = refDAL.GetRefineBySource(SysConst.SourceTypeOrder, OrderNo); var result = (from r in refineList select new NameValueItem() { Name = r.Refine_No, Value = r.Refine_No }).ToList(); Utility.BindDataToDropdown(ddlRefineList, result); if (!string.IsNullOrEmpty(RefineNo)) { ddlRefineList.SelectedValue = RefineNo; } txtRefineIntro.Text = RefineIntro; } MachItemDAL dal = new MachItemDAL(); var machItems = dal.GetMachItemsByMachId(MachId); Utility.BindDataToRepeater(rpItems, machItems); }
protected void rpEnqList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Enquiry enq = e.Item.DataItem as Enquiry; RefineDAL rDal = new RefineDAL(); SurveyDAL sDal = new SurveyDAL(); QuotationDAL qDal = new QuotationDAL(); Repeater rpRefinement = e.Item.FindControl("rpRefinement") as Repeater; Utility.BindDataToRepeater(rpRefinement, rDal.GetRefineBySource(SysConst.SourceTypeEnquiry, enq.Enquiry_No)); Repeater rpSurvey = e.Item.FindControl("rpSurvey") as Repeater; Utility.BindDataToRepeater(rpSurvey, sDal.GetSurveyBySource(enq.Enquiry_No, SysConst.SourceTypeEnquiry)); Repeater rpQuoationa = e.Item.FindControl("rpQuoation") as Repeater; Utility.BindDataToRepeater(rpQuoationa, qDal.GetQuotesBySource(SysConst.SourceTypeEnquiry, enq.Enquiry_No)); FollowUpTop3UserControl followUp = e.Item.FindControl("followUpTop3UserControl") as FollowUpTop3UserControl; UIUtility.BindUserControl(followUp, SysConst.SourceTypeEnquiry, ((Enquiry)e.Item.DataItem).Enquiry_No); } }