public HttpResponseMessage Upload_Data(Upload_Data_Info info) { string result = string.Empty; try { Model.tblReportArchive list = new Model.tblReportArchive(); list.fldAutoID = 0; list.fldReport_Name = info.fldReport_Name; list.fldReport_Type = info.fldReport_Type; list.fldRName = info.fldRName; list.fldUserID = info.fldUserID; list.fldTime = info.fldTime; list.fldPath = info.fldPath; list.fldFileName = info.fldFileName; using (Model.EntityContext db = new Model.EntityContext()) { db.tblReportArchive.Add(list); db.SaveChanges(); } result = rule.JsonStr("ok", "", list); } catch (Exception e) { result = rule.JsonStr("error", e.Message, ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage Upload_IstallorUpdate(Upload_Data_Info info) { string result = string.Empty; try { int i = rule.Upload_IstallorUpdate(info.fldReport_Name, info.fldReport_Type, info.fldRName, info.fldUserID, info.fldTime, info.fldPath, info.fldFileName); if (i > 0) { result = rule.JsonStr("ok", "", i); } else { result = rule.JsonStr("ok", "", ""); } } catch (Exception e) { result = rule.JsonStr("error", e.Message, ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }