public IHttpActionResult Save() { Dictionary <string, object> RetData = new Dictionary <string, object>(); try { var model = HttpContext.Current.Request.Form["record"]; Companym record = JsonConvert.DeserializeObject <Companym>(model); using (CompanyService obj = new CompanyService()) { RetData = obj.Save(record); } System.Web.HttpFileCollection hfc = System.Web.HttpContext.Current.Request.Files; for (int iCnt = 0; iCnt <= hfc.Count - 1; iCnt++) { Lib.UploadFile(hfc[iCnt], record._globalvariables.comp_code, record.comp_pkid, hfc.Keys[iCnt]); } return(Ok(RetData)); } catch (Exception Ex) { return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.BadRequest, Ex.Message.ToString()))); } }
public IHttpActionResult SaveUserStore(Companym Record) { try { using (CompanyService obj = new CompanyService()) return(Ok(obj.SaveUserStore(Record))); } catch (Exception Ex) { return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.BadRequest, Ex.Message.ToString()))); } }