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

            if (rowsCount > 0)
            {
                DigiPower.Onlinecol.Standard.Model.T_Report_MainSql_MDL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DigiPower.Onlinecol.Standard.Model.T_Report_MainSql_MDL();
                    if (dt.Rows[n]["ReportMainSqlID"].ToString() != "")
                    {
                        model.ReportMainSqlID = int.Parse(dt.Rows[n]["ReportMainSqlID"].ToString());
                    }
                    if (dt.Rows[n]["ReportID"].ToString() != "")
                    {
                        model.ReportID = int.Parse(dt.Rows[n]["ReportID"].ToString());
                    }
                    model.MainSql = dt.Rows[n]["MainSql"].ToString();
                    if (dt.Rows[n]["OrderId"].ToString() != "")
                    {
                        model.OrderId = int.Parse(dt.Rows[n]["OrderId"].ToString());
                    }
                    if (dt.Rows[n]["IsValid"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IsValid"].ToString() == "1") || (dt.Rows[n]["IsValid"].ToString().ToLower() == "true"))
                        {
                            model.IsValid = true;
                        }
                        else
                        {
                            model.IsValid = false;
                        }
                    }
                    model.OtherName = dt.Rows[n]["OtherName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(DigiPower.Onlinecol.Standard.Model.T_Report_MainSql_MDL model)
 {
     dal.Update(model);
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(DigiPower.Onlinecol.Standard.Model.T_Report_MainSql_MDL model)
 {
     return(dal.Add(model));
 }