예제 #1
0
        protected void uiButtonSaveLayout_Click(object sender, EventArgs e)
        {
            CardLayouts layout = new CardLayouts();
            if (CurrentLayout == null)
            {
                layout.AddNew();
                layout.CardID = CurrentCard.CardID;
            }
            else
                layout = CurrentLayout;

            if (uiFileUploadLayoutFront.HasFile)
            {
                string filepath = "/images/Layout/" + DateTime.Now.ToString("ddMMyyyyhhmmss") + "_" + uiFileUploadLayoutFront.FileName;
                uiFileUploadLayoutFront.SaveAs(Server.MapPath("~" + filepath));
                layout.LayoutImage = filepath;
            }

            if (uiFileUploadLayoutBack.HasFile)
            {
                string filepath = "/images/Layout/" + DateTime.Now.ToString("ddMMyyyyhhmmss") + "_" + uiFileUploadLayoutBack.FileName;
                uiFileUploadLayoutBack.SaveAs(Server.MapPath("~" + filepath));
                layout.LayeoutBackImage = filepath;
            }

            layout.ColorID = Convert.ToInt32(uiDropDownListColor.SelectedValue);

            layout.Save();

            BindCardLayout();
            ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-3\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-3\"]').addClass('active'); });", true);
            uiDropDownListColor.SelectedIndex = 0;
            CurrentLayout = null;
        }