protected void btnSave_Click(Object Sender, EventArgs e) { oVariables = new Variables(intEnvironment); string strVirtualPath = ""; if (fileUpload.FileName != "" && fileUpload.PostedFile != null) { string strExtension = fileUpload.FileName; string strType = strExtension.Substring(0, 3); strExtension = strExtension.Substring(strExtension.LastIndexOf(".")); string strFile = DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + "_" + intProfile.ToString() + strExtension; strVirtualPath = oVariables.UploadsFolder() + strFile; string strPath = oVariables.UploadsFolder() + strFile; fileUpload.PostedFile.SaveAs(strPath); } int intId = oCustomized.AddCostAvoidance(txtCAO.Text, txtDescription.Text, strVirtualPath, (txtAddtlCA.Text == "" ? 0.00 : double.Parse(txtAddtlCA.Text)), DateTime.Parse(txtDate.Text), intApplication, intProfile); oCustomized.UpdateCategoryList(intProfile, intId); Response.Redirect(oPage.GetFullLink(intPage)); }