public bool UpdateBulletin(int iBulletinID, int iSysID, string strReleaseCode, string strReleaseUser, string strTitle, string strContent, DateTime dtExpiresDate) { string str = ""; DataTable table = publicDbOpClass.DataTableQuary("select * from pt_TempAnnex where v_UserCode = '" + strReleaseCode + "'"); FileUpload upload = new FileUpload(); str = (" update pt_Bulletin_Main set v_ReleaseUser='******',v_Title='" + strTitle + "',v_Content='" + strContent + "',dtm_ExpriesDate='" + dtExpiresDate.ToString() + "',i_IsSucess = 0 where i_BulletinID=" + iBulletinID.ToString() + ";") + " update pt_Bulletin_ToSys set i_IsUpdate=1,i_IsSucess=0 where i_BulletinID = " + iBulletinID.ToString() + ";"; foreach (DataRow row in table.Rows) { if ((row["i_IsSecond"].ToString() == "1") && (row["i_IsDel"].ToString() == "1")) { upload.Delete(row["v_AnnexPath"].ToString() + row["v_AnnexName"].ToString()); str = str + " delete from pt_TempAnnex where i_AnnexID = " + row["i_AnnexID"].ToString() + ";"; string str2 = str; str = str2 + " delete from pt_Bulletin_Annex where (i_BulletinID=" + iBulletinID.ToString() + ")and(v_AnnexPath='" + row["v_AnnexPath"].ToString() + "')and(v_AnnexName='" + row["v_AnnexName"].ToString() + "');"; } else if (row["i_IsSecond"].ToString() == "0") { string str3 = str; str = str3 + " insert into pt_Bulletin_Annex values(" + iBulletinID.ToString() + "," + iSysID.ToString() + ",0,'" + row["v_AnnexPath"].ToString() + "','" + row["v_AnnexName"].ToString() + "'," + row["i_AnnexSize"].ToString() + ",0);"; str = str + " update pt_TempAnnex set i_IsSecond=1,i_IsDel=0 where i_AnnexID=" + row["i_AnnexID"].ToString() + ";"; } } string str4 = str; return(publicDbOpClass.NonQuerySqlString(str4 + " update pt_Bulletin_ToSys set i_IsUpdate = 0,i_IsSucess = 1 where (i_BulletinID = " + iBulletinID.ToString() + ")and(i_ToSysID=" + iSysID.ToString() + ");")); }
public int DelAnnex(IntendancePhotoList annexInfo) { FileUpload upload = new FileUpload(); if (upload.Delete(annexInfo.PhotoPath + annexInfo.PhotoName)) { return(publicDbOpClass.ExecSqlString("delete from OPM_EPCM_IntendancePhotoList where noteId = '" + annexInfo.NoteId.ToString() + "'")); } return(0); }
public int DelAnnex(AnnexInfo annexInfo) { FileUpload upload = new FileUpload(); if (upload.Delete(annexInfo.FilePath + annexInfo.AnnexName)) { return(publicDbOpClass.ExecSqlString("delete from XPM_Basic_AnnexList where AnnexCode = '" + annexInfo.AnnexCode.ToString() + "'")); } return(0); }
public bool DelBulletin(int iBulletinID) { FileUpload upload = new FileUpload(); string str2 = ""; string str3 = ""; foreach (DataRow row in publicDbOpClass.DataTableQuary("select * from pt_Bulletin_Annex where i_BulletinID=" + iBulletinID.ToString()).Rows) { str2 = row["v_AnnexPath"].ToString(); str3 = row["v_AnnexName"].ToString(); if (!upload.Delete(str2 + str3)) { return(false); } } return(publicDbOpClass.NonQuerySqlString(((" delete from pt_Bulletin_Annex where i_BulletinID = " + iBulletinID.ToString() + ";") + " delete from pt_Bulletin_ToSys where i_BulletinID = " + iBulletinID.ToString() + ";") + " delete from pt_Bulletin_Main where i_BulletinID = " + iBulletinID.ToString() + ";")); }
public bool DelThumbnai(string thumbnaiCode) { FileUpload upload = new FileUpload(); DataTable table = publicDbOpClass.DataTableQuary("select * from XPM_Basic_Thumbnai where ThumbnaiCode='" + thumbnaiCode + "'"); string strFileName = table.Rows[0]["ThumbnaImgPath"].ToString() + table.Rows[0]["ThumbnaName"].ToString(); if (upload.Delete(strFileName)) { StringBuilder builder = new StringBuilder(); builder.Append("delete from XPM_Basic_Thumbnai where ThumbnaiCode = '"); builder.Append(thumbnaiCode + "'"); if (publicDbOpClass.ExecSqlString(builder.ToString()) == 1) { return(true); } } return(false); }
protected void ImageBtn_Click(object sender, ImageClickEventArgs e) { com.jwsoft.pm.entpm.action.FileUpload fileUpload = new com.jwsoft.pm.entpm.action.FileUpload(); string value = this.hdnFilePath.Value; if (fileUpload.Delete(value)) { this.tr_add.Visible = true; this.tr_edit.Visible = false; Hashtable hashtable = new Hashtable(); hashtable.Add("OriginalName", SqlStringConstructor.GetQuotedString("")); hashtable.Add("FilePath", SqlStringConstructor.GetQuotedString("")); string where = " where TempletID = '" + this.TemplateID + " '"; if (DocumentAction.UpdDocTemplate(hashtable, where)) { this.JS.Text = "alert('模板文件删除成功!');"; return; } this.JS.Text = "alert('模板文件删除失败!');"; } }
protected void ImageBtn_Click(object sender, ImageClickEventArgs e) { com.jwsoft.pm.entpm.action.FileUpload fileUpload = new com.jwsoft.pm.entpm.action.FileUpload(); string value = this.hdnFilePath.Value; if (fileUpload.Delete(value)) { this.tr_add.Visible = true; this.tr_edit.Visible = false; Hashtable hashtable = new Hashtable(); hashtable.Add("OriginalName", SqlStringConstructor.GetQuotedString("")); hashtable.Add("FilePath", SqlStringConstructor.GetQuotedString("")); string where = " where RecordId = " + this.RecordID.ToString(); if (ConferenceManage.UpdTemplateFraeInfo("[OA_Meeting_Project]", hashtable, where)) { this.JS.Text = "alert('附件删除成功!');"; return; } this.JS.Text = "alert('附件删除失败!');"; } }