using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using HotLawsuit.BLL; using HotLawsuit.DAL; using HotLawsuit.Model; namespace HotLawsuitWeb { public partial class ViewByArea : System.Web.UI.Page { string AreaCode; string sltBy; string sltYear; string sltMonth; string txtDate; string txtBeginDate; string txtEndDate; protected void Page_Load(object sender, EventArgs e) { AreaCode = Request["AreaCode"]; sltBy = Request["sltBy"]; sltYear = Request["sltYear"]; sltMonth = Request["sltMonth"]; txtDate = Request["txtDate"]; txtBeginDate = Request["txtBeginDate"]; txtEndDate = Request["txtEndDate"]; string lAreaCode; string lstrDate; string lYear; string lMonth; string lstrBeginDate; string lstrEndDate; lAreaCode = this.AreaCode; lstrDate = ""; lYear = ""; lMonth = ""; lstrBeginDate = ""; lstrEndDate = ""; if (sltBy == "1") {//按天 lstrDate = txtDate; } else if (sltBy == "2") {//按月 lYear = this.sltYear; lMonth = this.sltMonth; } else if (sltBy == "3") {//按时间段 lstrBeginDate = this.txtBeginDate; lstrEndDate = this.txtEndDate; } DataSet ds = GetData.GetDataByArea(lstrDate, lYear, lMonth, lstrBeginDate, lstrEndDate); //按地区查询页面,去掉省公司部门 for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int iAreaCode = Convert.ToInt32(ds.Tables[0].Rows[i]["AreaCode"]); if (iAreaCode < 11) { ds.Tables[0].Rows.RemoveAt(i); i--; } } this.rptListofArea.DataSource = ds.Tables[0]; this.rptListofArea.DataBind(); } public string ChkNoData(Object o) { string data = Convert.ToString(o); if (data == "-1") return "-"; return data + "%"; } ////// 得到投诉率 /// /// /// public string GetLawsuitRate(string AreaCode,string sLawsuitcount) { string month = ""; string year = ""; if (sltBy == "1") { year = txtDate.Split('-')[0]; month = txtDate.Split('-')[1].TrimStart('0'); } else if (sltBy == "2") { year = sltYear; month = sltMonth; } else if (sltBy == "3") { string m1 = txtBeginDate.Split('-')[1]; string m2 = txtEndDate.Split('-')[1]; if (m1 != m2) return "-";//如果跨月,则不统计 year = txtBeginDate.Split('-')[0]; month = m1.TrimStart('0'); } T_ConsumerCount_BLL ccb = new T_ConsumerCount_BLL(); ArrayList al = ccb.GetList("AreaCode='" + AreaCode + "' and StatYear=" + year + " and StatMonth=" + month + ""); if (al.Count == 0) return "-"; int ConsumerCount = ((T_ConsumerCount)al[0]).ConsumerCount; int Lawsuitcount = int.Parse(sLawsuitcount); double LawsuitRate = Convert.ToDouble(Lawsuitcount) / ConsumerCount; return string.Format("{0:0.##}‰", LawsuitRate*1000); } } }
test
最新推荐文章于 2023-08-15 10:54:36 发布