Ejemplo n.º 1
0
        //对数据库进行一定的修改
        public bool JiaoTiChangeInfo(T_ImgChange model, int chooseImg)
        {
            List <T_ImgChange> list = bll.GetList();

            list.RemoveAt(3);
            list.Insert(chooseImg - 1, model);
            return(bll.UpdateImageInfo(list));
        }
Ejemplo n.º 2
0
        public bool ChangeImagePath(int chooseImg, string des, string url)
        {
            JiaoTiChangeImg(chooseImg);
            T_ImgChange model = new T_ImgChange {
                C_ImgDes = des, C_ImgUrl = url, C_ImgId = chooseImg
            };

            return(JiaoTiChangeInfo(model, chooseImg));
        }
Ejemplo n.º 3
0
        public void bindimg()
        {
            List <T_ImgChange> list = bll.GetList();

            model1         = list[0];
            model2         = list[1];
            model3         = list[2];
            model4         = list[3];
            Image1.ToolTip = "描述:" + model1.C_ImgDes.ToString() + ";路径:" + model1.C_ImgUrl.ToString();
            Image2.ToolTip = "描述:" + model2.C_ImgDes.ToString() + ";路径:" + model2.C_ImgUrl.ToString();
            Image3.ToolTip = "描述:" + model3.C_ImgDes.ToString() + ";路径:" + model3.C_ImgUrl.ToString();
            Image4.ToolTip = "描述:" + model4.C_ImgDes.ToString() + ";路径:" + model4.C_ImgUrl.ToString();
        }
Ejemplo n.º 4
0
        public List <T_ImgChange> GetList()
        {
            string             sql  = "select * from T_ImgChange";
            DataTable          tb   = SqlHelper.ExecuteDataTable(sql, CommandType.Text);
            List <T_ImgChange> list = new List <T_ImgChange>();

            if (tb.Rows.Count > 0)
            {
                for (int i = 0; i < tb.Rows.Count; i++)
                {
                    T_ImgChange model = new T_ImgChange();
                    model.C_ImgId  = int.Parse(tb.Rows[i]["C_ImgId"].ToString());
                    model.C_ImgDes = tb.Rows[i]["C_ImgDes"].ToString();
                    model.C_ImgUrl = tb.Rows[i]["C_ImgUrl"].ToString();
                    list.Add(model);
                }
            }
            return(list);
        }