Exemplo n.º 1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(GSSModel.GameConfig model)
 {
     try
     {
         dal.Add(model);
         return(true);
     }
     catch //(System.Exception ex)
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <GSSModel.GameConfig> DataTableToList(DataTable dt)
        {
            List <GSSModel.GameConfig> modelList = new List <GSSModel.GameConfig>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                GSSModel.GameConfig model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new GSSModel.GameConfig();
                    if (dt.Rows[n]["F_ID"].ToString() != "")
                    {
                        model.F_ID = int.Parse(dt.Rows[n]["F_ID"].ToString());
                    }
                    if (dt.Rows[n]["F_ParentID"].ToString() != "")
                    {
                        model.F_ParentID = int.Parse(dt.Rows[n]["F_ParentID"].ToString());
                    }
                    model.F_Name      = dt.Rows[n]["F_Name"].ToString();
                    model.F_Value     = dt.Rows[n]["F_Value"].ToString();
                    model.F_Value1    = dt.Rows[n]["F_Value1"].ToString();
                    model.F_ValueGame = dt.Rows[n]["F_ValueGame"].ToString();
                    if (dt.Rows[n]["F_IsUsed"].ToString() != "")
                    {
                        if ((dt.Rows[n]["F_IsUsed"].ToString() == "1") || (dt.Rows[n]["F_IsUsed"].ToString().ToLower() == "true"))
                        {
                            model.F_IsUsed = true;
                        }
                        else
                        {
                            model.F_IsUsed = false;
                        }
                    }
                    if (dt.Rows[n]["F_Sort"].ToString() != "")
                    {
                        model.F_Sort = int.Parse(dt.Rows[n]["F_Sort"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(GSSModel.GameConfig model)
 {
     return(dal.Update(model));
 }