public ActionResult FileDetailPostKO(int ClaimID, int ClaimDetailD, string ClaimGUID, FileDetail FileDetailObj) { HttpPostedFileBase hpFile = Request.Files["FileDetailNameNEW"]; bool success = true; string result = "";// "Uploaded " + hpFile.FileName + "(" + hpFile.ContentLength + ")"; #region New file upload if ((FileDetailObj.FileNameNEW ?? FileDetailObj.FileName) != null) {//HT Delete old\existing file? For Async need to wait until final commit //HT:IMP: Set Async so that now the file maps to Async file-path FileDetailObj.IsAsync = true; //FileDetailObj.ClaimGUID = _Session.Claim.ClaimGUID; // to be used further FileDetailObj.FileName = ChkAndSaveClaimFile("FileDetailNameNEW", ClaimID, DetailFM, FileDetailObj.ClaimGUID, ClaimDetailD); success = (ModelState["FileName"].Errors.Count() < 1); } #endregion result = !success ? ("Unable to upload file - " + ModelState["FileName"].Errors[0].ErrorMessage) : ""; //Taconite XML return this.Content(Defaults.getTaconiteResult(success, Defaults.getOprResult(success, result), "fileDetailOprMsg", "fileDUploadResponse('" + FileDetailObj.CodeStr + "'," + success.ToString().ToLower() + "," + FileDetailObj.ID + ")"), "text/xml"); }
public int Add(FileDetail fileDetailObj, bool doSubmit) { //Set lastmodified fields fileDetailObj.LastModifiedBy = _SessionUsr.ID; fileDetailObj.LastModifiedDate = DateTime.Now; dbc.FileDetails.InsertOnSubmit(fileDetailObj); if(doSubmit) dbc.SubmitChanges(); return fileDetailObj.ID; // Return the 'newly inserted id' }
public int AddEdit(FileDetail fileDetailObj, bool doSubmit) { fileDetailObj.UploadedOn = Defaults.getValidDate(fileDetailObj.UploadedOn); // special case to ensure valid SQLDate if (fileDetailObj.ID <= Defaults.Integer) // Insert return Add(fileDetailObj, doSubmit); else { #region Update //Set lastmodified fields fileDetailObj.LastModifiedBy = _SessionUsr.ID; fileDetailObj.LastModifiedDate = DateTime.Now; dbc.FileDetails.Attach(fileDetailObj);//attach the object as modified dbc.Refresh(System.Data.Linq.RefreshMode.KeepCurrentValues, fileDetailObj);//Optimistic-concurrency (simplest solution) #endregion if(doSubmit) dbc.SubmitChanges(); } return fileDetailObj.ID; }
FileDetail Transform(FileDetail f, string fileDetailBy, string fileTypeTitle) { return f.Set(f1 => { f1.UploadedBy = fileDetailBy; f1.FileTypeTitle = fileTypeTitle; f1.ClaimGUID = f1.ClaimID.ToString(); }); }
public void Delete(FileDetail fileDetailObj, bool doSubmit) { dbc.FileDetails.DeleteOnSubmit(dbc.FileDetails.Single(f => f.ID == fileDetailObj.ID)); if(doSubmit) dbc.SubmitChanges(); }
partial void DeleteFileDetail(FileDetail instance);
partial void UpdateFileDetail(FileDetail instance);
partial void InsertFileDetail(FileDetail instance);
private void detach_FileDetails(FileDetail entity) { this.SendPropertyChanging(); entity.MasterFileTypeDetail = null; }
private void detach_FileDetails(FileDetail entity) { this.SendPropertyChanging(); entity.ClaimDetail = null; }
public JsonResult FilesDetailKOVM(int ClaimID, int ClaimDetailID, string ClaimGUID) { //Set File object FileDetail newObj = new FileDetail() { ID = -1, _Added = true, ClaimID = ClaimID, ClaimDetailID = ClaimDetailID, ClaimGUID = ClaimGUID, UploadedBy = _SessionUsr.Email, LastModifiedBy = _SessionUsr.ID, LastModifiedDate = DateTime.Now, UploadedOn = DateTime.Now, UserID = _SessionUsr.ID, Archived = false, FileName = "", FileNameNEW = "" }; DAL.FileDetailKOModel vm = new FileDetailKOModel() { FileDetailToAdd = newObj, EmptyFileDetail = newObj, AllFiles = new FileDetailService().Search(ClaimID, ClaimDetailID) }; // Lookup data vm.FileDetailTypes = new LookupService().GetLookup(LookupService.Source.FileDetail); return Json(vm, JsonRequestBehavior.AllowGet); }