/// <summary> /// 增加一条数据 /// </summary> public int Add(ZQUSR.Model.sr_Calculate2 model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into sr_Calculate2("); strSql.Append("Population,Rank,ScoreScale)"); strSql.Append(" values ("); strSql.Append("@Population,@Rank,@ScoreScale)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Population", SqlDbType.Int, 4), new SqlParameter("@Rank", SqlDbType.Int, 4), new SqlParameter("@ScoreScale", SqlDbType.NVarChar, 5) }; parameters[0].Value = model.Population; parameters[1].Value = model.Rank; parameters[2].Value = model.ScoreScale; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(1); } else { return(Convert.ToInt32(obj)); } }
/* * /// <summary> * /// 分页获取数据列表 * /// </summary> * public DataSet GetList(int PageSize,int PageIndex,string strWhere) * { * SqlParameter[] parameters = { * new SqlParameter("@tblName", SqlDbType.VarChar, 255), * new SqlParameter("@fldName", SqlDbType.VarChar, 255), * new SqlParameter("@PageSize", SqlDbType.Int), * new SqlParameter("@PageIndex", SqlDbType.Int), * new SqlParameter("@IsReCount", SqlDbType.Bit), * new SqlParameter("@OrderType", SqlDbType.Bit), * new SqlParameter("@strWhere", SqlDbType.VarChar,1000), * }; * parameters[0].Value = "sr_Calculate2"; * parameters[1].Value = "ID"; * parameters[2].Value = PageSize; * parameters[3].Value = PageIndex; * parameters[4].Value = 0; * parameters[5].Value = 0; * parameters[6].Value = strWhere; * return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); * }*/ #endregion 成员方法 /// <summary> /// 多人合作计算分数,根据完成人数和排名次序返回对的得分比例 ——By Jianguo Fung /// </summary> /// <param name="Cal2Model"></param> /// <returns></returns> public ZQUSR.Model.sr_Calculate2 GetScoreScale(int population, int rank) { StringBuilder strSql = new StringBuilder(); strSql.Append("select ScoreScale from sr_Calculate2 "); strSql.Append(" where Population=@Population and Rank=@Rank "); SqlParameter[] parameters = { new SqlParameter("@Population", SqlDbType.Int, 4), new SqlParameter("@Rank", SqlDbType.Int, 4) }; parameters[0].Value = population; parameters[1].Value = rank; ZQUSR.Model.sr_Calculate2 model = new ZQUSR.Model.sr_Calculate2(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { model.ScoreScale = ds.Tables[0].Rows[0]["ScoreScale"].ToString(); return(model); } else { return(null); } }
/// <summary> /// 更新比例 -By Jianguo Fung /// </summary> public void UpdateScoreScale(ZQUSR.Model.sr_Calculate2 model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update sr_Calculate2 set "); strSql.Append(" ScoreScale=@ScoreScale "); strSql.Append(" where PK_CID=@PK_CID "); SqlParameter[] parameters = { new SqlParameter("@PK_CID", SqlDbType.Int, 4), new SqlParameter("@ScoreScale", SqlDbType.NVarChar, 5) }; parameters[0].Value = model.PK_CID; parameters[1].Value = model.ScoreScale; DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); }
/// <summary> /// 得到一个对象实体 /// </summary> public ZQUSR.Model.sr_Calculate2 GetModel(int PK_CID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 PK_CID,Population,Rank,ScoreScale from sr_Calculate2 "); strSql.Append(" where PK_CID=@PK_CID "); SqlParameter[] parameters = { new SqlParameter("@PK_CID", SqlDbType.Int, 4) }; parameters[0].Value = PK_CID; ZQUSR.Model.sr_Calculate2 model = new ZQUSR.Model.sr_Calculate2(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["PK_CID"].ToString() != "") { model.PK_CID = int.Parse(ds.Tables[0].Rows[0]["PK_CID"].ToString()); } if (ds.Tables[0].Rows[0]["Population"].ToString() != "") { model.Population = int.Parse(ds.Tables[0].Rows[0]["Population"].ToString()); } if (ds.Tables[0].Rows[0]["Rank"].ToString() != "") { model.Rank = int.Parse(ds.Tables[0].Rows[0]["Rank"].ToString()); } model.ScoreScale = ds.Tables[0].Rows[0]["ScoreScale"].ToString(); return(model); } else { return(null); } }
//protected void txtNumber1_TextChanged(object sender, EventArgs e) //{ // string strName = PeriBll.GetQikanNameByISSN(txtNumber1.Text); // txtUnit.Text = strName; //} //protected void txtNumber2_TextChanged(object sender, EventArgs e) //{ // string strName = PeriBll.GetQikanNameByISSN(txtNumber2.Text); // txtStateUnit.Text = strName; //} #endregion #region 保存 private void Save(string strAuditState) { if (Session["UserID"] != null) { string cmd = Request.QueryString["cmd"].ToString(); try { if (ddlType.SelectedValue == "-1") { MessageBox.Show(this, "请选择论文类型!"); ddlType.Focus(); } else if (txtTitle.Text == "") { MessageBox.Show(this, "论文题目不能为空!"); txtTitle.Focus(); } //else if (txtNumber1.Text == "") //{ // MessageBox.Show(this, "发表刊物期刊号不能为空!"); // txtNumber1.Focus(); //} else if (txtUnit.Text == "") { MessageBox.Show(this, "发表刊物名称不能为空!"); txtUnit.Focus(); } else if (txtTime.Text == "") { MessageBox.Show(this, "发表日期不能为空!"); txtTime.Focus(); } else if (!PageValidateBll.IsDateTime(txtTime.Text)) { MessageBox.Show(this, "发表日期格式不正确!"); txtTime.Focus(); } else if (ddlState.SelectedValue == "-1") { MessageBox.Show(this, "请选择收录/转载情况!"); ddlState.Focus(); } //else if (txtNumber2.Text == "") //{ // MessageBox.Show(this, "收录/转载期刊号不能为空!"); // txtNumber2.Focus(); //} //else if (txtStateUnit.Text == "") //{ // MessageBox.Show(this, "收录/转载期刊名称不能为空!"); // txtStateUnit.Focus(); //} else if (ddlSchoolSign.SelectedValue == "-1") { MessageBox.Show(this, "请选择学校署名排名!"); ddlSchoolSign.Focus(); } else if (ddlRank.SelectedValue == "-1") { MessageBox.Show(this, "请选择完成成果排名!"); ddlRank.Focus(); } else { string strLZID = txtLZID.Text; //论文编号 string strUserID = Session["UserID"].ToString(); //用户编号 string strBigSort = "科研成果"; //大类别 string strSmallSort = "学术论文"; //小类别 string strType = ddlType.SelectedItem.Text; //论文类型 string strTitle = txtTitle.Text; //论文题目 DateTime dtAddTime = DateTime.Now; //提交时间 //string strNumber1 = txtNumber1.Text; //发表刊物期刊号 string strUnit = txtUnit.Text; //发表刊物名称 DateTime dtPublishTime = Convert.ToDateTime(txtTime.Text); //发表日期 string strState = ddlState.SelectedItem.Text; //收录/转载情况: int intRank = Convert.ToInt32(ddlRank.SelectedValue); //完成成果排名 string strSchoolSign = ddlSchoolSign.SelectedItem.Text; //学校署名排名 string strRemark = txtRemark.Text; //备注 LZJModel.PK_LZID = strLZID; //论文编号 LZJModel.FK_UserID = strUserID; //用户编号 LZJModel.BigSort = strBigSort; //大类别 LZJModel.SmallSort = strSmallSort; //小类别 LZJModel.Type = strType; //论文类型 LZJModel.Title = strTitle; //论文题目 //LZJModel.Number1 = strNumber1; //发表刊物期刊号 LZJModel.Unit = strUnit; //发表刊物名称 LZJModel.PublishTime = dtPublishTime; //发表日期 LZJModel.Rank = intRank; //完成成果排名 LZJModel.SchoolSign = strSchoolSign; //学校署名排名 LZJModel.Remark = strRemark; //备注 LZJModel.AddTime = dtAddTime; //提交时间 LZJModel.AuditState = strAuditState; //审核状态 //计算级别分 string strJiBie = ""; //级别 decimal decLevelFactor = 0; //级别分系数 decimal decJiBieScore = 0; //级别分 ///三种情况的级别和级别分系数 string jibie1 = "", jibie2 = "", jibie3 = ""; decimal levelFactor1 = 0, levelFactor2 = 0, levelFactor3 = 0; PeriModel = PeriBll.GetLunwenJiBieByQikanName(strUnit); if (PeriModel != null) { //情况一:根据发表刊物得到级别和级别分系数 jibie1 = PeriModel.JiBie; levelFactor1 = Convert.ToDecimal(PeriModel.LevelFactor); //情况二: //若为SCI收录或SSCI收录:先根据发表刊物得到影响因子,再得到级别和级别分系数 if (strState == "被SCI收录" || strState == "被SSCI收录") { decimal decQIF = Convert.ToDecimal(PeriModel.QIF); if (Convert.ToBoolean(decQIF)) { LunwenModel = LunwenBll.GetJiBieByQIF(decQIF); if (LunwenModel != null) { jibie2 = LunwenModel.JiBie; levelFactor2 = Convert.ToDecimal(LunwenModel.LevelFactor); } } } } //情况三:根据收录/转载情况得到级别和级别分系数 LunwenModel = LunwenBll.GetJiBieBySitution(strState); if (LunwenModel != null) { jibie3 = LunwenModel.JiBie; levelFactor3 = Convert.ToDecimal(LunwenModel.LevelFactor); } //比较大小 if (Convert.ToBoolean(jibie1.CompareTo(jibie2)) && Convert.ToBoolean(jibie1.CompareTo(jibie3))) { strJiBie = jibie1; decLevelFactor = levelFactor1; } else if (Convert.ToBoolean(jibie2.CompareTo(jibie1)) && Convert.ToBoolean(jibie2.CompareTo(jibie3))) { strJiBie = jibie2; decLevelFactor = levelFactor2; } else { strJiBie = jibie3; decLevelFactor = levelFactor3; } LZJModel.JiBie = strJiBie; LZJModel.LevelFactor = decLevelFactor; int intScore = LevelScoresBll.GetScoreByJiBie(strJiBie); //根据级别得到对应的级别分数 decJiBieScore = intScore * decLevelFactor; //级别分 //计算成果个人得分 int intPopulation = 1; //完成人数 string strAllAuthor = ""; //参与作者 decimal decPerScore = 0; //个人得分 //根据完成成果排名判断是否为多人合作,若是则按多人合作个人所占比例规则计算得分 //若否则成果总得分即为个人得分 if (!(intRank == -1 || intRank == 0)) { if (txtPopulation.Text == "") { MessageBox.Show(this, "完成人数不能为空!"); txtPopulation.Focus(); } else if (!PageValidateBll.IsNumber(txtPopulation.Text)) { MessageBox.Show(this, "完成人数只能填写数字!"); txtPopulation.Focus(); } else if (txtAllAuthor.Text == "") { MessageBox.Show(this, "参与作者不能为空!"); txtAllAuthor.Focus(); } else { intPopulation = Convert.ToInt32(txtPopulation.Text); strAllAuthor = txtAllAuthor.Text; //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = decJiBieScore * int1 / int2; LZJModel.Population = intPopulation; //完成人数 LZJModel.AllAuthor = strAllAuthor; //参与作者 LZJModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!LZJBll.Exists(strLZID)) { LZJBll.Add(LZJModel); } else { MessageBox.Show(this, "已经存在该记录产!"); } } if (cmd == "modify") //修改 { LZJBll.Update(LZJModel); } Response.Redirect("Thesis_List.aspx"); } } } else { decPerScore = decJiBieScore; LZJModel.Population = intPopulation; //完成人数 LZJModel.AllAuthor = strAllAuthor; //参与作者 LZJModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!LZJBll.Exists(strLZID)) { LZJBll.Add(LZJModel); } else { MessageBox.Show(this, "已经存在该记录产!"); } } if (cmd == "modify") //修改 { LZJBll.Update(LZJModel); } Response.Redirect("Thesis_List.aspx"); } } } catch (Exception ex) { throw ex; } } else { Response.Write("<script language=javascript>alert('您已经与服务器断开连接,请重新登录!');window.location.href='~/../../login.aspx';</script>"); } }
private void Save(string strAuditState) { if (Session["UserID"] != null) { string cmd = Request.QueryString["cmd"].ToString(); try { if (txtNumber.Value == "") { MessageBox.Show(this, "专利号不能为空!"); //MessageBll.Show(this, "专利号不能为空!"); txtNumber.Focus(); } else if (ddlType.SelectedValue == "-1") { MessageBox.Show(this, "专利类型不能空!"); ddlType.Focus(); } else if (txtTitle.Text == "") { MessageBox.Show(this, "成果名称不能为空!"); txtTitle.Focus(); } else if (txtUnit.Text == "") { MessageBox.Show(this, "授权单位不能为空!"); txtUnit.Focus(); } else if (txtTime.Text == "") { MessageBox.Show(this, "授权日期不能为空!"); txtTime.Focus(); } else if (!PageValidateBll.IsDateTime(txtTime.Text)) { MessageBox.Show(this, "授权日期格式不正确!"); txtTime.Focus(); } else if (ddlSchoolSign.SelectedValue == "-1") { MessageBox.Show(this, "请选择学校署名排名!"); ddlSchoolSign.Focus(); } else if (ddlRank.SelectedValue == "-1") { MessageBox.Show(this, "请选择完成成果排名!"); ddlRank.Focus(); } else { string strAID = txtAID.Text; //成果编号 string strUserID = Session["UserID"].ToString(); //用户编号 //string strBigSort = lblBigSort.Text; //大类别 //string strSmallSort = lblSmallSort.Text; //小类别 string strBigSort = "科研成果"; //大类别 string strSmallSort = "专利成果"; //小类别 string strType = ddlType.SelectedItem.Text; //专利类型 string strTitle = txtTitle.Text; //成果名称 DateTime dtAddTime = DateTime.Now; //提交时间 string strUnit = txtUnit.Text; //授权单位 DateTime dtPublishTime = Convert.ToDateTime(txtTime.Text); //授权日期 string strNumber = txtNumber.Value; //专利号 int intRank = Convert.ToInt32(ddlRank.SelectedValue); //完成成果排名 string strSchoolSign = ddlSchoolSign.SelectedItem.Text; //学校署名排名 string strRemark = txtRemark.Text; //备注 AchievementModel.PK_AID = strAID; //成果编号 AchievementModel.FK_UserID = strUserID; //用户编号 AchievementModel.BigSort = strBigSort; //大类别 AchievementModel.SmallSort = strSmallSort; //小类别 AchievementModel.Type = strType; //专利类型 AchievementModel.Title = strTitle; //成果名称 AchievementModel.AddTime = dtAddTime; //提交时间 AchievementModel.Unit = strUnit; //授权单位 AchievementModel.PublishTime = dtPublishTime; //授权日期 AchievementModel.Number = strNumber; //专利号 AchievementModel.Rank = intRank; //完成成果排名 AchievementModel.SchoolSign = strSchoolSign; //学校署名排名 AchievementModel.Remark = strRemark; //备注 AchievementModel.AuditState = strAuditState; //审核状态 //计算专利成果总得分 EvaluateModel = EvaluateBll.GetZhuanLiJiBie(AchievementModel); string strJiBie = ""; //级别 decimal decLevelFactor = 0; //级别分系数 decimal decScore = 0; //成果总得分 if (EvaluateModel != null) { strJiBie = EvaluateModel.JiBie; decLevelFactor = Convert.ToDecimal(EvaluateModel.LevelFactor); int intScore = LevelScoresBll.GetScoreByJiBie(strJiBie); //根据级别得到对应的级别分数 decScore = intScore * decLevelFactor; } AchievementModel.JiBie = strJiBie; //级别 AchievementModel.LevelFactor = decLevelFactor; //级别分系数 //计算专利成果个人得分 int intPopulation = 1; //完成人数 string strAllAuthor = ""; //参与作者 decimal decPerScore = 0; //个人得分 //根据完成成果排名判断是否为多人合作,若是则按多人合作个人所占比例规则计算得分 //若否则成果总得分即为个人得分 if (!(intRank == -1 || intRank == 0)) { if (txtPopulation.Text == "") { MessageBox.Show(this, "完成人数不能为空!"); txtPopulation.Focus(); } else if (!PageValidateBll.IsNumber(txtPopulation.Text)) { MessageBox.Show(this, "完成人数只能填写数字!"); txtPopulation.Focus(); } else if (txtAllAuthor.Text == "") { MessageBox.Show(this, "参与作者不能为空!"); txtAllAuthor.Focus(); } else { intPopulation = Convert.ToInt32(txtPopulation.Text); strAllAuthor = txtAllAuthor.Text; //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = decScore * int1 / int2; AchievementModel.Population = intPopulation; //完成人数 AchievementModel.AllAuthor = strAllAuthor; //参与作者 AchievementModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!AchievementBll.Exists(strAID)) { AchievementBll.Add(AchievementModel); } else { MessageBox.Show(this, "已经存在该记录"); } } if (cmd == "modify") //修改 { AchievementBll.Update(AchievementModel); } Response.Redirect("ZhuanLi_List.aspx"); } } } else { decPerScore = decScore; AchievementModel.Population = intPopulation; //完成人数 AchievementModel.AllAuthor = strAllAuthor; //参与作者 AchievementModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!AchievementBll.Exists(strAID)) { AchievementBll.Add(AchievementModel); } else { MessageBox.Show(this, "已经存在该记录"); } } if (cmd == "modify") //修改 { AchievementBll.Update(AchievementModel); } Response.Redirect("ZhuanLi_List.aspx"); } } } catch (Exception ex) { throw ex; } } else { Response.Write("<script language=javascript>alert('您已经与服务器断开连接,请重新登录!');window.location.href='~/../../login.aspx';</script>"); } }
/// <summary> /// ���˺��������������������������������ضԵĵ÷ֱ��� ����By Jianguo Fung /// </summary> /// <param name="Cal2Model"></param> /// <returns></returns> public ZQUSR.Model.sr_Calculate2 GetScoreScale(int population, int rank) { StringBuilder strSql = new StringBuilder(); strSql.Append("select ScoreScale from sr_Calculate2 "); strSql.Append(" where Population=@Population and Rank=@Rank "); SqlParameter[] parameters = { new SqlParameter("@Population", SqlDbType.Int,4), new SqlParameter("@Rank", SqlDbType.Int,4)}; parameters[0].Value = population; parameters[1].Value = rank; ZQUSR.Model.sr_Calculate2 model = new ZQUSR.Model.sr_Calculate2(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { model.ScoreScale = ds.Tables[0].Rows[0]["ScoreScale"].ToString(); return model; } else { return null; } }
/// <summary> /// �õ�һ������ʵ�� /// </summary> public ZQUSR.Model.sr_Calculate2 GetModel(int PK_CID) { StringBuilder strSql=new StringBuilder(); strSql.Append("select top 1 PK_CID,Population,Rank,ScoreScale from sr_Calculate2 "); strSql.Append(" where PK_CID=@PK_CID "); SqlParameter[] parameters = { new SqlParameter("@PK_CID", SqlDbType.Int,4)}; parameters[0].Value = PK_CID; ZQUSR.Model.sr_Calculate2 model=new ZQUSR.Model.sr_Calculate2(); DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); if(ds.Tables[0].Rows.Count>0) { if(ds.Tables[0].Rows[0]["PK_CID"].ToString()!="") { model.PK_CID=int.Parse(ds.Tables[0].Rows[0]["PK_CID"].ToString()); } if(ds.Tables[0].Rows[0]["Population"].ToString()!="") { model.Population=int.Parse(ds.Tables[0].Rows[0]["Population"].ToString()); } if(ds.Tables[0].Rows[0]["Rank"].ToString()!="") { model.Rank=int.Parse(ds.Tables[0].Rows[0]["Rank"].ToString()); } model.ScoreScale=ds.Tables[0].Rows[0]["ScoreScale"].ToString(); return model; } else { return null; } }
protected void btnOK_Click(object sender, EventArgs e) { decimal decLevelFactor = Convert.ToDecimal(txtLevelFactor.Text); //级别分系数 string strJiBie = ddlJiBie.SelectedValue; //级别 int intScore = LevelScoresBll.GetScoreByJiBie(strJiBie); //根据级别得到对应的级别分数 decimal decJiBieScore = intScore * decLevelFactor; //级别分 string strID = lblSRID.Text.Trim(); string strResult = strID.Substring(0, 2); if (strResult == "LW") //学术论文 { decimal decPerScore = 0; LZJModel = LZJBll.GetModel(strID); int intRank = Convert.ToInt32(LZJModel.Rank); int intPopulation = Convert.ToInt32(LZJModel.Population); //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = decJiBieScore * int1 / int2; } //更新级别分系数、级别、个人得分 LZJModel.PK_LZID = strID; LZJModel.LevelFactor = decLevelFactor; LZJModel.JiBie = strJiBie; LZJModel.PerScore = decPerScore; } else if (strResult == "ZZ") //学术著作 { decimal decPerScore = 0; LZJModel = LZJBll.GetModel(strID); int intRank = Convert.ToInt32(LZJModel.Rank); int intPopulation = Convert.ToInt32(LZJModel.Population); //计算字数分 decimal decWord = Convert.ToDecimal(LZJModel.Word); WordsFundsModel = WordsFundsBll.GetModel("学术著作"); decimal decWordScore = 0; //字数分 if (decWord <= WordsFundsModel.Digit2) { decWordScore = decWord * Convert.ToDecimal(WordsFundsModel.Digit1); } else if (decWord > WordsFundsModel.Digit2) { decWordScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + Convert.ToDecimal(decWord - WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit3); } //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = (decJiBieScore + decWordScore) * int1 / int2; } //更新级别分系数、级别、个人得分 LZJModel.PK_LZID = strID; LZJModel.LevelFactor = decLevelFactor; LZJModel.JiBie = strJiBie; LZJModel.PerScore = decPerScore; } else if (strResult == "KY") //科研项目 { decimal decPerScore = 0; ProModel = ProBll.GetModel(strID); int intRank = Convert.ToInt32(ProModel.Anchorperson); int intPopulation = Convert.ToInt32(ProModel.Population); //计算经费分 decimal decFundScore = 0; string strSmallSort = ProModel.SmallSort; string strType = ProModel.Type; decimal decFunds1 = Convert.ToDecimal(ProModel.Funds1); WordsFundsModel = WordsFundsBll.GetModel(strSmallSort, strType);; if (decFunds1 <= WordsFundsModel.Digit2) { decFundScore = decFunds1 * Convert.ToDecimal(WordsFundsModel.Digit1); } else if (decFunds1 > WordsFundsModel.Digit2 && decFunds1 <= WordsFundsModel.Digit4) { decFundScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + (decFunds1 - Convert.ToDecimal(WordsFundsModel.Digit2)) * Convert.ToDecimal(WordsFundsModel.Digit3); } else if (decFunds1 > WordsFundsModel.Digit4 && decFunds1 <= WordsFundsModel.Digit6) { decFundScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + (Convert.ToDecimal(WordsFundsModel.Digit4) - Convert.ToDecimal(WordsFundsModel.Digit2)) * Convert.ToDecimal(WordsFundsModel.Digit3) + (decFunds1 - Convert.ToDecimal(WordsFundsModel.Digit4)) * Convert.ToDecimal(WordsFundsModel.Digit5); } else if (decFunds1 > 100) { decFundScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + (Convert.ToDecimal(WordsFundsModel.Digit4) - Convert.ToDecimal(WordsFundsModel.Digit2)) * Convert.ToDecimal(WordsFundsModel.Digit3) + (Convert.ToDecimal(WordsFundsModel.Digit6) - Convert.ToDecimal(WordsFundsModel.Digit4)) * Convert.ToDecimal(WordsFundsModel.Digit5) + (decFunds1 - Convert.ToDecimal(WordsFundsModel.Digit6)) * Convert.ToDecimal(WordsFundsModel.Digit7); } //计算个人得分 decimal decScale = Cal3Bll.GetProjectScale("是"); int intAnchorperson = Convert.ToInt32(ProModel.Anchorperson); if (intAnchorperson == 0) //是否项目主持人 { decPerScore = (decJiBieScore + decFundScore) * decScale; } else { decPerScore = (decJiBieScore + decFundScore) * (1 - decScale) / (intPopulation - 1); } //更新级别分系数、级别、个人得分 ProModel.PK_PID = strID; ProModel.LevelFactor = decLevelFactor; ProModel.JiBie = strJiBie; ProModel.PerScore = decPerScore; } else if (strResult == "SB") //项目申报 { decimal decPerScore = 0; ProModel = ProBll.GetModel(strID); int intRank = Convert.ToInt32(ProModel.Anchorperson); int intPopulation = Convert.ToInt32(ProModel.Population); //计算个人得分 decimal decScale = Cal3Bll.GetProjectScale("是"); int intAnchorperson = Convert.ToInt32(ProModel.Anchorperson); if (intAnchorperson == 0) //是否项目主持人 { decPerScore = decJiBieScore * decScale; } else { decPerScore = decJiBieScore * (1 - decScale) / (intPopulation - 1); } //更新级别分系数、级别、个人得分 ProModel.PK_PID = strID; ProModel.LevelFactor = decLevelFactor; ProModel.JiBie = strJiBie; ProModel.PerScore = decPerScore; } else //其他类别 { decimal decPerScore = 0; AchievementModel = AchievementBll.GetModel(strID); int intRank = Convert.ToInt32(AchievementModel.Rank); int intPopulation = Convert.ToInt32(AchievementModel.Population); //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = decJiBieScore * int1 / int2; } //更新级别分系数、级别、个人得分 AchievementModel.PK_AID = strID; AchievementModel.LevelFactor = decLevelFactor; AchievementModel.JiBie = strJiBie; AchievementModel.PerScore = decPerScore; AchievementBll.UpdateJiBie(AchievementModel); } Response.Write("<script language=javascript>opener.location.reload();window.close();</script>"); }
private void Save(string strAuditState) { if (Session["UserID"] != null) { string cmd = Request.QueryString["cmd"].ToString(); try { if (ddlType.SelectedValue == "-1") { MessageBox.Show(this, "请选择著作类型!"); ddlType.Focus(); } else if (txtTitle.Text == "") { MessageBox.Show(this, "著作名称不能为空!"); txtTitle.Focus(); } else if (txtUnit.Text == "") { MessageBox.Show(this, "出版单位不能为空!"); txtUnit.Focus(); } else if (txtTime.Text == "") { MessageBox.Show(this, "出版日期不能为空!"); txtTime.Focus(); } else if (!PageValidateBll.IsDateTime(txtTime.Text)) { MessageBox.Show(this, "出版日期格式不正确!"); txtTime.Focus(); } else if (ddlSource.SelectedValue == "-1") { MessageBox.Show(this, "请选择来源!"); ddlSource.Focus(); } //else if (txtISBN.Text == "") //{ // MessageBox.Show(this, "ISBN号不能为空!"); // txtISBN.Focus(); //} else if (txtWord.Text == "") { MessageBox.Show(this, "字数不能为空!"); txtWord.Focus(); } else if (ddlSchoolSign.SelectedValue == "-1") { MessageBox.Show(this, "请选择学校署名排名!"); ddlSchoolSign.Focus(); } else if (ddlRank.SelectedValue == "-1") { MessageBox.Show(this, "请选择完成成果排名!"); ddlRank.Focus(); } else { string strLZID = txtLZID.Text; //著作编号 string strUserID = Session["UserID"].ToString(); //用户编号 string strBigSort = "科研成果"; //大类别 string strSmallSort = "学术著作"; //小类别 string strType = ddlType.SelectedItem.Text; //著作类型 string strTitle = txtTitle.Text; //著作名称 DateTime dtAddTime = DateTime.Now; //提交时间 string strUnit = txtUnit.Text; //出版单位 string strSource = ddlSource.SelectedItem.Text; //来源 DateTime dtPublishTime = Convert.ToDateTime(txtTime.Text); //出版日期 //string strNumber = txtISBN.Text; //ISBN号 int intRank = Convert.ToInt32(ddlRank.SelectedValue); //完成成果排名 string strSchoolSign = ddlSchoolSign.SelectedItem.Text; //学校署名排名 decimal decWord = decimal.Parse(txtWord.Text); //字数 string strRemark = txtRemark.Text; //备注 LZJModel.PK_LZID = strLZID; //著作编号 LZJModel.FK_UserID = strUserID; //用户编号 LZJModel.BigSort = strBigSort; //大类别 LZJModel.SmallSort = strSmallSort; //小类别 LZJModel.Type = strType; //著作类型 LZJModel.Title = strTitle; //著作名称 LZJModel.Unit = strUnit; //出版单位 LZJModel.Source = strSource; //来源 LZJModel.PublishTime = dtPublishTime; //出版日期 //LZJModel.Number1 = strNumber; //ISBN号 LZJModel.Rank = intRank; //完成成果排名 LZJModel.SchoolSign = strSchoolSign; //学校署名排名 LZJModel.Word = decWord; //字数 LZJModel.Remark = strRemark; //备注 LZJModel.AddTime = dtAddTime; //提交时间 LZJModel.AuditState = strAuditState; //审核状态 //计算级别分 EvaluateModel = EvaluateBll.GetZhuZuoJiBie(LZJModel); string strJiBie = ""; //级别 decimal decLevelFactor = 0; //级别分系数 decimal decJiBieScore = 0; //级别分 if (EvaluateModel != null) { strJiBie = EvaluateModel.JiBie; decLevelFactor = Convert.ToDecimal(EvaluateModel.LevelFactor); LZJModel.JiBie = strJiBie; //级别 LZJModel.LevelFactor = decLevelFactor; //级别分系数 int intScore = LevelScoresBll.GetScoreByJiBie(strJiBie); //根据级别得到对应的级别分数 decJiBieScore = intScore * decLevelFactor; //级别分 } //计算字数分 WordsFundsModel = WordsFundsBll.GetModel("学术著作"); decimal decWordScore = 0; if (decWord <= WordsFundsModel.Digit2) { decWordScore = decWord * Convert.ToDecimal(WordsFundsModel.Digit1); } else if (decWord > WordsFundsModel.Digit2) { decWordScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + Convert.ToDecimal(decWord - WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit3); } //计算成果个人得分 int intPopulation = 1; //完成人数 string strAllAuthor = ""; //参与作者 decimal decPerScore = 0; //个人得分 //根据完成成果排名判断是否为多人合作,若是则按多人合作个人所占比例规则计算得分 //若否则成果总得分即为个人得分 if (!(intRank == -1 || intRank == 0)) { if (txtPopulation.Text == "") { MessageBox.Show(this, "完成人数不能为空!"); txtPopulation.Focus(); } else if (!PageValidateBll.IsNumber(txtPopulation.Text)) { MessageBox.Show(this, "完成人数只能填写数字!"); txtPopulation.Focus(); } else if (txtAllAuthor.Text == "") { MessageBox.Show(this, "参与作者不能为空!"); txtAllAuthor.Focus(); } else { intPopulation = Convert.ToInt32(txtPopulation.Text); strAllAuthor = txtAllAuthor.Text; //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = (decJiBieScore + decWordScore) * int1 / int2; //个人得分=(级别分+字数分) * 比例 LZJModel.Population = intPopulation; //完成人数 LZJModel.AllAuthor = strAllAuthor; //参与作者 LZJModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!LZJBll.Exists(strLZID)) { LZJBll.Add(LZJModel); } else { MessageBox.Show(this, "已经存在该记录产!"); } } if (cmd == "modify") //修改 { LZJBll.Update(LZJModel); } Response.Redirect("ZhuZuo_List.aspx"); } } } else { decPerScore = decJiBieScore + decWordScore; LZJModel.Population = intPopulation; //完成人数 LZJModel.AllAuthor = strAllAuthor; //参与作者 LZJModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!LZJBll.Exists(strLZID)) { LZJBll.Add(LZJModel); } else { MessageBox.Show(this, "已经存在该记录产!"); } } if (cmd == "modify") //修改 { LZJBll.Update(LZJModel); } Response.Redirect("ZhuZuo_List.aspx"); } } } catch (Exception ex) { throw ex; } } else { Response.Write("<script language=javascript>alert('您已经与服务器断开连接,请重新登录!');window.location.href='~/../../login.aspx';</script>"); } }
private void Save(string strAuditState) { if (Session["UserID"] != null) { string cmd = Request.QueryString["cmd"].ToString(); try { if (ddlType.SelectedValue == "-1") { MessageBox.Show(this, "请选择论文类型!"); ddlType.Focus(); } else if (txtTitle.Text == "") { MessageBox.Show(this, "论文题目不能为空!"); txtTitle.Focus(); } //else if (txtNumber1.Text == "") //{ // MessageBox.Show(this, "发表刊物期刊号不能为空!"); // txtNumber1.Focus(); //} else if (txtUnit.Text == "") { MessageBox.Show(this, "发表刊物名称不能为空!"); txtUnit.Focus(); } else if (txtTime.Text == "") { MessageBox.Show(this, "发表日期不能为空!"); txtTime.Focus(); } else if (!PageValidateBll.IsDateTime(txtTime.Text)) { MessageBox.Show(this, "发表日期格式不正确!"); txtTime.Focus(); } else if (ddlState.SelectedValue == "-1") { MessageBox.Show(this, "请选择收录/转载情况!"); ddlState.Focus(); } //else if (txtNumber2.Text == "") //{ // MessageBox.Show(this, "收录/转载期刊号不能为空!"); // txtNumber2.Focus(); //} //else if (txtStateUnit.Text == "") //{ // MessageBox.Show(this, "收录/转载期刊名称不能为空!"); // txtStateUnit.Focus(); //} else if (ddlSchoolSign.SelectedValue == "-1") { MessageBox.Show(this, "请选择学校署名排名!"); ddlSchoolSign.Focus(); } else if (ddlRank.SelectedValue == "-1") { MessageBox.Show(this, "请选择完成成果排名!"); ddlRank.Focus(); } else { string strLZID = txtLZID.Text; //论文编号 string strUserID = Session["UserID"].ToString(); //用户编号 string strBigSort = "科研成果"; //大类别 string strSmallSort = "学术论文"; //小类别 string strType = ddlType.SelectedItem.Text; //论文类型 string strTitle = txtTitle.Text; //论文题目 DateTime dtAddTime = DateTime.Now; //提交时间 //string strNumber1 = txtNumber1.Text; //发表刊物期刊号 string strUnit = txtUnit.Text; //发表刊物名称 DateTime dtPublishTime = Convert.ToDateTime(txtTime.Text); //发表日期 string strState = ddlState.SelectedItem.Text; //收录/转载情况: int intRank = Convert.ToInt32(ddlRank.SelectedValue); //完成成果排名 string strSchoolSign = ddlSchoolSign.SelectedItem.Text; //学校署名排名 string strRemark = txtRemark.Text; //备注 LZJModel.PK_LZID = strLZID; //论文编号 LZJModel.FK_UserID = strUserID; //用户编号 LZJModel.BigSort = strBigSort; //大类别 LZJModel.SmallSort = strSmallSort; //小类别 LZJModel.Type = strType; //论文类型 LZJModel.Title = strTitle; //论文题目 //LZJModel.Number1 = strNumber1; //发表刊物期刊号 LZJModel.Unit = strUnit; //发表刊物名称 LZJModel.PublishTime = dtPublishTime; //发表日期 LZJModel.Rank = intRank; //完成成果排名 LZJModel.SchoolSign = strSchoolSign; //学校署名排名 LZJModel.Remark = strRemark; //备注 LZJModel.AddTime = dtAddTime; //提交时间 LZJModel.AuditState = strAuditState; //审核状态 //计算级别分 string strJiBie = ""; //级别 decimal decLevelFactor = 0; //级别分系数 decimal decJiBieScore = 0; //级别分 ///三种情况的级别和级别分系数 string jibie1="",jibie2="",jibie3=""; decimal levelFactor1=0, levelFactor2=0, levelFactor3=0; PeriModel = PeriBll.GetLunwenJiBieByQikanName(strUnit); if (PeriModel != null) { //情况一:根据发表刊物得到级别和级别分系数 jibie1 = PeriModel.JiBie; levelFactor1 = Convert.ToDecimal(PeriModel.LevelFactor); //情况二: //若为SCI收录或SSCI收录:先根据发表刊物得到影响因子,再得到级别和级别分系数 if (strState == "被SCI收录" || strState == "被SSCI收录") { decimal decQIF = Convert.ToDecimal(PeriModel.QIF); if (Convert.ToBoolean(decQIF)) { LunwenModel = LunwenBll.GetJiBieByQIF(decQIF); if (LunwenModel != null) { jibie2 = LunwenModel.JiBie; levelFactor2 = Convert.ToDecimal(LunwenModel.LevelFactor); } } } } //情况三:根据收录/转载情况得到级别和级别分系数 LunwenModel = LunwenBll.GetJiBieBySitution(strState); if (LunwenModel != null) { jibie3 = LunwenModel.JiBie; levelFactor3 = Convert.ToDecimal(LunwenModel.LevelFactor); } //比较大小 if (Convert.ToBoolean(jibie1.CompareTo(jibie2)) && Convert.ToBoolean(jibie1.CompareTo(jibie3))) { strJiBie = jibie1; decLevelFactor = levelFactor1; } else if (Convert.ToBoolean(jibie2.CompareTo(jibie1)) && Convert.ToBoolean(jibie2.CompareTo(jibie3))) { strJiBie = jibie2; decLevelFactor = levelFactor2; } else { strJiBie = jibie3; decLevelFactor = levelFactor3; } LZJModel.JiBie = strJiBie; LZJModel.LevelFactor = decLevelFactor; int intScore = LevelScoresBll.GetScoreByJiBie(strJiBie); //根据级别得到对应的级别分数 decJiBieScore = intScore * decLevelFactor; //级别分 //计算成果个人得分 int intPopulation = 1; //完成人数 string strAllAuthor = ""; //参与作者 decimal decPerScore = 0; //个人得分 //根据完成成果排名判断是否为多人合作,若是则按多人合作个人所占比例规则计算得分 //若否则成果总得分即为个人得分 if (!(intRank == -1 || intRank == 0)) { if (txtPopulation.Text == "") { MessageBox.Show(this, "完成人数不能为空!"); txtPopulation.Focus(); } else if (!PageValidateBll.IsNumber(txtPopulation.Text)) { MessageBox.Show(this, "完成人数只能填写数字!"); txtPopulation.Focus(); } else if (txtAllAuthor.Text == "") { MessageBox.Show(this, "参与作者不能为空!"); txtAllAuthor.Focus(); } else { intPopulation = Convert.ToInt32(txtPopulation.Text); strAllAuthor = txtAllAuthor.Text; //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = decJiBieScore * int1 / int2; LZJModel.Population = intPopulation; //完成人数 LZJModel.AllAuthor = strAllAuthor; //参与作者 LZJModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!LZJBll.Exists(strLZID)) { LZJBll.Add(LZJModel); } else { MessageBox.Show(this, "已经存在该记录产!"); } } if (cmd == "modify") //修改 { LZJBll.Update(LZJModel); } Response.Redirect("Thesis_List.aspx"); } } } else { decPerScore = decJiBieScore; LZJModel.Population = intPopulation; //完成人数 LZJModel.AllAuthor = strAllAuthor; //参与作者 LZJModel.PerScore = decPerScore; //个人得分 if (cmd == "add") //新增 { if (!LZJBll.Exists(strLZID)) { LZJBll.Add(LZJModel); } else { MessageBox.Show(this, "已经存在该记录产!"); } } if (cmd == "modify") //修改 { LZJBll.Update(LZJModel); } Response.Redirect("Thesis_List.aspx"); } } } catch (Exception ex) { throw ex; } } else { Response.Write("<script language=javascript>alert('您已经与服务器断开连接,请重新登录!');window.location.href='~/../../login.aspx';</script>"); } }
protected void btnOK_Click(object sender, EventArgs e) { decimal decLevelFactor = Convert.ToDecimal(txtLevelFactor.Text); //级别分系数 string strJiBie = ddlJiBie.SelectedValue; //级别 int intScore = LevelScoresBll.GetScoreByJiBie(strJiBie); //根据级别得到对应的级别分数 decimal decJiBieScore = intScore * decLevelFactor; //级别分 string strID = lblSRID.Text.Trim(); string strResult = strID.Substring(0, 2); if (strResult == "LW") //学术论文 { decimal decPerScore = 0; LZJModel = LZJBll.GetModel(strID); int intRank = Convert.ToInt32(LZJModel.Rank); int intPopulation = Convert.ToInt32(LZJModel.Population); //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = decJiBieScore * int1 / int2; } //更新级别分系数、级别、个人得分 LZJModel.PK_LZID = strID; LZJModel.LevelFactor = decLevelFactor; LZJModel.JiBie = strJiBie; LZJModel.PerScore = decPerScore; } else if (strResult == "ZZ") //学术著作 { decimal decPerScore = 0; LZJModel = LZJBll.GetModel(strID); int intRank = Convert.ToInt32(LZJModel.Rank); int intPopulation = Convert.ToInt32(LZJModel.Population); //计算字数分 decimal decWord = Convert.ToDecimal(LZJModel.Word); WordsFundsModel = WordsFundsBll.GetModel("学术著作"); decimal decWordScore = 0; //字数分 if (decWord <= WordsFundsModel.Digit2) { decWordScore = decWord * Convert.ToDecimal(WordsFundsModel.Digit1); } else if (decWord > WordsFundsModel.Digit2) { decWordScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + Convert.ToDecimal(decWord - WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit3); } //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = (decJiBieScore+decWordScore) * int1 / int2; } //更新级别分系数、级别、个人得分 LZJModel.PK_LZID = strID; LZJModel.LevelFactor = decLevelFactor; LZJModel.JiBie = strJiBie; LZJModel.PerScore = decPerScore; } else if (strResult == "KY") //科研项目 { decimal decPerScore = 0; ProModel = ProBll.GetModel(strID); int intRank = Convert.ToInt32(ProModel.Anchorperson); int intPopulation = Convert.ToInt32(ProModel.Population); //计算经费分 decimal decFundScore = 0; string strSmallSort = ProModel.SmallSort; string strType = ProModel.Type; decimal decFunds1 = Convert.ToDecimal(ProModel.Funds1); WordsFundsModel = WordsFundsBll.GetModel(strSmallSort, strType); ; if (decFunds1 <= WordsFundsModel.Digit2) { decFundScore = decFunds1 * Convert.ToDecimal(WordsFundsModel.Digit1); } else if (decFunds1 > WordsFundsModel.Digit2 && decFunds1 <= WordsFundsModel.Digit4) { decFundScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + (decFunds1 - Convert.ToDecimal(WordsFundsModel.Digit2)) * Convert.ToDecimal(WordsFundsModel.Digit3); } else if (decFunds1 > WordsFundsModel.Digit4 && decFunds1 <= WordsFundsModel.Digit6) { decFundScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + (Convert.ToDecimal(WordsFundsModel.Digit4) - Convert.ToDecimal(WordsFundsModel.Digit2)) * Convert.ToDecimal(WordsFundsModel.Digit3) + (decFunds1 - Convert.ToDecimal(WordsFundsModel.Digit4)) * Convert.ToDecimal(WordsFundsModel.Digit5); } else if (decFunds1 > 100) { decFundScore = Convert.ToDecimal(WordsFundsModel.Digit2) * Convert.ToDecimal(WordsFundsModel.Digit1) + (Convert.ToDecimal(WordsFundsModel.Digit4) - Convert.ToDecimal(WordsFundsModel.Digit2)) * Convert.ToDecimal(WordsFundsModel.Digit3) + (Convert.ToDecimal(WordsFundsModel.Digit6) - Convert.ToDecimal(WordsFundsModel.Digit4)) * Convert.ToDecimal(WordsFundsModel.Digit5) + (decFunds1 - Convert.ToDecimal(WordsFundsModel.Digit6)) * Convert.ToDecimal(WordsFundsModel.Digit7); } //计算个人得分 decimal decScale = Cal3Bll.GetProjectScale("是"); int intAnchorperson = Convert.ToInt32(ProModel.Anchorperson); if (intAnchorperson == 0) //是否项目主持人 { decPerScore = (decJiBieScore + decFundScore) * decScale; } else { decPerScore = (decJiBieScore + decFundScore) * (1 - decScale) / (intPopulation - 1); } //更新级别分系数、级别、个人得分 ProModel.PK_PID = strID; ProModel.LevelFactor = decLevelFactor; ProModel.JiBie = strJiBie; ProModel.PerScore = decPerScore; } else if (strResult == "SB") //项目申报 { decimal decPerScore = 0; ProModel = ProBll.GetModel(strID); int intRank = Convert.ToInt32(ProModel.Anchorperson); int intPopulation = Convert.ToInt32(ProModel.Population); //计算个人得分 decimal decScale = Cal3Bll.GetProjectScale("是"); int intAnchorperson = Convert.ToInt32(ProModel.Anchorperson); if (intAnchorperson == 0) //是否项目主持人 { decPerScore = decJiBieScore * decScale; } else { decPerScore = decJiBieScore * (1 - decScale) / (intPopulation - 1); } //更新级别分系数、级别、个人得分 ProModel.PK_PID = strID; ProModel.LevelFactor = decLevelFactor; ProModel.JiBie = strJiBie; ProModel.PerScore = decPerScore; } else //其他类别 { decimal decPerScore = 0; AchievementModel = AchievementBll.GetModel(strID); int intRank = Convert.ToInt32(AchievementModel.Rank); int intPopulation = Convert.ToInt32(AchievementModel.Population); //根据完成人数和完成成果排名返回对应的得分比例 Cal2Model = Cal2Bll.GetScoreScale(intPopulation, intRank); if (Cal2Model != null) { string strScale = Cal2Model.ScoreScale; string[] str = strScale.Split('/'); int int1 = int.Parse(str[0]); int int2 = int.Parse(str[1]); decPerScore = decJiBieScore * int1 / int2; } //更新级别分系数、级别、个人得分 AchievementModel.PK_AID = strID; AchievementModel.LevelFactor = decLevelFactor; AchievementModel.JiBie = strJiBie; AchievementModel.PerScore = decPerScore; AchievementBll.UpdateJiBie(AchievementModel); } Response.Write("<script language=javascript>opener.location.reload();window.close();</script>"); }