Ejemplo n.º 1
0
        /// <summary>
        /// 学术论文:根据刊物名称(QikanName)返回对应的影响因子(QIF)、级别(JiBie)和级别分系数(LevelFactor)     ——By Jianguo Fung
        /// </summary>
        public ZQUSR.Model.sr_Periodicals GetLunwenJiBieByQikanName(string QikanName)
        {
            StringBuilder strSql = new StringBuilder();

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

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["QIF"].ToString() != "")
                {
                    model.QIF = decimal.Parse(ds.Tables[0].Rows[0]["QIF"].ToString());
                }
                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);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(ZQUSR.Model.sr_Periodicals model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update sr_Periodicals set ");
            strSql.Append("ISSN=@ISSN,");
            strSql.Append("QikanKey=@QikanKey,");
            strSql.Append("QikanName=@QikanName,");
            strSql.Append("QikanEngName=@QikanEngName,");
            strSql.Append("XueKe=@XueKe,");
            strSql.Append("QIF=@QIF,");
            strSql.Append("JiBie=@JiBie,");
            strSql.Append("LevelFactor=@LevelFactor,");
            strSql.Append("Extra1=@Extra1,");
            strSql.Append("Extra2=@Extra2,");
            strSql.Append("Extra3=@Extra3");
            strSql.Append(" where PK_PID=@PK_PID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PK_PID",       SqlDbType.Int,        4),
                new SqlParameter("@ISSN",         SqlDbType.NVarChar,  20),
                new SqlParameter("@QikanKey",     SqlDbType.NVarChar,  10),
                new SqlParameter("@QikanName",    SqlDbType.NVarChar, 100),
                new SqlParameter("@QikanEngName", SqlDbType.NVarChar, 100),
                new SqlParameter("@XueKe",        SqlDbType.NVarChar,  10),
                new SqlParameter("@QIF",          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),
                new SqlParameter("@Extra3",       SqlDbType.NVarChar, 10)
            };
            parameters[0].Value  = model.PK_PID;
            parameters[1].Value  = model.ISSN;
            parameters[2].Value  = model.QikanKey;
            parameters[3].Value  = model.QikanName;
            parameters[4].Value  = model.QikanEngName;
            parameters[5].Value  = model.XueKe;
            parameters[6].Value  = model.QIF;
            parameters[7].Value  = model.JiBie;
            parameters[8].Value  = model.LevelFactor;
            parameters[9].Value  = model.Extra1;
            parameters[10].Value = model.Extra2;
            parameters[11].Value = model.Extra3;

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

            strSql.Append("insert into sr_Periodicals(");
            strSql.Append("ISSN,QikanKey,QikanName,QikanEngName,XueKe,QIF,JiBie,LevelFactor,Extra1,Extra2,Extra3)");
            strSql.Append(" values (");
            strSql.Append("@ISSN,@QikanKey,@QikanName,@QikanEngName,@XueKe,@QIF,@JiBie,@LevelFactor,@Extra1,@Extra2,@Extra3)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ISSN",         SqlDbType.NVarChar,  20),
                new SqlParameter("@QikanKey",     SqlDbType.NVarChar,  10),
                new SqlParameter("@QikanName",    SqlDbType.NVarChar, 100),
                new SqlParameter("@QikanEngName", SqlDbType.NVarChar, 100),
                new SqlParameter("@XueKe",        SqlDbType.NVarChar,  10),
                new SqlParameter("@QIF",          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),
                new SqlParameter("@Extra3",       SqlDbType.NVarChar, 10)
            };
            parameters[0].Value  = model.ISSN;
            parameters[1].Value  = model.QikanKey;
            parameters[2].Value  = model.QikanName;
            parameters[3].Value  = model.QikanEngName;
            parameters[4].Value  = model.XueKe;
            parameters[5].Value  = model.QIF;
            parameters[6].Value  = model.JiBie;
            parameters[7].Value  = model.LevelFactor;
            parameters[8].Value  = model.Extra1;
            parameters[9].Value  = model.Extra2;
            parameters[10].Value = model.Extra3;

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

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 是否存在该记录(QikanKey/QikanName)-By Jianguo Fung
        /// </summary>
        public bool Exists(ZQUSR.Model.sr_Periodicals model)
        {
            StringBuilder strSql = new StringBuilder();

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

            return(DbHelperSQL.Exists(strSql.ToString(), parameters));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 更新影响因子  -By Jianguo Fung
        /// </summary>
        /// <param name="model"></param>
        public void UpdateQIF(ZQUSR.Model.sr_Periodicals model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update sr_Periodicals set ");
            strSql.Append("QIF=@QIF ");
            strSql.Append(" where PK_PID=@PK_PID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PK_PID", SqlDbType.Int,   4),
                new SqlParameter("@QIF",    SqlDbType.Float, 8)
            };
            parameters[0].Value = model.PK_PID;
            parameters[1].Value = model.QIF;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ZQUSR.Model.sr_Periodicals GetModel(int PK_PID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 PK_PID,ISSN,QikanKey,QikanName,QikanEngName,XueKe,QIF,JiBie,LevelFactor,Extra1,Extra2,Extra3 from sr_Periodicals ");
            strSql.Append(" where PK_PID=@PK_PID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PK_PID", SqlDbType.Int, 4)
            };
            parameters[0].Value = PK_PID;

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["PK_PID"].ToString() != "")
                {
                    model.PK_PID = int.Parse(ds.Tables[0].Rows[0]["PK_PID"].ToString());
                }
                model.ISSN         = ds.Tables[0].Rows[0]["ISSN"].ToString();
                model.QikanKey     = ds.Tables[0].Rows[0]["QikanKey"].ToString();
                model.QikanName    = ds.Tables[0].Rows[0]["QikanName"].ToString();
                model.QikanEngName = ds.Tables[0].Rows[0]["QikanEngName"].ToString();
                model.XueKe        = ds.Tables[0].Rows[0]["XueKe"].ToString();
                if (ds.Tables[0].Rows[0]["QIF"].ToString() != "")
                {
                    model.QIF = decimal.Parse(ds.Tables[0].Rows[0]["QIF"].ToString());
                }
                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.Extra1 = ds.Tables[0].Rows[0]["Extra1"].ToString();
                model.Extra2 = ds.Tables[0].Rows[0]["Extra2"].ToString();
                model.Extra3 = ds.Tables[0].Rows[0]["Extra3"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 更新级别和级别分系数 -By Jianguo Fung
        /// </summary>
        /// <param name="model"></param>
        public void UpdateJiBie(ZQUSR.Model.sr_Periodicals model)
        {
            StringBuilder strSql = new StringBuilder();

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

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// �õ�һ������ʵ��
        /// </summary>
        public ZQUSR.Model.sr_Periodicals GetModel(int PK_PID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 PK_PID,ISSN,QikanKey,QikanName,QikanEngName,XueKe,QIF,JiBie,LevelFactor,Extra1,Extra2,Extra3 from sr_Periodicals ");
            strSql.Append(" where PK_PID=@PK_PID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@PK_PID", SqlDbType.Int,4)};
            parameters[0].Value = PK_PID;

            ZQUSR.Model.sr_Periodicals model=new ZQUSR.Model.sr_Periodicals();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                if(ds.Tables[0].Rows[0]["PK_PID"].ToString()!="")
                {
                    model.PK_PID=int.Parse(ds.Tables[0].Rows[0]["PK_PID"].ToString());
                }
                model.ISSN=ds.Tables[0].Rows[0]["ISSN"].ToString();
                model.QikanKey=ds.Tables[0].Rows[0]["QikanKey"].ToString();
                model.QikanName=ds.Tables[0].Rows[0]["QikanName"].ToString();
                model.QikanEngName=ds.Tables[0].Rows[0]["QikanEngName"].ToString();
                model.XueKe=ds.Tables[0].Rows[0]["XueKe"].ToString();
                if(ds.Tables[0].Rows[0]["QIF"].ToString()!="")
                {
                    model.QIF=decimal.Parse(ds.Tables[0].Rows[0]["QIF"].ToString());
                }
                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.Extra1=ds.Tables[0].Rows[0]["Extra1"].ToString();
                model.Extra2=ds.Tables[0].Rows[0]["Extra2"].ToString();
                model.Extra3=ds.Tables[0].Rows[0]["Extra3"].ToString();
                return model;
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// ѧ�����ģ����ݿ�������(QikanName)���ض�Ӧ��Ӱ������(QIF)������(JiBie)�ͼ����ϵ��(LevelFactor)     ����By Jianguo Fung
        /// </summary>
        public ZQUSR.Model.sr_Periodicals GetLunwenJiBieByQikanName(string QikanName)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 QIF,JiBie,LevelFactor from sr_Periodicals ");
            strSql.Append(" where QikanName=@QikanName ");
            SqlParameter[] parameters = {
                    new SqlParameter("@QikanName", SqlDbType.NVarChar,100)};
            parameters[0].Value = QikanName;

            ZQUSR.Model.sr_Periodicals model = new ZQUSR.Model.sr_Periodicals();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["QIF"].ToString() != "")
                {
                    model.QIF = decimal.Parse(ds.Tables[0].Rows[0]["QIF"].ToString());
                }
                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;
            }
        }
Ejemplo n.º 10
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>");
            }
        }
Ejemplo n.º 11
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>");
            }
        }