Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    CrewID     = GetCrewID();
        string sPhotoName = "";

        if (!IsPostBack)
        {
            if (CrewID > 0)
            {
                DataTable dt = objCrewAdminBLL.ExecuteQuery("select photourl from  CRW_LIB_Crew_Details where id=" + CrewID);
                sPhotoName = dt.Rows[0]["PhotoURL"].ToString();
                if (sPhotoName.Length > 0)
                {
                    Session["WorkingImage"] = sPhotoName;
                    pnlUpload.Visible       = false;
                    pnlCrop.Visible         = true;
                    imgCrop.ImageUrl        = "../Uploads/CrewImages/" + Session["WorkingImage"].ToString();
                    imgPreview.ImageUrl     = "../Uploads/CrewImages/" + Session["WorkingImage"].ToString();

                    pnlUpload.Visible = false;
                    pnlCrop.Visible   = true;
                }
                else
                {
                    pnlUpload.Visible = true;
                    pnlCrop.Visible   = true;
                }
            }
            else
            {
                sPhotoName = Convert.ToString(Session["ADDEDITNEWCREWID"]);
                Session["ADDEDITNEWCREWID"] = null;
                if (sPhotoName.Length > 0)
                {
                    Session["WorkingImage"] = sPhotoName;
                    pnlUpload.Visible       = false;
                    pnlCrop.Visible         = true;
                    imgCrop.ImageUrl        = "../Uploads/CrewImages/" + Session["WorkingImage"].ToString();
                    imgPreview.ImageUrl     = "../Uploads/CrewImages/" + Session["WorkingImage"].ToString();

                    pnlUpload.Visible = false;
                    pnlCrop.Visible   = true;
                }
                else
                {
                    pnlUpload.Visible = true;
                    pnlCrop.Visible   = true;
                }
            }
        }
    }