Ejemplo n.º 1
0
        /// <summary>
        /// �������
        /// </summary>
        private void BindData()
        {
            string GroupIDs = "", strWhere = "";
            int sum = 0, temp = 0;
            int[] datas;
            Maticsoft.BLL.sys_Group sys_Group_bll = new Maticsoft.BLL.sys_Group();
            int groupID = UserData.GetUserDate.U_GroupID;
            if (UserData.GetUserDate.U_Type == 0)
                title = "ȫ��������������ͳ��";
            else
            {
                title = sys_Group_bll.GetModel(groupID).G_CName + "������������ͳ��";
                GroupIDs = sys_Group_bll.GetLowerLevelString_withSelf(groupID, false);
            }

            Maticsoft.BLL.commonDiseases commonDiseases_bll = new Maticsoft.BLL.commonDiseases();
            List<Maticsoft.Model.commonDiseases> list = commonDiseases_bll.GetModelList("");
            Maticsoft.Model.commonDiseases commonDiseases_model = new Maticsoft.Model.commonDiseases();
            datas = new int[list.Count];

            Maticsoft.BLL.extend_UserDisease extend_UserDisease_bll = new Maticsoft.BLL.extend_UserDisease();
            if (GroupIDs != "")
            {
                strWhere = "DH_Type={0} and U_Committee in ({1})";
                for (int i = 0; i < list.Count; i++)
                {
                    commonDiseases_model = (Maticsoft.Model.commonDiseases)list[i];
                    datas[i] = temp = extend_UserDisease_bll.GetRecordCount(string.Format(strWhere, commonDiseases_model.CommonDiseaseID, GroupIDs));
                    sum += temp;
                }
            }
            else
            {
                strWhere = "DH_Type={0}";
                for (int i = 0; i < list.Count; i++)
                {
                    commonDiseases_model = (Maticsoft.Model.commonDiseases)list[i];
                    datas[i] = temp = extend_UserDisease_bll.GetRecordCount(string.Format(strWhere, commonDiseases_model.CommonDiseaseID));
                    sum += temp;
                }
            }

            for (int i = 0; i < list.Count; i++)
            {
                if (i != 0)
                {
                    data = data + ",";
                    categories = categories + ",";
                }
                float per = (float)Math.Round((decimal)datas[i] / sum * 100, 1);
                data = data + "{" + string.Format("y: {0}, color: colors[{1}]", datas[i], i) + "}";
                commonDiseases_model = (Maticsoft.Model.commonDiseases)list[i];
                categories = categories + string.Format("'{0}'", commonDiseases_model.CD_Name);
                table_data = table_data + string.Format("<tr class='body'><td>{0}</td><td>{1}</td><td>{2}%</td></tr>", commonDiseases_model.CD_Name, datas[i], per);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.commonDiseases DataRowToModel(DataRow row)
 {
     Maticsoft.Model.commonDiseases model=new Maticsoft.Model.commonDiseases();
     if (row != null)
     {
         if(row["CommonDiseaseID"]!=null && row["CommonDiseaseID"].ToString()!="")
         {
             model.CommonDiseaseID=int.Parse(row["CommonDiseaseID"].ToString());
         }
         if(row["CD_Name"]!=null)
         {
             model.CD_Name=row["CD_Name"].ToString();
         }
     }
     return model;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.commonDiseases GetModel(int CommonDiseaseID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 CommonDiseaseID,CD_Name from commonDiseases ");
            strSql.Append(" where CommonDiseaseID=@CommonDiseaseID");
            SqlParameter[] parameters = {
                    new SqlParameter("@CommonDiseaseID", SqlDbType.Int,4)
            };
            parameters[0].Value = CommonDiseaseID;

            Maticsoft.Model.commonDiseases model=new Maticsoft.Model.commonDiseases();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }