コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HyperLink activeHyp = Master.FindControl("HypDashBoard") as HyperLink;

            activeHyp.CssClass += " active";
            using (PTCLEntities db = new PTCLEntities())
            {
                if (Session["UserID"] != null)
                {
                    //int UserID = (int)Session["UserID"];
                    int UserID     = (int)Convert.ToUInt32(Session["UserID"]);
                    var totalCount = db.GetMyComplaints(UserID).ToList();

                    int count = totalCount.Count;
                    lblActiveComplaints.Text = count.ToString();
                }
            }
        }
コード例 #2
0
        protected void PendingGridView()
        {
            using (PTCLEntities db = new PTCLEntities())
            {
                var UserID = Convert.ToInt32(Session["UserID"]);
                //change bad ma
                var PendingComplaintsData = db.UserPendingComplaints(UserID).ToList();
                GVPendingComplaint.DataSource = PendingComplaintsData;
                GVPendingComplaint.DataBind();

                var totalCount = db.GetMyComplaints(UserID).ToList();
                int count      = totalCount.Count;
                if (count > 10)
                {
                    Response.Write("Limit Exceed");
                    RegisterComplaintSection.CssClass = " d-none";
                    PanelOverLimit.CssClass           = " ";
                }
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["UserID"] != null)
            {
                using (PTCLEntities db = new PTCLEntities())
                {
                    int         UserID = Convert.ToInt32(Request.QueryString["UserID"]);
                    tblPtclUser a      = db.tblPtclUsers.FirstOrDefault(b => b.UserID == UserID);

                    //Total Comapints
                    var GetMyComplaints = db.GetMyComplaints(UserID).ToList();
                    int countTotalCom   = GetMyComplaints.Count;
                    //Response.Write(countTotalCom);
                    Label lblTotalC = new Label();
                    lblTotalC.Text = countTotalCom.ToString();
                    PanelTotalC.Controls.Add(lblTotalC);

                    //Active Comapints
                    var ActiveComplaints = db.GetCustomerActiveComplaint(UserID).ToList();
                    int countActiveCom   = ActiveComplaints.Count;
                    //Response.Write(countTotalCom);
                    Label lblActiveC = new Label();
                    lblActiveC.Text = countActiveCom.ToString();
                    PanelActiveC.Controls.Add(lblActiveC);

                    Label lblFirstName = new Label();
                    lblFirstName.Text = a.FirstName;
                    PanelFirstName.Controls.Add(lblFirstName);


                    Label LblFullName = new Label();
                    LblFullName.Text = a.FirstName + " " + a.LastName;
                    PanelFullName.Controls.Add(LblFullName);

                    Label lblEmail = new Label();
                    lblEmail.Text = a.EmailAddress;
                    PanelEmail.Controls.Add(lblEmail);

                    Label lblCnic = new Label();
                    lblCnic.Text = a.Cnic;
                    PanelCnic.Controls.Add(lblCnic);

                    Label lblPhone = new Label();
                    lblPhone.Text = a.Phone;
                    PanelPhone.Controls.Add(lblPhone);

                    Label lblStatus = new Label();
                    if (a.Status.ToString() == "True")
                    {
                        lblStatus.Text = "Status (Active)";
                    }
                    else
                    {
                        lblStatus.Text = "Status (Inactive)";
                    }
                    PanelStatus.Controls.Add(lblStatus);

                    if (a.CustomerDP != "" && a.CustomerDP != null)
                    {
                        userPic.ImageUrl = "../../UploadFiles/CustomerProfile/" + a.CustomerDP;
                    }
                    else
                    {
                        userPic.ImageUrl = "../../assets/img/avatar.png";
                    }

                    if (Request.QueryString["ComplaintID"] != null)
                    {
                        int ComplaintID = Convert.ToInt32(Request.QueryString["ComplaintID"]);
                        HypEditProfile.NavigateUrl = "~/ManageCustomers/Admin/CustomerSetup.aspx?UserID=" + UserID + "&back=1" + "&ComplaintID=" + ComplaintID;
                        HypBack.NavigateUrl        = "~/Complaints/Admin/AdminComplaintDetails.aspx?ComplaintID=" + ComplaintID;
                    }
                }
            }
        }