protected void GetUserList() { UserBLL user = new UserBLL(); try { DataTable dt = user.GetUserList(); userListGridView.DataSource = dt; userListGridView.DataBind(); //for (int i = 0; i < dt.Rows.Count; i++) //{ // if (dt.Rows[i]["UserId"].ToString() == LumexSessionManager.Get("ActiveUserId").ToString()) // { // LinkButton setMenuLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("setMenuLinkButton"); // LinkButton setWarehouseLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("setWarehouseLinkButton"); // LinkButton setSalesCenterLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("setSalesCenterLinkButton"); // setMenuLinkButton.Visible = false; // setWarehouseLinkButton.Visible = false; // setSalesCenterLinkButton.Visible = false; // break; // } //} if (LumexSessionManager.Get("ActiveUserId").ToString() != "Developer") { for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["UserId"].ToString() == "Developer") { LinkButton setMenuLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("setMenuLinkButton"); LinkButton setWarehouseLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("setWarehouseLinkButton"); //LinkButton setSalesCenterLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("setSalesCenterLinkButton"); setMenuLinkButton.Visible = false; setWarehouseLinkButton.Visible = false; //setSalesCenterLinkButton.Visible = false; break; } } } if (dt.Rows.Count < 1) { msgbox.Visible = true; msgTitleLabel.Text = "User List Data Not Found!!!"; msgDetailLabel.Text = ""; msgbox.Attributes.Add("class", "alert alert-warning"); } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { user = null; } }
protected void GetUserList() { UserBLL user = new UserBLL(); try { DataTable dt = user.GetUserList(); userListGridView.DataSource = dt; userListGridView.DataBind(); if (dt.Rows.Count < 1) { msgbox.Visible = true; msgTitleLabel.Text = "User List Data Not Found!!!"; msgDetailLabel.Text = ""; msgbox.Attributes.Add("class", "alert alert-warning"); } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { user = null; } }
protected void GetUserList() { UserBLL user = new UserBLL(); try { DataTable dt = user.GetUserList(); userListGridView.DataSource = dt; userListGridView.DataBind(); //for (int i = 0; i < dt.Rows.Count; i++) //{ // if (dt.Rows[i]["UserId"].ToString() == LumexSessionManager.Get("ActiveUserId").ToString()) // { // LinkButton editLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("editLinkButton"); // LinkButton activateLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("activateLinkButton"); // LinkButton deactivateLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("deactivateLinkButton"); // LinkButton deleteLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("deleteLinkButton"); // editLinkButton.Visible = false; // activateLinkButton.Visible = false; // deactivateLinkButton.Visible = false; // deleteLinkButton.Visible = false; // break; // } //} //if (LumexSessionManager.Get("ActiveUserId").ToString() != "Developer") //{ // for (int i = 0; i < dt.Rows.Count; i++) // { // if (dt.Rows[i]["UserId"].ToString() == "Developer") // { // LinkButton editLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("editLinkButton"); // LinkButton deleteLinkButton = (LinkButton)userListGridView.Rows[i].FindControl("deleteLinkButton"); // editLinkButton.Visible = false; // deleteLinkButton.Visible = false; // break; // } // } //} if (userListGridView.Rows.Count > 0) { userListGridView.UseAccessibleHeader = true; userListGridView.HeaderRow.TableSection = TableRowSection.TableHeader; } else { msgbox.Visible = true; msgTitleLabel.Text = "User List Data Not Found!!!"; msgDetailLabel.Text = ""; msgbox.Attributes.Add("class", "alert alert-warning"); } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { user = null; } }