Esempio n. 1
0
        protected void LineManagerList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                switch (e.Row.RowType)
                {

                    case DataControlRowType.Header:
                        //...
                        break;

                    case DataControlRowType.DataRow:

                        Label ConsoReport = (Label)e.Row.FindControl("ConsoReport");
                        int LMID = (int)((GridView)sender).DataKeys[e.Row.RowIndex]["LMID"];
                        ERS.BAL.Director Dir = new ERS.BAL.Director();
                        if (Dir.AreReviewPending(LMID))
                            ConsoReport.Text = "All Requested Reviews Filled";
                        else
                             ConsoReport.Text = "Reviews Are Pending ";

                        break;
                }
            }
            catch
            {
                //...throw
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            MenuItemDirector = "active";
            int DirectorID = -1;
            if(Session["UserId"]!=null)
               DirectorID = Int32.Parse(Session["UserId"].ToString());
            else
               Response.Redirect("Default.aspx");

            if (!IsPostBack)
            {
            ERS.BAL.Director DirectorInst = new ERS.BAL.Director();
            List<ERS.DAL.LineManagersWithDirector> BindingList = DirectorInst.GetLineManagers(DirectorID);
            BindingList.Sort((x, y) => (x.DirectorID != DirectorID).CompareTo(true));
            //CarList.Sort();
            LineManagerList.DataSource = BindingList ;
            LineManagerList.DataBind();
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            if (Session["UserId"] == null)
               Response.Redirect("Default.aspx");
            if (!IsPostBack)
            {
                ViewState["PreviousPageUrl"] = Request.UrlReferrer.ToString();
                int DirectorID;
                if (Session["UserId"] != null)
                    DirectorID = Int32.Parse(Session["UserId"].ToString());
                else
                    Response.Redirect("Default.aspx");
                // Check if this person is valid

                int LMID = Int32.Parse(Request.QueryString["LMID"]);

                ERS.BAL.Director Dir = new ERS.BAL.Director();
                ERS.BAL.Reviews rev = new ERS.BAL.Reviews();

                List<ERS.ReviewCategory> Source = rev.GetAllCategories();
                Categories.DataSource = Source;
                Categories.DataBind();

                LineManagees.DataSource = Dir.GetManagees(LMID); ;
                LineManagees.DataTextField = "Name";
                LineManagees.DataValueField = "EmpID";
                LineManagees.DataBind();

                if (ViewState["SelCatID"] == null)
                    ViewState["SelCatID"] = Source.First().CategoryID;
                System.Web.UI.HtmlControls.HtmlGenericControl LI2 = (System.Web.UI.HtmlControls.HtmlGenericControl)Categories.Items[0].FindControl("CatLI");
                                LI2.Attributes["class"] = "active";

                AllReviews.DataSource = rev.GetAllReviewsOf_Peer_GivenCategory(Int32.Parse(LineManagees.SelectedValue), Int32.Parse(ViewState["SelCatID"].ToString())); ;
                AllReviews.DataBind();
                LMName.InnerHtml = LineManagees.SelectedItem.ToString();

                int lCategoryID = rev.GetCategoryID("Director");
                int LMIDWhoisOn = Int32.Parse(Request.QueryString["LMID"]);
                int EmpID = Int32.Parse(LineManagees.SelectedValue);
                 DirectorID = Int32.Parse(Session["UserId"].ToString());
                int ReviewID = rev.GetReviewID(LMIDWhoisOn, DirectorID, EmpID);
                if (ReviewID != -1)
                {
                    ERS.ReviewInfo RevInfo = rev.GetReviewInfo(ReviewID, lCategoryID);
                    if (RevInfo != null)
                    {
                        CommentsTxt.Text = RevInfo.Comments;
                        RatingsTxt.Text = RevInfo.Rating.ToString();
                    }

                }
            }
        }