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

            if (rowsCount > 0)
            {
                Hownet.Model.BAS_FlowUpStatus model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model        = new Hownet.Model.BAS_FlowUpStatus();
                    model.Code   = dt.Rows[n]["Code"].ToString();
                    model.CnName = dt.Rows[n]["CnName"].ToString();
                    model.EnName = dt.Rows[n]["EnName"].ToString();
                    if (dt.Rows[n]["SuccessRate"] != null && dt.Rows[n]["SuccessRate"].ToString() != "")
                    {
                        model.SuccessRate = decimal.Parse(dt.Rows[n]["SuccessRate"].ToString());
                    }
                    if (dt.Rows[n]["IsValid"] != null && 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.Remark = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["AutoInc"] != null && dt.Rows[n]["AutoInc"].ToString() != "")
                    {
                        model.AutoInc = int.Parse(dt.Rows[n]["AutoInc"].ToString());
                    }
                    if (dt.Rows[n]["IsEnd"] != null && dt.Rows[n]["IsEnd"].ToString() != "")
                    {
                        model.IsEnd = int.Parse(dt.Rows[n]["IsEnd"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hownet.Model.BAS_FlowUpStatus model)
 {
     return(dal.Update(model));
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.BAS_FlowUpStatus model)
 {
     return(dal.Add(model));
 }