Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ZQUSR.Model.sr_WordsFunds> DataTableToList(DataTable dt)
        {
            List <ZQUSR.Model.sr_WordsFunds> modelList = new List <ZQUSR.Model.sr_WordsFunds>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                ZQUSR.Model.sr_WordsFunds model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ZQUSR.Model.sr_WordsFunds();
                    if (dt.Rows[n]["PK_WFID"].ToString() != "")
                    {
                        model.PK_WFID = int.Parse(dt.Rows[n]["PK_WFID"].ToString());
                    }
                    model.Sort = dt.Rows[n]["Sort"].ToString();
                    model.Type = dt.Rows[n]["Type"].ToString();
                    if (dt.Rows[n]["Digit1"].ToString() != "")
                    {
                        model.Digit1 = decimal.Parse(dt.Rows[n]["Digit1"].ToString());
                    }
                    if (dt.Rows[n]["Digit2"].ToString() != "")
                    {
                        model.Digit2 = decimal.Parse(dt.Rows[n]["Digit2"].ToString());
                    }
                    if (dt.Rows[n]["Digit3"].ToString() != "")
                    {
                        model.Digit3 = decimal.Parse(dt.Rows[n]["Digit3"].ToString());
                    }
                    if (dt.Rows[n]["Digit4"].ToString() != "")
                    {
                        model.Digit4 = decimal.Parse(dt.Rows[n]["Digit4"].ToString());
                    }
                    if (dt.Rows[n]["Digit5"].ToString() != "")
                    {
                        model.Digit5 = decimal.Parse(dt.Rows[n]["Digit5"].ToString());
                    }
                    if (dt.Rows[n]["Digit6"].ToString() != "")
                    {
                        model.Digit6 = decimal.Parse(dt.Rows[n]["Digit6"].ToString());
                    }
                    if (dt.Rows[n]["Digit7"].ToString() != "")
                    {
                        model.Digit7 = decimal.Parse(dt.Rows[n]["Digit7"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<ZQUSR.Model.sr_WordsFunds> DataTableToList(DataTable dt)
 {
     List<ZQUSR.Model.sr_WordsFunds> modelList = new List<ZQUSR.Model.sr_WordsFunds>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         ZQUSR.Model.sr_WordsFunds model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new ZQUSR.Model.sr_WordsFunds();
             if (dt.Rows[n]["PK_WFID"].ToString() != "")
             {
                 model.PK_WFID = int.Parse(dt.Rows[n]["PK_WFID"].ToString());
             }
             model.Sort = dt.Rows[n]["Sort"].ToString();
             model.Type = dt.Rows[n]["Type"].ToString();
             if (dt.Rows[n]["Digit1"].ToString() != "")
             {
                 model.Digit1 = decimal.Parse(dt.Rows[n]["Digit1"].ToString());
             }
             if (dt.Rows[n]["Digit2"].ToString() != "")
             {
                 model.Digit2 = decimal.Parse(dt.Rows[n]["Digit2"].ToString());
             }
             if (dt.Rows[n]["Digit3"].ToString() != "")
             {
                 model.Digit3 = decimal.Parse(dt.Rows[n]["Digit3"].ToString());
             }
             if (dt.Rows[n]["Digit4"].ToString() != "")
             {
                 model.Digit4 = decimal.Parse(dt.Rows[n]["Digit4"].ToString());
             }
             if (dt.Rows[n]["Digit5"].ToString() != "")
             {
                 model.Digit5 = decimal.Parse(dt.Rows[n]["Digit5"].ToString());
             }
             if (dt.Rows[n]["Digit6"].ToString() != "")
             {
                 model.Digit6 = decimal.Parse(dt.Rows[n]["Digit6"].ToString());
             }
             if (dt.Rows[n]["Digit7"].ToString() != "")
             {
                 model.Digit7 = decimal.Parse(dt.Rows[n]["Digit7"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ZQUSR.Model.sr_WordsFunds model)
 {
     dal.Update(model);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(ZQUSR.Model.sr_WordsFunds model)
 {
     return(dal.Add(model));
 }