コード例 #1
0
ファイル: harita_Edit.aspx.cs プロジェクト: appdogan/RTLS_Web
        protected void Kaydet_Click(object sender, EventArgs e)
        {
            int           ID     = Convert.ToInt32(Request.QueryString["ID"]);
            TBL_Haritalar harita = ctx.TBL_Haritalar.SingleOrDefault(x => x.dlt == 0 && x.ID == ID);

            harita.HaritaAdi = HaritaAdi.Text;
            harita.Oran      = Convert.ToInt32(Oran.Text);
            ctx.SaveChanges();

            try
            {
                foreach (HttpPostedFile postedFile in FileUpload1.PostedFiles)
                {
                    string uzanti = Path.GetExtension(postedFile.FileName);
                    //if (uzanti == ".jpg" || uzanti == ".JPG" || uzanti == ".JPEG")
                    //{

                    postedFile.SaveAs(Server.MapPath("/Content/Data/Map/") + harita.ID + ".jpg");
                    //}
                }
            }
            catch { }

            Response.Redirect("harita.aspx?MapID=" + harita.Map_ID);
        }
コード例 #2
0
ファイル: harita_Edit.aspx.cs プロジェクト: appdogan/RTLS_Web
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int           ID     = Convert.ToInt32(Request.QueryString["ID"]);
         TBL_Haritalar harita = ctx.TBL_Haritalar.SingleOrDefault(x => x.dlt == 0 && x.ID == ID);
         HaritaAdi.Text = harita.HaritaAdi;
         Oran.Text      = harita.Oran.ToString();
     }
 }