protected void DisplayRequestData() { iPartRequestClient objService = new iPartRequestClient(); iPartIssueClient objServiceIssue = new iPartIssueClient(); POR_SP_GetRequestByRequestIDs_Result RequestHead = new POR_SP_GetRequestByRequestIDs_Result(); try { CustomProfile profile = CustomProfile.GetProfile(); RequestHead = objService.GetRequestSummayByRequestIDs(Session["PORRequestID"].ToString(), profile.DBConnection._constr).FirstOrDefault(); hdnRequestID.Value = RequestHead.PRH_ID.ToString(); hdnSiteID.Value = RequestHead.SiteID.ToString(); lblRequestNo2.Text = RequestHead.PRH_ID.ToString(); lblRequestNo3.Text = RequestHead.PRH_ID.ToString(); lblSites.Text = RequestHead.SiteName; lblRequestStatus.Text = RequestHead.RequestStatus; lblRequestDate.Text = RequestHead.RequestDate.Value.ToString("dd-MMM-yyyy"); lblRequestType.Text = RequestHead.RequestType; lblRequestedBy.Text = RequestHead.RequestByUserName; if (WMGetIssueSummaryByRequestID() == 0) { FillGrid1ByRequestID(Convert.ToInt64(Session["PORRequestID"].ToString())); HttpContext.Current.Session["PORstate"] = "Add"; HttpContext.Current.Session["PORIssueID"] = "0"; lblIssueNo.Text = "Generate when Save"; ddlStatus.DataSource = WMFillStatus(); ddlStatus.DataBind(); if (ddlStatus.Items.Count > 1) { ddlStatus.SelectedIndex = 1; } FillUserList(1); ddlIssuedBy.SelectedIndex = ddlIssuedBy.Items.IndexOf(ddlIssuedBy.Items.FindByValue(profile.Personal.UserID.ToString())); UC_IssueDate.Date = DateTime.Now; UC_ShippingDate.Date = DateTime.Now; UC_ExpDeliveryDate.Date = DateTime.Now; } else { FillUserList(1); ddlIssuedBy.SelectedIndex = ddlIssuedBy.Items.IndexOf(ddlIssuedBy.Items.FindByValue(profile.Personal.UserID.ToString())); //add by suresh ddlStatus.DataSource = WMFillStatus(); ddlStatus.DataBind(); UC_IssueDate.Date = DateTime.Now; UC_ShippingDate.Date = DateTime.Now; UC_ExpDeliveryDate.Date = DateTime.Now; } bool AddNewAccess = false; AddNewAccess = objServiceIssue.CheckPendingIssueListToDecideAddNewAccess(RequestHead.PRH_ID, profile.DBConnection._constr); if (Toolbar1.GetUserRightsByObjectName("MaterialIssue", "", "").Add == true) { if (AddNewAccess == false) { Toolbar1.SetAddNewRight(false, "Here is no pending issue against current request", "#"); } } } catch { } finally { objService.Close(); } }