コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ZQUSR.Model.sr_Calculate3> DataTableToList(DataTable dt)
        {
            List <ZQUSR.Model.sr_Calculate3> modelList = new List <ZQUSR.Model.sr_Calculate3>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                ZQUSR.Model.sr_Calculate3 model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ZQUSR.Model.sr_Calculate3();
                    if (dt.Rows[n]["PK_CID"].ToString() != "")
                    {
                        model.PK_CID = int.Parse(dt.Rows[n]["PK_CID"].ToString());
                    }
                    model.Type = dt.Rows[n]["Type"].ToString();
                    if (dt.Rows[n]["Scale"].ToString() != "")
                    {
                        model.Scale = decimal.Parse(dt.Rows[n]["Scale"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<ZQUSR.Model.sr_Calculate3> DataTableToList(DataTable dt)
 {
     List<ZQUSR.Model.sr_Calculate3> modelList = new List<ZQUSR.Model.sr_Calculate3>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         ZQUSR.Model.sr_Calculate3 model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new ZQUSR.Model.sr_Calculate3();
             if(dt.Rows[n]["PK_CID"].ToString()!="")
             {
                 model.PK_CID=int.Parse(dt.Rows[n]["PK_CID"].ToString());
             }
             model.Type=dt.Rows[n]["Type"].ToString();
             if(dt.Rows[n]["Scale"].ToString()!="")
             {
                 model.Scale=decimal.Parse(dt.Rows[n]["Scale"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
コード例 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ZQUSR.Model.sr_Calculate3 model)
 {
     dal.Update(model);
 }
コード例 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(ZQUSR.Model.sr_Calculate3 model)
 {
     return(dal.Add(model));
 }