コード例 #1
0
        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());
            }
        }
コード例 #2
0
        public HttpResponseMessage GetDetail(string name, int custId)
        {
            ItemResponse <SchedulingUploads> response = new ItemResponse <SchedulingUploads>();

            response.Item = SchedulingUploadsService.GetSchedulingUpload(name, custId);
            return(Request.CreateResponse(response));
        }