Esempio n. 1
0
        protected void submit_Click(object sender, EventArgs e)
        {
            Reviews rev = new Reviews();
            List<ERS.ReviewInfo> Result = new List<ERS.ReviewInfo>();
            int pReviewID = Int32.Parse(Request.QueryString["SRI"].ToString());

            // Filling Categories Comments & Ratings
            foreach (RepeaterItem a in Categories.Items)
            {
                int pCategoryID = Int32.Parse((a.FindControl("CatID") as HiddenField).Value);
                Double pRating = Double.Parse((a.FindControl("RatingsTxt") as TextBox).Text);
                String pComments = (a.FindControl("CommentsTxt") as TextBox).Text;

                // THe statement Below should be done by rev.AddReviewInfo
                Result.Add(new ERS.ReviewInfo() { CategoryID = pCategoryID, Comments = pComments, Rating = (decimal)pRating, ReviewId = rev.GetAReviewID(pReviewID) });
            }

            // Filling LMS Comments and Ratings
            bool isLMOfReview = rev.isLMOfReview(Int32.Parse(Session["UserID"].ToString()), pReviewID);
            if (Session["isLM"].Equals(true) && isLMOfReview)
            {
                int lReviewID = Int32.Parse(Request.QueryString["SRI"].ToString());
                int lCategoryID = rev.GetCategoryID("LineManager");
                Double lRating = Double.Parse(LMRatingsTxt.Text);
                String lComments = LMCommentsTxt.Text;

                // THe statement Below should be done by rev.AddReviewInfo
                Result.Add(new ERS.ReviewInfo() { CategoryID = lCategoryID, Comments = lComments, Rating = (decimal)lRating, ReviewId = rev.GetAReviewID(lReviewID) });
            }

            //If Review is filled by LM , its consolidated if by employee its just filled
            if( isLMOfReview)
                rev.FillReviews(Int32.Parse(Request.QueryString["SRI"].ToString()), Result, "Consolidated");
            else
                rev.FillReviews(Int32.Parse(Request.QueryString["SRI"].ToString()), Result, "Completed");

            Response.Redirect(ViewState["PreviousPageUrl"].ToString());
        }
Esempio n. 2
0
        protected void save_Click(object sender, EventArgs e)
        {
            Reviews rev = new Reviews();
            List<ERS.ReviewInfo> Result = new List<ERS.ReviewInfo>();

               // SaveCategories Comments and Ratings
            foreach (RepeaterItem a in Categories.Items)
            {
                int pReviewID = Int32.Parse(Request.QueryString["SRI"].ToString());
                int pCategoryID = Int32.Parse((a.FindControl("CatID") as HiddenField).Value);
                TextBox RatingTxt = (a.FindControl("RatingsTxt") as TextBox);
                TextBox CommentsTxt = (a.FindControl("CommentsTxt") as TextBox);
                Double pRating = 0 ;
                if(RatingTxt.Text.Length > 0 )
                pRating = (Double.Parse(RatingTxt.Text));
                    String pComments = CommentsTxt.Text;

                // DO IT VIA ADD REVIEW bitch
                Result.Add(new ERS.ReviewInfo() { CategoryID = pCategoryID, Comments = pComments, Rating = (decimal)pRating, ReviewId = rev.GetAReviewID(pReviewID) });

            }

            int ReviewID = Int32.Parse(Request.QueryString["SRI"].ToString());
            bool isLMOfReview = rev.isLMOfReview(Int32.Parse(Session["UserID"].ToString()), ReviewID);

            // Saving LM's
            if (Session["isLM"].Equals(true) && isLMOfReview)
            {
                int lReviewID = Int32.Parse(Request.QueryString["SRI"].ToString());
                int lCategoryID = rev.GetCategoryID("LineManager");
                Double lRating = Double.Parse(LMRatingsTxt.Text);
                String lComments = LMCommentsTxt.Text;

                // THe statement Below should be done by rev.AddReviewInfo
                Result.Add(new ERS.ReviewInfo() { CategoryID = lCategoryID, Comments = lComments, Rating = (decimal)lRating, ReviewId = rev.GetAReviewID(lReviewID) });
            }

            rev.FillReviews(Int32.Parse(Request.QueryString["SRI"].ToString()), Result, "Drafted");
            Response.Redirect(ViewState["PreviousPageUrl"].ToString());
        }