protected void Button1_Click(object sender, EventArgs e) { DAL.general objGen = new DAL.general(); DataSet ds = objGen.getdataset("Select * from remembrancetdl WHERE rid=" + Convert.ToInt32(QueryString) + " AND mtype='1'"); BAL.remembrance objRemebmrance = new BAL.remembrance(); objRemebmrance.rid = Convert.ToInt32(QueryString); objRemebmrance.message = CKEditorControl1.Text; if (FileUpload3.HasFile) { string path = Path.GetFileName(FileUpload3.FileName); string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString(); mi = mm + path; FileUpload3.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + mi); } else { mi = Convert.ToString(ds.Tables[0].Rows[0]["img3"]); } objRemebmrance.img3 = mi; objRemebmrance.capa = txtcap3.Text; if (Convert.ToInt16(ds.Tables[0].Rows[0]["type"]) == 1) { if (FileUpload1.HasFile) { string path = Path.GetFileName(FileUpload1.FileName); string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString(); fpi = mm + path; FileUpload1.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + fpi); } else { fpi = Convert.ToString(ds.Tables[0].Rows[0]["img1"]); } if (FileUpload2.HasFile) { string path = Path.GetFileName(FileUpload2.FileName); string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString(); spi = mm + path; FileUpload2.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + spi); } else { spi = Convert.ToString(ds.Tables[0].Rows[0]["img2"]); } objRemebmrance.img1 = fpi; objRemebmrance.img2 = spi; objRemebmrance.capm = txtcap1.Text; objRemebmrance.capf = txtcap2.Text; } else { if (Convert.ToString(ds.Tables[0].Rows[0]["cattype"]) == "M") { if (FileUpload1.HasFile) { string path = Path.GetFileName(FileUpload1.FileName); string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString(); fpi = mm + path; FileUpload1.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + fpi); } else { fpi = Convert.ToString(ds.Tables[0].Rows[0]["img1"]); } objRemebmrance.img1 = fpi; objRemebmrance.img2 = "2.jpg"; objRemebmrance.capm = txtcap1.Text; } else { if (FileUpload2.HasFile) { string path = Path.GetFileName(FileUpload2.FileName); string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString(); spi = mm + path; FileUpload2.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + spi); } else { spi = Convert.ToString(ds.Tables[0].Rows[0]["img2"]); } objRemebmrance.img1 = "1.jpg"; objRemebmrance.img2 = spi; objRemebmrance.capf = txtcap2.Text; } } bool f = objGen.updateremembrancemess(objRemebmrance); if (f) { binddata(); ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "sucess();", true); } else { ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true); } }