public string GetTplReportDetail(string tplId, string periodId) { var token = Session["token"] == null ? "XXXXXXX" : Session["token"].ToString(); string apiResponse = string.Empty; TplReportDetailResponse trdr = new TplReportDetailResponse(); try { trdr = tplRequest.TplReportDetailObject(token, tplId, periodId); if (trdr.code == 0) { trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.termid) - Convert.ToInt32(right.termid))); trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.sharpid2) - Convert.ToInt32(right.sharpid2))); trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.sharpid) - Convert.ToInt32(right.sharpid))); apiResponse = JsonHelper.SerializeObject(trdr); } else { APIResponseBase ar = new APIResponseBase { code = 404, message = "报告不存在" }; apiResponse = JsonHelper.SerializeObject(ar); } } catch (Exception ex) { AppLog.Instance.Write("GetTplReportDetail", AppLog.LogMessageType.Error, ex); } return apiResponse; }
public string ImportUser(string token, string filexls) { string strResponse = string.Empty; APIResponseBase apiResponse = new APIResponseBase(); try { Dictionary<string, string> sPara = new Dictionary<string, string>(); sPara.Add("filexls", filexls); strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/import?token=" + token); } catch (Exception ex) { AppLog.Instance.Write("ImportUser", AppLog.LogMessageType.Error, ex); } return strResponse; }
public string UpdateUser(string token, string userid, string username, string deptname, string duty, string tel, string email) { string strResponse = string.Empty; APIResponseBase apiResponse = new APIResponseBase(); try { Dictionary<string, string> sPara = new Dictionary<string, string>(); sPara.Add("userid", userid); sPara.Add("username", username); sPara.Add("deptname", deptname); sPara.Add("duty", duty); sPara.Add("tel", tel); sPara.Add("email", email); strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/profile?token=" + token); } catch (Exception) { } return strResponse; }
public string UserStatusDisable(string token, string id) { string strResponse = string.Empty; APIResponseBase apiResponse = new APIResponseBase(); try { Dictionary<string, string> sPara = new Dictionary<string, string>(); sPara.Add("userid", id); strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/status/disable?token=" + token); } catch (Exception) { } return strResponse; }
public string TplChange(string strListTplDetail) { List<TplDetailResponse> listTplDetail = JsonHelper.DeserializeJsonToObject<List<TplDetailResponse>>(strListTplDetail); var token = Session["token"] == null ? "XXXXXXX" : Session["token"].ToString(); TplRequest tplRequest = new TplRequest(); string strJson = string.Empty; APIResponseBase ai = new APIResponseBase { code = 0, message = "" }; strJson = JsonHelper.SerializeObject(ai); foreach (TplDetailResponse tpl in listTplDetail) { string termids = string.Empty; string ids = string.Empty; string editbypats = string.Empty; foreach (TplDetail_DetailInfo tpldetail in tpl.data.tpl_detail) { termids += tpldetail.termid + ","; ids += tpldetail.id + ","; editbypats += tpldetail.editbypat + ","; } string reponse = tplRequest.TplChange(tpl.data.id, tpl.data.period, tpl.data.freqs, termids.Trim(','), ids.Trim(','), editbypats.Trim(','), token); TplChangeResponse tcr = JsonHelper.DeserializeJsonToObject<TplChangeResponse>(reponse); if (tcr.code != 0) { return reponse; } } return strJson; }