Exemplo n.º 1
0
        /// <summary>
        /// 根据影响因子(QIF)返回级别(JiBie)和级别分系数(LevelFactor)   -By Jianguo Fung
        /// </summary>
        public ZQUSR.Model.sr_Lunwen GetJiBieByQIF(decimal QIF)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 JiBie,LevelFactor from sr_Lunwen ");
            strSql.Append(" where @QIF>Factor1-0.0001 and @QIF<Factor2 ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@QIF", SqlDbType.Decimal, 8)
            };
            parameters[0].Value = QIF;

            ZQUSR.Model.sr_Lunwen model = new ZQUSR.Model.sr_Lunwen();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.JiBie = ds.Tables[0].Rows[0]["JiBie"].ToString();
                if (ds.Tables[0].Rows[0]["LevelFactor"].ToString() != "")
                {
                    model.LevelFactor = decimal.Parse(ds.Tables[0].Rows[0]["LevelFactor"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据收录转载情况(Sitution)返回级别(JiBie)和级别分系数(LevelFactor)   -By Jianguo Fung
        /// </summary>
        public ZQUSR.Model.sr_Lunwen GetJiBieBySitution(string Situation)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 JiBie,LevelFactor from sr_Lunwen ");
            strSql.Append(" where Situation=@Situation");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Situation", SqlDbType.NVarChar, 100)
            };
            parameters[0].Value = Situation;

            ZQUSR.Model.sr_Lunwen model = new ZQUSR.Model.sr_Lunwen();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.JiBie = ds.Tables[0].Rows[0]["JiBie"].ToString();
                if (ds.Tables[0].Rows[0]["LevelFactor"].ToString() != "")
                {
                    model.LevelFactor = decimal.Parse(ds.Tables[0].Rows[0]["LevelFactor"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ZQUSR.Model.sr_Lunwen GetModel(int PK_LID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 PK_LID,Type,Situation,Factor1,Factor2,JiBie,LevelFactor,Extra1,Extra2 from sr_Lunwen ");
            strSql.Append(" where PK_LID=@PK_LID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PK_LID", SqlDbType.Int, 4)
            };
            parameters[0].Value = PK_LID;

            ZQUSR.Model.sr_Lunwen model = new ZQUSR.Model.sr_Lunwen();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["PK_LID"].ToString() != "")
                {
                    model.PK_LID = int.Parse(ds.Tables[0].Rows[0]["PK_LID"].ToString());
                }
                model.Type      = ds.Tables[0].Rows[0]["Type"].ToString();
                model.Situation = ds.Tables[0].Rows[0]["Situation"].ToString();
                if (ds.Tables[0].Rows[0]["Factor1"].ToString() != "")
                {
                    model.Factor1 = decimal.Parse(ds.Tables[0].Rows[0]["Factor1"].ToString());
                    //model.Factor1 = ds.Tables[0].Rows[0]["Factor1"].ToString();    //---by caiyuying
                }
                if (ds.Tables[0].Rows[0]["Factor2"].ToString() != "")
                {
                    model.Factor2 = decimal.Parse(ds.Tables[0].Rows[0]["Factor2"].ToString());
                    //model.Factor2 = ds.Tables[0].Rows[0]["Factor2"].ToString();     //---by caiyuying
                }
                model.JiBie = ds.Tables[0].Rows[0]["JiBie"].ToString();
                if (ds.Tables[0].Rows[0]["LevelFactor"].ToString() != "")
                {
                    model.LevelFactor = decimal.Parse(ds.Tables[0].Rows[0]["LevelFactor"].ToString());
                    //model.LevelFactor = ds.Tables[0].Rows[0]["LevelFactor"].ToString();    //---by caiyuying
                }
                model.Extra1 = ds.Tables[0].Rows[0]["Extra1"].ToString();
                model.Extra2 = ds.Tables[0].Rows[0]["Extra2"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 是否存在该记录(Type/Situation)-By Jianguo Fung
        /// </summary>
        public bool Exists(ZQUSR.Model.sr_Lunwen model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from sr_Lunwen");
            strSql.Append(" where Type=@Type and ");
            strSql.Append("  Situation=@Situation ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Type",      SqlDbType.Char,     10),
                new SqlParameter("@Situation", SqlDbType.NVarChar, 100)
            };
            parameters[0].Value = model.Type;
            parameters[1].Value = model.Situation;

            return(DbHelperSQL.Exists(strSql.ToString(), parameters));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新级别和级别分系数 -By Jianguo Fung
        /// </summary>
        /// <param name="model"></param>
        public void UpdateJiBie(ZQUSR.Model.sr_Lunwen model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update sr_Lunwen set ");
            strSql.Append("JiBie=@JiBie,");
            strSql.Append("LevelFactor=@LevelFactor ");
            strSql.Append(" where PK_LID=@PK_LID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PK_LID",      SqlDbType.Int,   4),
                new SqlParameter("@JiBie",       SqlDbType.Char,  1),
                new SqlParameter("@LevelFactor", SqlDbType.Float, 8)
            };
            parameters[0].Value = model.PK_LID;
            parameters[1].Value = model.JiBie;
            parameters[2].Value = model.LevelFactor;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ZQUSR.Model.sr_Lunwen model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into sr_Lunwen(");
            strSql.Append("Type,Situation,Factor1,Factor2,JiBie,LevelFactor,Extra1,Extra2)");
            strSql.Append(" values (");
            strSql.Append("@Type,@Situation,@Factor1,@Factor2,@JiBie,@LevelFactor,@Extra1,@Extra2)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Type",        SqlDbType.NVarChar,  10),
                new SqlParameter("@Situation",   SqlDbType.NVarChar, 100),
                new SqlParameter("@Factor1",     SqlDbType.Float,      8),
                new SqlParameter("@Factor2",     SqlDbType.Float,      8),
                new SqlParameter("@JiBie",       SqlDbType.Char,       1),
                new SqlParameter("@LevelFactor", SqlDbType.Float,      8),
                new SqlParameter("@Extra1",      SqlDbType.NVarChar,  10),
                new SqlParameter("@Extra2",      SqlDbType.NVarChar, 10)
            };
            parameters[0].Value = model.Type;
            parameters[1].Value = model.Situation;
            parameters[2].Value = model.Factor1;
            parameters[3].Value = model.Factor2;
            parameters[4].Value = model.JiBie;
            parameters[5].Value = model.LevelFactor;
            parameters[6].Value = model.Extra1;
            parameters[7].Value = model.Extra2;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 更新一条数据   modify by caiyuying  2011-01-20
        /// </summary>
        public void Update(ZQUSR.Model.sr_Lunwen model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update sr_Lunwen set ");
            //strSql.Append("Type=@Type,");
            strSql.Append("Situation=@Situation,");
            strSql.Append("Factor1=@Factor1,");
            strSql.Append("Factor2=@Factor2,");
            strSql.Append("JiBie=@JiBie,");
            strSql.Append("LevelFactor=@LevelFactor,");
            strSql.Append("Extra1=@Extra1,");
            strSql.Append("Extra2=@Extra2");
            strSql.Append(" where PK_LID=@PK_LID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PK_LID",      SqlDbType.Int,        4),
                //new SqlParameter("@Type", SqlDbType.NVarChar,10),
                new SqlParameter("@Situation",   SqlDbType.NVarChar, 100),
                new SqlParameter("@Factor1",     SqlDbType.Float,      8),
                new SqlParameter("@Factor2",     SqlDbType.Float,      8),
                new SqlParameter("@JiBie",       SqlDbType.Char,       1),
                new SqlParameter("@LevelFactor", SqlDbType.Float,      8),
                new SqlParameter("@Extra1",      SqlDbType.NVarChar,  10),
                new SqlParameter("@Extra2",      SqlDbType.NVarChar, 10)
            };
            parameters[0].Value = model.PK_LID;
            //parameters[1].Value = model.Type;
            parameters[1].Value = model.Situation;
            parameters[2].Value = model.Factor1;
            parameters[3].Value = model.Factor2;
            parameters[4].Value = model.JiBie;
            parameters[5].Value = model.LevelFactor;
            parameters[6].Value = model.Extra1;
            parameters[7].Value = model.Extra2;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Exemplo n.º 8
0
        //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>");
            }
        }
Exemplo n.º 9
0
        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>");
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// �õ�һ������ʵ��
        /// </summary>
        public ZQUSR.Model.sr_Lunwen GetModel(int PK_LID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 PK_LID,Type,Situation,Factor1,Factor2,JiBie,LevelFactor,Extra1,Extra2 from sr_Lunwen ");
            strSql.Append(" where PK_LID=@PK_LID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@PK_LID", SqlDbType.Int,4)};
            parameters[0].Value = PK_LID;

            ZQUSR.Model.sr_Lunwen model=new ZQUSR.Model.sr_Lunwen();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                if(ds.Tables[0].Rows[0]["PK_LID"].ToString()!="")
                {
                    model.PK_LID=int.Parse(ds.Tables[0].Rows[0]["PK_LID"].ToString());
                }
                model.Type=ds.Tables[0].Rows[0]["Type"].ToString();
                model.Situation=ds.Tables[0].Rows[0]["Situation"].ToString();
                if(ds.Tables[0].Rows[0]["Factor1"].ToString()!="")
                {
                    model.Factor1=decimal.Parse(ds.Tables[0].Rows[0]["Factor1"].ToString());
                    //model.Factor1 = ds.Tables[0].Rows[0]["Factor1"].ToString();    //---by caiyuying
                }
                if(ds.Tables[0].Rows[0]["Factor2"].ToString()!="")
                {
                    model.Factor2=decimal.Parse(ds.Tables[0].Rows[0]["Factor2"].ToString());
                    //model.Factor2 = ds.Tables[0].Rows[0]["Factor2"].ToString();     //---by caiyuying
                }
                model.JiBie=ds.Tables[0].Rows[0]["JiBie"].ToString();
                if(ds.Tables[0].Rows[0]["LevelFactor"].ToString()!="")
                {
                    model.LevelFactor=decimal.Parse(ds.Tables[0].Rows[0]["LevelFactor"].ToString());
                    //model.LevelFactor = ds.Tables[0].Rows[0]["LevelFactor"].ToString();    //---by caiyuying
                }
                model.Extra1=ds.Tables[0].Rows[0]["Extra1"].ToString();
                model.Extra2=ds.Tables[0].Rows[0]["Extra2"].ToString();
                return model;
            }
            else
            {
                return null;
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// ������¼ת�����(Sitution)���ؼ���(JiBie)�ͼ����ϵ��(LevelFactor)   ��By Jianguo Fung
        /// </summary>
        public ZQUSR.Model.sr_Lunwen GetJiBieBySitution(string Situation)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 JiBie,LevelFactor from sr_Lunwen ");
            strSql.Append(" where Situation=@Situation");
            SqlParameter[] parameters = {
                    new SqlParameter("@Situation", SqlDbType.NVarChar,100)};
            parameters[0].Value = Situation;

            ZQUSR.Model.sr_Lunwen model = new ZQUSR.Model.sr_Lunwen();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.JiBie = ds.Tables[0].Rows[0]["JiBie"].ToString();
                if (ds.Tables[0].Rows[0]["LevelFactor"].ToString() != "")
                {
                    model.LevelFactor = decimal.Parse(ds.Tables[0].Rows[0]["LevelFactor"].ToString());
                }
                return model;
            }
            else
            {
                return null;
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// ����Ӱ������(QIF)���ؼ���(JiBie)�ͼ����ϵ��(LevelFactor)   ��By Jianguo Fung
        /// </summary>
        public ZQUSR.Model.sr_Lunwen GetJiBieByQIF(decimal QIF)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 JiBie,LevelFactor from sr_Lunwen ");
            strSql.Append(" where @QIF>Factor1-0.0001 and @QIF<Factor2 ");
            SqlParameter[] parameters = {
                    new SqlParameter("@QIF", SqlDbType.Decimal,8)};
            parameters[0].Value = QIF;

            ZQUSR.Model.sr_Lunwen model = new ZQUSR.Model.sr_Lunwen();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.JiBie = ds.Tables[0].Rows[0]["JiBie"].ToString();
                if (ds.Tables[0].Rows[0]["LevelFactor"].ToString() != "")
                {
                    model.LevelFactor = decimal.Parse(ds.Tables[0].Rows[0]["LevelFactor"].ToString());
                }
                return model;
            }
            else
            {
                return null;
            }
        }