if (Role == "Admin") { btnUpdate.Visible = true; btnSubmit.Visible = false; } else { btnUpdate.Visible = false; btnSubmit.Visible = true; } //but its taking as normal because of sEmpcode.any solution is possible.... protected void grdJobHistory_RowDataBound(object sender, GridViewRowEventArgs e) { if (Convert.ToString(Request.QueryString["empcode"].ToString()) != "") { if (Request.QueryString["comcode"].ToString() == "MEHTASCL") { if (e.Row.RowType == DataControlRowType.DataRow) { string comcode = Request.QueryString["comcode"].ToString(); string sAEmpCode = Request.QueryString["empcode"].ToString(); string sEmpCode = Convert.ToString(e.Row.Cells[0].Text); string sProbId = Convert.ToString(e.Row.Cells[8].Text); if (e.Row.Cells[11].Text == "") { HyperLink h1 = e.Row.FindControl("Hyperlink1") as HyperLink; string sUrl = "~/Submit.aspx"; sUrl += "?empcode=" + sEmpCode.Trim(); sUrl += "&aempcode=" + sAEmpCode.Trim(); sUrl += "&comcode=" + comcode.Trim(); sUrl += "&probid=" + sProbId.Trim(); h1.NavigateUrl = ResolveUrl(sUrl); } } } } } ///////////////////////////////////////////////////////////// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Library lib = new Library(); string Role = ""; string sValue = lib.setCompanyCode("mcl", "rnv", "4", 1); if (Request.QueryString["empcode"].ToString() != "" && Request.QueryString["empcode"].ToString() != null) { if (Request.QueryString["comcode"].ToString() == "MCL") { string sEmpCode = Request.QueryString["empcode"].ToString(); string sAEmpCode = Request.QueryString["empcode"].ToString(); Role = lib.getEmpRole("mehtascl", "rnv", Request.QueryString["empcode"].ToString()); if (Role == "Admin") { btnUpdate.Visible = true; btnSubmit.Visible = false; } else { btnUpdate.Visible = false; btnSubmit.Visible = true; } if (Request.QueryString["probid"] != null) { string sProbId = Request.QueryString["probid"].ToString(); DataTable dtProblemDetail = lib.getDetailByProblemId("MCL", "RNV", sProbId); ddrDepartment.SelectedValue = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[5]).Trim(); ddrarea.SelectedValue = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[6]).Trim(); ddrCatagory.SelectedValue = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[7]).Trim(); ddrSubCatagory.SelectedValue = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[8]).Trim(); txtTitle.Value = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[9]).Trim(); txtDescription.Value = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[10]).Trim(); string sStatus = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[11]).Trim(); txtsolution.Value = Convert.ToString(dtProblemDetail.Rows[0].ItemArray[12]).Trim(); sStatus = sStatus.ToUpper(); for (int iCnt = 0; iCnt < ddrStatus.Items.Count; iCnt++) { if (ddrStatus.Items[iCnt].ToString() == sStatus) { ddrStatus.SelectedIndex = iCnt; break; } } } DataTable dtUserDetail = this.getUserDetail("Mcl", sEmpCode.Trim()); DataTable dtDesination = this.getEmpDesignation("Mcl", sEmpCode.Trim()); txtEmpCode.Text = sEmpCode; lblEmpName.Text = dtUserDetail.Rows[0].ItemArray[0].ToString() + " " + dtUserDetail.Rows[0].ItemArray[1].ToString() + " " + dtUserDetail.Rows[0].ItemArray[2].ToString(); lblDesignation.Text = dtDesination.Rows[0].ItemArray[0].ToString(); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)