protected void uiButtonUpdate_Click(object sender, EventArgs e) { DBLayer db = new DBLayer(); string temp = ""; string filepath = ""; DataSet ds = new DataSet(); if (uiFileUploadPicture.HasFile) { uiFileUploadPicture.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["HonorPanelFilePath"] + uiFileUploadPicture.FileName)); filepath = ConfigurationManager.AppSettings["HonorPanelFilePath"] + uiFileUploadPicture.FileName; } ds = db.GetHonorPanel(CurrentHonorPanel); if (ds.Tables[0].Rows.Count > 0) { temp = ds.Tables[0].Rows[0]["PicturePath"].ToString(); } if (CurrentHonorPanel != 0) { if (temp != filepath && string.IsNullOrEmpty(filepath)) db.UpdateHonorPanel(CurrentHonorPanel, uiTextBoxEnName.Text, uiTextBoxArName.Text, temp, Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value)); else db.UpdateHonorPanel(CurrentHonorPanel, uiTextBoxEnName.Text, uiTextBoxArName.Text, filepath, Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value)); } else { db.AddHonorPanel(uiTextBoxEnName.Text, uiTextBoxArName.Text, filepath, Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value)); } CurrentHonorPanel = 0; uiPanelCurrentHonorPanel.Visible = true; uiPanelCurrent.Visible = false; BindData(); }