private bool PerformSchedulingSave(HttpPostedFile file, string name, int scheduleId, int custId) { try { string fileType = file.FileName.Substring(file.FileName.LastIndexOf(".") + 1); string savePath = string.Format("{0}\\{1}_{2}_{3}.{4}", GetSaveDirectory(), Users.CurrentUser.Id, name, custId, fileType); SchedulingUploads schedule = new SchedulingUploads(); schedule.Name = name; schedule.CustClientID = custId; schedule.AdminClientID = Users.CurrentUser.ClientID; SchedulingUploadsService.UpdateSchedulingUpload(schedule); file.SaveAs(savePath); SessionHelper.Instance.MostRecentlyUploadedFilePath = savePath; SchedulingSheetHandler handler = new SchedulingSheetHandler(); return(handler.Process(savePath, Users.CurrentUser.ClientID, scheduleId, custId)); } catch (Exception exception) { return(false); throw new Exception(exception.ToString()); } }
public static SchedulingUploads UpdateSchedulingUpload(object uploadOBJ) { SchedulingUploads upload = new SchedulingUploads(); upload.Clone(uploadOBJ); upload.Update(); return(upload); }