protected void btnSave_Click(object sender, EventArgs e) { string fileName = fuDocument.FileName; string targetPath = @"~\uploadDocs"; try { string filepath = ""; if (fuDocument.HasFile) { // Call a helper method routine to save the file. filepath = SaveFile(fuDocument.PostedFile); } else { // Notify the user that a file was not uploaded. UploadStatusLabel.Text = "You did not specify a file to upload."; } InvestmentDSTableAdapters.GetInvSupportingDocsTableAdapter tblSupportingDoc = new InvestmentDSTableAdapters.GetInvSupportingDocsTableAdapter(); if (!(type == "update")) { tblSupportingDoc.InsertInvSupportingDocs(MySessionManager.ClientID, MySessionManager.InvAppID, txtDocumentType.Value.Trim(), txtDescription.Value.Trim(), filepath, 1, MySessionManager.CurrentUser.UserID); } else if (type == "update") { tblSupportingDoc.UpdateInvSupportingDocs(txtDocumentType.Value.Trim(), txtDescription.Value.Trim(), filepath, MySessionManager.CurrentUser.UserID, id); } } catch (Exception ex) { } Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "sdedit")); }
protected void btnSave_Click(object sender, EventArgs e) { string fileName = fuDocument.FileName; string targetPath = @"~\uploadDocs"; try { string filepath = ""; if (fuDocument.HasFile) // Call a helper method routine to save the file. filepath = SaveFile(fuDocument.PostedFile); else // Notify the user that a file was not uploaded. UploadStatusLabel.Text = "You did not specify a file to upload."; InvestmentDSTableAdapters.GetInvSupportingDocsTableAdapter tblSupportingDoc = new InvestmentDSTableAdapters.GetInvSupportingDocsTableAdapter(); if (!(type == "update")) { tblSupportingDoc.InsertInvSupportingDocs(MySessionManager.ClientID, MySessionManager.InvAppID, txtDocumentType.Value.Trim(), txtDescription.Value.Trim(), filepath, 1, MySessionManager.CurrentUser.UserID); } else if (type == "update") { tblSupportingDoc.UpdateInvSupportingDocs(txtDocumentType.Value.Trim(), txtDescription.Value.Trim(), filepath, MySessionManager.CurrentUser.UserID, id); } } catch (Exception ex) { } Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "sdedit")); }