Exemple #1
0
        //创建效益评价因子规则(对计算的结果插入到数据库里面)
        protected void benefitFactorscreateRule_Click(object sender, EventArgs e)
        {
            //1获得用户的id
            int userID = CommonClass.OperateUsers.getUserID();

            //、获取措施。因为因为所有的措施中适宜性权重值都相同,这里只是象征性的给它赋值经济林果。其实没什么用的。
            string measurename = "经济林果";

            for (int i = 0; i < lsBenName.Count; i++)
            {
                //3、获取到效益权重的因子名对应的ID
                STBC.BLL.ST_FACTDIR factdirB = new STBC.BLL.ST_FACTDIR();
                DataSet             ds2      = factdirB.GetList("Name='" + lsBenName[i].ToString() + "'");
                DataTable           dt2      = ds2.Tables[0];
                int factid = int.Parse(dt2.Rows[0]["ID"].ToString());

                STBC.BLL.ST_FACTEVALWEIG   factevalweigB = new STBC.BLL.ST_FACTEVALWEIG();
                STBC.Model.ST_FACTEVALWEIG factevalweigM = new STBC.Model.ST_FACTEVALWEIG();
                factevalweigM.OWNER          = userID;
                factevalweigM.SUITAINDICATOR = factid;
                factevalweigM.MEASNAME       = measurename;
                factevalweigM.WEIGHT         = (decimal)Math.Round(resultBenefit[i, 0], 4);
                //判断数据是否已经存在,如果不存在则插入数据库里面
                if (!factevalweigB.Exists(userID, factid, measurename))
                {
                    factevalweigB.Add(factevalweigM);
                    //提醒用户已经插入数据库
                    if (i == lsBenName.Count - 1)
                    {
                        Response.Write("<script>alert('权重已经插入数据库!');</script>");
                    }
                }
                else
                {
                    //更新数据
                    factevalweigB.Update(factevalweigM);
                    //提醒数据已经被更新了
                    if (i == lsBenName.Count - 1)
                    {
                        Response.Write("<script>alert('权重已经被更新!');</script>");
                    }
                }
            }
        }
Exemple #2
0
        protected bool insertSuitWeigth(List <string> lsSuitNameList, double[,] resultSuit, int userID, string measurename)
        {
            bool isok = false;

            //效益型权重插入2
            for (int i = 0; i < lsSuitNameList.Count; i++)
            {
                //3、获取到效益权重的因子名对应的ID
                //STBC.BLL.SUITAINDICATOR suitaindicatorB = new STBC.BLL.SUITAINDICATOR();
                STBC.BLL.ST_FACTDIR factdirB = new STBC.BLL.ST_FACTDIR();
                DataSet             ds2      = factdirB.GetList("Name='" + lsSuitNameList[i].ToString() + "'");
                DataTable           dt2      = ds2.Tables[0];
                int factID = int.Parse(dt2.Rows[0]["ID"].ToString());


                STBC.BLL.ST_FACTEVALWEIG   factevalweigB = new STBC.BLL.ST_FACTEVALWEIG();
                STBC.Model.ST_FACTEVALWEIG factevalweigM = new STBC.Model.ST_FACTEVALWEIG();

                factevalweigM.SUITAINDICATOR = factID;
                factevalweigM.OWNER          = userID;
                double weight1 = resultSuit[i, 0];
                factevalweigM.WEIGHT   = (decimal)Math.Round(weight1, 4);
                factevalweigM.MEASNAME = measurename;

                //判断数据是否已经存在,如果不存在则插入数据库里面

                if (!factevalweigB.Exists(userID, factID, measurename))
                {
                    factevalweigB.Add(factevalweigM);
                }
                else
                {
                    //如果数据库已经存在则更新
                    factevalweigB.Update(factevalweigM);
                    isok = true;
                }
            }
            return(isok);
        }
Exemple #3
0
        //创建效益评价因子规则(对计算的结果插入到数据库里面)
        protected void benefitFactorscreateRule_Click(object sender, EventArgs e)
        {
            //1获得用户的id
            int userID = CommonClass.OperateUsers.getUserID();

            //、获取措施。因为因为所有的措施中适宜性权重值都相同,这里只是象征性的给它赋值经济林果。其实没什么用的。
            string measurename = "经济林果";

            for (int i = 0; i < lsBenName.Count; i++)
            {
                //3、获取到效益权重的因子名对应的ID
                STBC.BLL.ST_FACTDIR factdirB = new STBC.BLL.ST_FACTDIR();
                DataSet ds2 = factdirB.GetList("Name='" + lsBenName[i].ToString() + "'");
                DataTable dt2 = ds2.Tables[0];
                int factid = int.Parse(dt2.Rows[0]["ID"].ToString());

                STBC.BLL.ST_FACTEVALWEIG factevalweigB = new STBC.BLL.ST_FACTEVALWEIG();
                STBC.Model.ST_FACTEVALWEIG factevalweigM = new STBC.Model.ST_FACTEVALWEIG();
                factevalweigM.OWNER = userID;
                factevalweigM.SUITAINDICATOR = factid;
                factevalweigM.MEASNAME = measurename;
                factevalweigM.WEIGHT = (decimal)Math.Round(resultBenefit[i, 0], 4);
                //判断数据是否已经存在,如果不存在则插入数据库里面
                if (!factevalweigB.Exists(userID, factid, measurename))
                {
                    factevalweigB.Add(factevalweigM);
                    //提醒用户已经插入数据库
                    if (i == lsBenName.Count - 1)
                    {
                        Response.Write("<script>alert('权重已经插入数据库!');</script>");
                    }
                }
                else
                {
                    //更新数据
                    factevalweigB.Update(factevalweigM);
                    //提醒数据已经被更新了
                    if (i == lsBenName.Count - 1)
                    {
                        Response.Write("<script>alert('权重已经被更新!');</script>");

                    }
                }

            }
        }
Exemple #4
0
        protected bool insertSuitWeigth(List<string> lsSuitNameList, double[,] resultSuit, int userID, string measurename)
        {
            bool isok = false;
            //效益型权重插入2
            for (int i = 0; i < lsSuitNameList.Count; i++)
            {
                //3、获取到效益权重的因子名对应的ID
                //STBC.BLL.SUITAINDICATOR suitaindicatorB = new STBC.BLL.SUITAINDICATOR();
                STBC.BLL.ST_FACTDIR factdirB = new STBC.BLL.ST_FACTDIR();
                DataSet ds2 = factdirB.GetList("Name='" + lsSuitNameList[i].ToString() + "'");
                DataTable dt2 = ds2.Tables[0];
                int factID = int.Parse(dt2.Rows[0]["ID"].ToString());

                STBC.BLL.ST_FACTEVALWEIG factevalweigB = new STBC.BLL.ST_FACTEVALWEIG();
                STBC.Model.ST_FACTEVALWEIG factevalweigM = new STBC.Model.ST_FACTEVALWEIG();

                factevalweigM.SUITAINDICATOR = factID;
                factevalweigM.OWNER = userID;
                double weight1 = resultSuit[i, 0];
                factevalweigM.WEIGHT = (decimal)Math.Round(weight1, 4);
                factevalweigM.MEASNAME = measurename;

                //判断数据是否已经存在,如果不存在则插入数据库里面

                if (!factevalweigB.Exists(userID, factID, measurename))
                {
                    factevalweigB.Add(factevalweigM);
                }
                else
                {
                    //如果数据库已经存在则更新
                    factevalweigB.Update(factevalweigM);
                    isok = true;

                }

            }
            return isok;
        }