private void writeAccountReport(TB_User sales, int year, int month, int line, decimal totalScore) { AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 2].PutValue(sales.USER_NAME); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 2].Style.Copy(cellstyle); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 3].PutValue(GlobalBusiness.getUserRoleType(sales.ROLEID)); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 3].Style.Copy(cellstyle); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 4].PutValue(Math.Round(totalScore, 2)); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 4].Style.Copy(this.cellstyle); }
private void writeAccountReport(TB_User sales, int year, int month, int line, DataTable tb) { decimal tmpTotal = 0; for (int i = 0; i < tb.Rows.Count; i++) { tmpTotal += Utils.NvDecimal(tb.Rows[i]["提成金额"].ToString()); } Total += tmpTotal; AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 2].PutValue(sales.Id); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 2].Style.Copy(cellstyle); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 3].PutValue(GlobalBusiness.getUserRoleType(sales.ROLEID)); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 3].Style.Copy(cellstyle); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 4].PutValue(tmpTotal); AccountSheet.Cells[ACCOUNTDATA_STARTLINE_INDEX + line, 4].Style.Copy(this.cellstyle); }
public IActionResult Login() { ViewBag.SiteName = GlobalBusiness.GetSiteName(); return(View()); }
public ActionResult Action() { try { #region 获取请求xml内容 Stream requestStream = Request.InputStream; long requestlength = requestStream.Length; byte[] requestBytes = new byte[requestlength]; requestStream.Read(requestBytes, 0, (int)requestlength); string requestStr = Encoding.UTF8.GetString(requestBytes); // string requestStr = @"<xml><ToUserName><![CDATA[gh_4ce5c62397ff]]></ToUserName> // <FromUserName><![CDATA[oiI62v8GLf52lVLsQyQvrRKGUrRk]]></FromUserName> // <CreateTime>1464965475</CreateTime> // <MsgType><![CDATA[text]]></MsgType> // <Content><![CDATA[趣图]]></Content> // <MsgId>6291978805302987227</MsgId> // </xml>"; #endregion string requestJson = requestStr.ToXMLJson(); MsgType requestmsgType = WXQueryFactory.GetMsgType(requestJson); BaseRequestData requestData = WXQueryFactory.GetRequestModel(requestJson, requestmsgType); WX_RequestBusiness _requestBusiness = new WX_RequestBusiness(); if (requestData != null) { int requestid = _requestBusiness.AddRequestMsgLog(requestData, requestJson, requestStr); WXForResponse responsecmd = new WXForResponse(requestData, requestmsgType); var responsemodel = responsecmd.GetResponseModel(); var resuponsexml = responsecmd.GetResponseXML(responsemodel); //var model = new WXModel.WXTransmitData.ResponseData.Image_TextResponseMsg(); //model.Title = "图文消息title"; //model.ToUserName = "******"; //model.FromUserName = "******"; //model.MsgType = "news"; //model.Articles = new WXModel.WXTransmitData.ResponseData.Article[2]; //model.Articles[0] = (new WXModel.WXTransmitData.ResponseData.Article { Description = "第一个描述", PicUrl = "图片1", Url = "跳转url1", Title = "第一个" }); //model.Articles[1] = (new WXModel.WXTransmitData.ResponseData.Article { Description = "第2个描述", PicUrl = "图片2", Url = "跳转url2", Title = "第2个" }); //resuponsexml = model.ToResponseXml<WXModel.WXTransmitData.ResponseData.Image_TextResponseMsg>(); _requestBusiness.AddResponseMsgLog(responsemodel, requestid, resuponsexml); // resuponsexml = string.Format(@"<xml> // <Content><![CDATA[你好,这是一条测试回复信息]]></Content> // <ToUserName><![CDATA[{0}]]></ToUserName> // <FromUserName><![CDATA[{1}]]></FromUserName> // <CreateTime><![CDATA[12345678]]></CreateTime> // <MsgType><![CDATA[text]]></MsgType> // </xml>", requestData.FromUserName, requestData.ToUserName); return(Content(resuponsexml, "text/xml")); } else { _requestBusiness.AddRequestParserFail(requestStr, requestJson); } return(Content(requestJson, "text/xml")); //将随机生成的 echostr 参数 原样输出就能通过token验证了。 } catch (Exception ex) { GlobalBusiness.AddGlobalError(ex.Message + ex.StackTrace); throw ex; } return(Content("")); }
private void btnSearch_Click(object sender, EventArgs e) { if (!GlobalBusiness.isConnServer()) { MessageHelper.ShowMessage("E034"); return; } resultGrid.Rows.Clear(); Hashtable hs = new Hashtable(); //查询条件 if (!string.IsNullOrEmpty(txtCusName.Text.Trim())) { hs.Add("客户", txtCusName.Text.Trim()); } DateTime Start = completeStart.Value.Date; //完工起始日期 DateTime End = completeEnd.Value.Date; //完工结束日期 if (chkIsEnable.Checked) { if (Start.CompareTo(End) > 1) { MessageHelper.ShowMessage("W010"); return; } hs.Add("完工起始", Start); hs.Add("完工截止", End); } if (cmbStatus.SelectedIndex < 3) { hs.Add("结算方式", cmbStatus.SelectedIndex); } int imYearstart = Utils.NvInt(numStartYear.Value); //导入起始年度 int imMonthstart = Utils.NvInt(numStartMonth.Value); int imYearend = Utils.NvInt(numEndYear.Value); int imMonthend = Utils.NvInt(numEndMonth.Value); if (imYearstart > imYearend) { MessageHelper.ShowMessage("E022"); return; } else if (imYearstart == imYearend) { if (imMonthstart > imMonthend) { MessageHelper.ShowMessage("E022"); return; } } hs.Add("导入起始年度", imYearstart); hs.Add("导入起始月度", imMonthstart); hs.Add("导入截止年度", imYearend); hs.Add("导入截止月度", imMonthend); if (hs.Count > 0) { DataTable tb = ScoreBusiness.getScoreByCondition(hs); if (tb != null) { if (tb.Rows.Count > 0) { for (int i = 0; i < tb.Rows.Count; i++) { resultGrid.Rows.Add(); resultGrid.Rows[i].Cells["No"].Value = i + 1; resultGrid.Rows[i].Cells["customer"].Value = Utils.NvStr(tb.Rows[i]["客户名称"].ToString()); resultGrid.Rows[i].Cells["cablenumber"].Value = Utils.NvStr(tb.Rows[i]["电路代码"].ToString()); resultGrid.Rows[i].Cells["saler"].Value = Utils.NvStr(tb.Rows[i]["主销售渠道"].ToString()); resultGrid.Rows[i].Cells["complete"].Value = DateTime.Parse(tb.Rows[i]["完工日期"].ToString()); resultGrid.Rows[i].Cells["startdate"].Value = DateTime.Parse(tb.Rows[i]["结算起始日期"].ToString()).ToString("yyyy-MM-dd"); resultGrid.Rows[i].Cells["enddate"].Value = DateTime.Parse(tb.Rows[i]["结算截止日期"].ToString()).ToString("yyyy-MM-dd"); resultGrid.Rows[i].Cells["money"].Value = Utils.NvStr(tb.Rows[i]["合同金额"].ToString()); resultGrid.Rows[i].Cells["paytype"].Value = Utils.NvStr(tb.Rows[i]["付款类型"].ToString()); resultGrid.Rows[i].Cells["receivable"].Value = Utils.NvStr(tb.Rows[i]["销账金额"].ToString()); resultGrid.Rows[i].Cells["inputdata"].Value = Utils.NvStr(tb.Rows[i]["年度"].ToString()) + "-" + Utils.NvStr(tb.Rows[i]["月度"].ToString()); resultGrid.Rows[i].Cells["remove"].Value = Utils.NvStr(tb.Rows[i]["拆机日期"].ToString()); resultGrid.Rows[i].Cells["contractType"].Value = Utils.NvStr(tb.Rows[i]["电路类型"].ToString()); } } else { MessageHelper.ShowMessage("I005"); } } } }