コード例 #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(DigiPower.Onlinecol.Standard.Model.c_single_project_MDL model)
 {
     dal.Add(model);
 }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(DigiPower.Onlinecol.Standard.Model.c_single_project_MDL model)
 {
     dal.Update(model);
 }
コード例 #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DigiPower.Onlinecol.Standard.Model.c_single_project_MDL> DataTableToList(DataTable dt)
        {
            List <DigiPower.Onlinecol.Standard.Model.c_single_project_MDL> modelList = new List <DigiPower.Onlinecol.Standard.Model.c_single_project_MDL>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DigiPower.Onlinecol.Standard.Model.c_single_project_MDL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DigiPower.Onlinecol.Standard.Model.c_single_project_MDL();
                    if (dt.Rows[n]["SingleProjectID"].ToString() != "")
                    {
                        model.SingleProjectID = int.Parse(dt.Rows[n]["SingleProjectID"].ToString());
                    }
                    model.dxgcmc = dt.Rows[n]["dxgcmc"].ToString();
                    model.sgdw   = dt.Rows[n]["sgdw"].ToString();
                    model.dxth   = dt.Rows[n]["dxth"].ToString();
                    model.qd     = dt.Rows[n]["qd"].ToString();
                    model.zd     = dt.Rows[n]["zd"].ToString();
                    if (dt.Rows[n]["chd"].ToString() != "")
                    {
                        model.chd = decimal.Parse(dt.Rows[n]["chd"].ToString());
                    }
                    model.gg = dt.Rows[n]["gg"].ToString();
                    model.cz = dt.Rows[n]["cz"].ToString();
                    model.hz = dt.Rows[n]["hz"].ToString();
                    if (dt.Rows[n]["kgsj"].ToString() != "")
                    {
                        model.kgsj = DateTime.Parse(dt.Rows[n]["kgsj"].ToString());
                    }
                    if (dt.Rows[n]["jgsj"].ToString() != "")
                    {
                        model.jgsj = DateTime.Parse(dt.Rows[n]["jgsj"].ToString());
                    }
                    if (dt.Rows[n]["gczj"].ToString() != "")
                    {
                        model.gczj = decimal.Parse(dt.Rows[n]["gczj"].ToString());
                    }
                    if (dt.Rows[n]["gcjs"].ToString() != "")
                    {
                        model.gcjs = decimal.Parse(dt.Rows[n]["gcjs"].ToString());
                    }
                    if (dt.Rows[n]["ajs"].ToString() != "")
                    {
                        model.ajs = int.Parse(dt.Rows[n]["ajs"].ToString());
                    }
                    if (dt.Rows[n]["wz"].ToString() != "")
                    {
                        model.wz = int.Parse(dt.Rows[n]["wz"].ToString());
                    }
                    if (dt.Rows[n]["tzj"].ToString() != "")
                    {
                        model.tzj = int.Parse(dt.Rows[n]["tzj"].ToString());
                    }
                    if (dt.Rows[n]["tzz"].ToString() != "")
                    {
                        model.tzz = int.Parse(dt.Rows[n]["tzz"].ToString());
                    }
                    if (dt.Rows[n]["dt"].ToString() != "")
                    {
                        model.dt = int.Parse(dt.Rows[n]["dt"].ToString());
                    }
                    if (dt.Rows[n]["zp"].ToString() != "")
                    {
                        model.zp = int.Parse(dt.Rows[n]["zp"].ToString());
                    }
                    if (dt.Rows[n]["dp"].ToString() != "")
                    {
                        model.dp = int.Parse(dt.Rows[n]["dp"].ToString());
                    }
                    if (dt.Rows[n]["ly"].ToString() != "")
                    {
                        model.ly = int.Parse(dt.Rows[n]["ly"].ToString());
                    }
                    if (dt.Rows[n]["lx"].ToString() != "")
                    {
                        model.lx = int.Parse(dt.Rows[n]["lx"].ToString());
                    }
                    if (dt.Rows[n]["gp"].ToString() != "")
                    {
                        model.gp = int.Parse(dt.Rows[n]["gp"].ToString());
                    }
                    if (dt.Rows[n]["cd"].ToString() != "")
                    {
                        model.cd = int.Parse(dt.Rows[n]["cd"].ToString());
                    }
                    if (dt.Rows[n]["cp"].ToString() != "")
                    {
                        model.cp = int.Parse(dt.Rows[n]["cp"].ToString());
                    }
                    if (dt.Rows[n]["swz"].ToString() != "")
                    {
                        model.swz = int.Parse(dt.Rows[n]["swz"].ToString());
                    }

                    model.qt   = dt.Rows[n]["qt"].ToString();
                    model.bgqx = dt.Rows[n]["bgqx"].ToString();
                    model.mj   = dt.Rows[n]["mj"].ToString();
                    if (dt.Rows[n]["jgrq"].ToString() != "")
                    {
                        model.jgrq = DateTime.Parse(dt.Rows[n]["jgrq"].ToString());
                    }
                    model.yjdw = dt.Rows[n]["yjdw"].ToString();
                    model.swh  = dt.Rows[n]["swh"].ToString();
                    model.cfwz = dt.Rows[n]["cfwz"].ToString();
                    model.note = dt.Rows[n]["note"].ToString();
                    if (dt.Rows[n]["swp"].ToString() != "")
                    {
                        model.swp = int.Parse(dt.Rows[n]["swp"].ToString());
                    }
                    model.lrr = dt.Rows[n]["lrr"].ToString();
                    if (dt.Rows[n]["lrsj"].ToString() != "")
                    {
                        model.lrsj = DateTime.Parse(dt.Rows[n]["lrsj"].ToString());
                    }
                    model.zrsbh = dt.Rows[n]["zrsbh"].ToString();
                    model.lxr   = dt.Rows[n]["lxr"].ToString();
                    model.lxdh  = dt.Rows[n]["lxdh"].ToString();
                    if (dt.Rows[n]["gisid"].ToString() != "")
                    {
                        model.gisid = int.Parse(dt.Rows[n]["gisid"].ToString());
                    }
                    if (dt.Rows[n]["ywzd"].ToString() != "")
                    {
                        model.ywzd = int.Parse(dt.Rows[n]["ywzd"].ToString());
                    }
                    model.ghxkzh      = dt.Rows[n]["ghxkzh"].ToString();
                    model.sgxkzh      = dt.Rows[n]["sgxkzh"].ToString();
                    model.zlaqjddw    = dt.Rows[n]["zlaqjddw"].ToString();
                    model.zlyj        = dt.Rows[n]["zlyj"].ToString();
                    model.gc_code     = dt.Rows[n]["gc_code"].ToString();
                    model.YDXKZH      = dt.Rows[n]["YDXKZH"].ToString();
                    model.ydghxkzh    = dt.Rows[n]["ydghxkzh"].ToString();
                    model.HJQK        = dt.Rows[n]["HJQK"].ToString();
                    model.SJDW_XMFZR  = dt.Rows[n]["SJDW_XMFZR"].ToString();
                    model.KCDW        = dt.Rows[n]["KCDW"].ToString();
                    model.KCDW_XMFZR  = dt.Rows[n]["KCDW_XMFZR"].ToString();
                    model.JLDW_XMFZR  = dt.Rows[n]["JLDW_XMFZR"].ToString();
                    model.SGDW_XMJL   = dt.Rows[n]["SGDW_XMJL"].ToString();
                    model.ZJLGCS      = dt.Rows[n]["ZJLGCS"].ToString();
                    model.ZYJLGCS     = dt.Rows[n]["ZYJLGCS"].ToString();
                    model.FBDW        = dt.Rows[n]["FBDW"].ToString();
                    model.FBDW_XMJL   = dt.Rows[n]["FBDW_XMJL"].ToString();
                    model.FBDW_1      = dt.Rows[n]["FBDW_1"].ToString();
                    model.FBDW_1_XMJL = dt.Rows[n]["FBDW_1_XMJL"].ToString();
                    model.ZYGZ        = dt.Rows[n]["ZYGZ"].ToString();
                    model.XMZYZLJCY   = dt.Rows[n]["XMZYZLJCY"].ToString();
                    model.SGBZZ       = dt.Rows[n]["SGBZZ"].ToString();
                    model.TBR         = dt.Rows[n]["TBR"].ToString();
                    model.JSDW_SHR    = dt.Rows[n]["JSDW_SHR"].ToString();
                    model.JLDW_SHR    = dt.Rows[n]["JLDW_SHR"].ToString();
                    if (dt.Rows[n]["SHRQ"].ToString() != "")
                    {
                        model.SHRQ = DateTime.Parse(dt.Rows[n]["SHRQ"].ToString());
                    }
                    model.TJLB = dt.Rows[n]["TJLB"].ToString();
                    if (dt.Rows[n]["FPSJ"].ToString() != "")
                    {
                        model.FPSJ = DateTime.Parse(dt.Rows[n]["FPSJ"].ToString());
                    }
                    model.FPR    = dt.Rows[n]["FPR"].ToString();
                    model.SPR    = dt.Rows[n]["SPR"].ToString();
                    model.SPR_DH = dt.Rows[n]["SPR_DH"].ToString();
                    model.FP_BZ  = dt.Rows[n]["FP_BZ"].ToString();
                    model.sjyl   = dt.Rows[n]["sjyl"].ToString();
                    model.bg     = dt.Rows[n]["bg"].ToString();
                    model.ms     = dt.Rows[n]["ms"].ToString();
                    model.ll     = dt.Rows[n]["ll"].ToString();
                    model.sjdw   = dt.Rows[n]["sjdw"].ToString();
                    model.jldw   = dt.Rows[n]["jldw"].ToString();
                    model.kzdj   = dt.Rows[n]["kzdj"].ToString();
                    if (dt.Rows[n]["wzz"].ToString() != "")
                    {
                        model.wzz = int.Parse(dt.Rows[n]["wzz"].ToString());
                    }
                    model.zcd  = dt.Rows[n]["zcd"].ToString();
                    model.gczl = dt.Rows[n]["gczl"].ToString();
                    model.gcys = dt.Rows[n]["gcys"].ToString();
                    model.qdzb = dt.Rows[n]["qdzb"].ToString();
                    model.zdzb = dt.Rows[n]["zdzb"].ToString();
                    model.fz   = dt.Rows[n]["fz"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }