示例#1
0
        public void getStylist(string stylistID)
        {
            try
            {
                s = handler.getEmployee_S(stylistID);
                TableRow row = new TableRow();
                tblUserImage.Rows.Add(row);
                TableCell userImage = new TableCell();
                userImage.Text = "<img src=" + s.UserImage
                                 + " alt='" + s.FirstName + " " + s.LastName +
                                 " Profile Image' width='125' height='125'/>";
                tblUserImage.Rows[0].Cells.Add(userImage);
                TableRow newRow = new TableRow();
                tblUserImage.Rows.Add(newRow);
                TableCell username = new TableCell();
                username.Text      = "<p style='font-size:2em !important;'>" + s.Username.ToString() + "</p>";
                username.Font.Bold = true;
                tblUserImage.Rows[1].Cells.Add(username);

                if (!IsPostBack)
                {
                    try
                    {
                        specs = handler.BLL_GetAllServices();

                        foreach (SP_GetServices s in specs)
                        {
                            drpSpecs.DataSource     = specs;
                            drpSpecs.DataTextField  = "Name";
                            drpSpecs.DataValueField = "ServiceID";
                            drpSpecs.DataBind();
                        }
                        if (s.Specialisation != string.Empty || s.Specialisation != null)
                        {
                            drpSpecs.SelectedValue = s.ServiceID.ToString();
                        }
                    }
                    catch (Exception err)
                    {
                        drpSpecs.Text = "Services Unavailable";
                        function.logAnError("Error getting services for spec dropdown in updateEmp.aspx error:"
                                            + err.ToString());
                    }

                    if (s.Bio != string.Empty || s.Bio != null)
                    {
                        txtBio.InnerText = s.Bio.ToString();
                    }
                    if (s.ad1 != string.Empty || s.ad1 != null)
                    {
                        txtAddLine1.Text = s.ad1.ToString();
                    }
                    if (s.ad2 != string.Empty || s.ad2 != null)
                    {
                        txtAddLine2.Text = s.ad2.ToString();
                    }
                    if (s.Suburb != string.Empty || s.Suburb != null)
                    {
                        txtSuburb.Text = s.Suburb.ToString();
                    }
                    if (s.City != string.Empty || s.City != null)
                    {
                        txtCity.Text = s.City.ToString();
                    }
                }
            }
            catch (Exception Err)
            {
                getUser(userID);
                function.logAnError("Error get stylist details (the specialisation problem) [update.aspx {getStylist}] err:" + Err.ToString());
            }
        }