protected void btnSave_Click(Object Sender, EventArgs e) { 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); } DateTime datStart = DateTime.Now; if (txtStartDate.Text != "") { datStart = DateTime.Parse(txtStartDate.Text); } DateTime datEnd = DateTime.Now; if (txtEndDate.Text != "") { datEnd = DateTime.Parse(txtEndDate.Text); } intRequest = oRequest.AddTask(0, intProfile, txtDescription.Text, datStart, datEnd); intItemID = oService.GetItemId(intService); int intResource = oServiceRequest.AddRequest(intRequest, intItemID, intService, 0, 0.00, 2, 1, dsnServiceEditor); oServiceRequest.Update(intRequest, txtTitle.Text); oResourceRequest.UpdateName(intResource, txtTitle.Text); oServiceRequest.Add(intRequest, 1, 1); oCustomized.AddEnhancement(intRequest, txtTitle.Text, txtDescription.Text, Int32.Parse(drpModules.SelectedValue), Int32.Parse(txtNumUsers.Text == "" ? "0" : txtNumUsers.Text), txtURL.Text, strVirtualPath, datStart, datEnd, intProfile, 0); if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false) { oServiceRequest.NotifyTeamLead(intItemID, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0); } Response.Redirect(oPage.GetFullLinkRelated(intPage)); }