示例#1
0
        public List <TSGLXT.Model.DZB> DataViewDetaiList(DataTable dt)
        {
            List <TSGLXT.Model.DZB> modelList = new List <TSGLXT.Model.DZB>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TSGLXT.Model.DZB model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSGLXT.Model.DZB();
                    if (dt.Rows[n]["SKID"] != null && dt.Rows[n]["SKID"].ToString() != "")
                    {
                        model.skid = dt.Rows[n]["SKID"].ToString();
                    }
                    if (dt.Rows[n]["BKISBN"] != null && dt.Rows[n]["BKISBN"].ToString() != "")
                    {
                        model.BKISBN = dt.Rows[n]["BKISBN"].ToString();
                    }
                    if (dt.Rows[n]["BKNAME"] != null && dt.Rows[n]["BKNAME"].ToString() != "")
                    {
                        model.bkname = dt.Rows[n]["BKNAME"].ToString();
                    }
                    if (dt.Rows[n]["BKPRICE"] != null && dt.Rows[n]["BKPRICE"].ToString() != "")
                    {
                        model.bkprice = dt.Rows[n]["BKPRICE"].ToString();
                    }
                    if (dt.Rows[n]["BKAUTHOR"] != null && dt.Rows[n]["BKAUTHOR"].ToString() != "")
                    {
                        model.bkauthor = dt.Rows[n]["BKAUTHOR"].ToString();
                    }
                    if (dt.Rows[n]["DZID"] != null && dt.Rows[n]["DZID"].ToString() != "")
                    {
                        model.DZID = dt.Rows[n]["DZID"].ToString();
                    }
                    if (dt.Rows[n]["DZNAME"] != null && dt.Rows[n]["DZNAME"].ToString() != "")
                    {
                        model.DZNAME = dt.Rows[n]["DZNAME"].ToString();
                    }
                    if (dt.Rows[n]["DZYEAR"] != null && dt.Rows[n]["DZYEAR"].ToString() != "")
                    {
                        model.DZYEAR = (int)dt.Rows[n]["DZYEAR"];
                    }
                    if (dt.Rows[n]["DZDUTY"] != null && dt.Rows[n]["DZDUTY"].ToString() != "")
                    {
                        model.DZDUTY = dt.Rows[n]["DZDUTY"].ToString();
                    }
                    if (dt.Rows[n]["DZADDRESS"] != null && dt.Rows[n]["DZADDRESS"].ToString() != "")
                    {
                        model.DZADDRESS = dt.Rows[n]["DZADDRESS"].ToString();
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
        public List <TSGLXT.Model.DZB> DateAddressList(DataTable dt)
        {
            List <TSGLXT.Model.DZB> modelList = new List <TSGLXT.Model.DZB>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TSGLXT.Model.DZB model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSGLXT.Model.DZB();

                    if (dt.Rows[n]["DZADDRESS"] != null && dt.Rows[n]["DZADDRESS"].ToString() != "")
                    {
                        model.DZADDRESS = dt.Rows[n]["DZADDRESS"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(TSGLXT.Model.DZB model)
 {
     return(dal.Update(model));
 }
示例#4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(TSGLXT.Model.DZB model)
 {
     return(dal.Add(model));
 }
示例#5
0
        public List <TSGLXT.Model.DZB> DataNew(DataTable dt, string c, int b)
        {
            int  charA = 0;
            int  Sq    = 0;
            bool mark  = false;
            int  x     = 0;
            int  num   = 0;
            List <TSGLXT.Model.DZB> modelList = new List <TSGLXT.Model.DZB>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TSGLXT.Model.DZB model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSGLXT.Model.DZB();
                    if (dt.Rows[n]["SKID"] != null && dt.Rows[n]["SKID"].ToString() != "")
                    {
                        model.skid = dt.Rows[n]["SKID"].ToString();
                    }
                    if (dt.Rows[n]["BKISBN"] != null && dt.Rows[n]["BKISBN"].ToString() != "")
                    {
                        model.BKISBN = dt.Rows[n]["BKISBN"].ToString();
                    }
                    if (dt.Rows[n]["BKNAME"] != null && dt.Rows[n]["BKNAME"].ToString() != "")
                    {
                        model.bkname = dt.Rows[n]["BKNAME"].ToString();
                    }
                    if (dt.Rows[n]["BKPRICE"] != null && dt.Rows[n]["BKPRICE"].ToString() != "")
                    {
                        model.bkprice = dt.Rows[n]["BKPRICE"].ToString();
                    }
                    if (dt.Rows[n]["BKAUTHOR"] != null && dt.Rows[n]["BKAUTHOR"].ToString() != "")
                    {
                        model.bkauthor = dt.Rows[n]["BKAUTHOR"].ToString();
                    }
                    if (dt.Rows[n]["DZID"] != null && dt.Rows[n]["DZID"].ToString() != "")
                    {
                        model.DZID = dt.Rows[n]["DZID"].ToString();
                    }
                    if (dt.Rows[n]["DZNAME"] != null && dt.Rows[n]["DZNAME"].ToString() != "")
                    {
                        model.DZNAME = dt.Rows[n]["DZNAME"].ToString();
                    }
                    if (dt.Rows[n]["DZYEAR"] != null && dt.Rows[n]["DZYEAR"].ToString() != "")
                    {
                        model.DZYEAR = (int)dt.Rows[n]["DZYEAR"];
                    }
                    if (dt.Rows[n]["DZDUTY"] != null && dt.Rows[n]["DZDUTY"].ToString() != "")
                    {
                        model.DZDUTY = dt.Rows[n]["DZDUTY"].ToString();
                    }
                    if (dt.Rows[n]["DZADDRESS"] != null && dt.Rows[n]["DZADDRESS"].ToString() != "")
                    {
                        model.DZADDRESS = dt.Rows[n]["DZADDRESS"].ToString();
                    }
                    if (b == 0)
                    {
                        foreach (char a in c)
                        {
                            while (num < model.DZNAME.Length)
                            {
                                mark = false;
                                if (a == model.DZNAME[num])
                                {
                                    Sq++;
                                    mark = true;
                                }
                                if (mark)
                                {
                                    num++;
                                    break;
                                }
                                num++;
                            }

                            charA++;
                        }
                        if (charA == Sq)
                        {
                            modelList.Add(model);
                        }
                        charA = 0;
                        num   = 0;
                        Sq    = 0;
                    }
                    else if (b == 1)
                    {
                        foreach (char a in c)
                        {
                            while (num < model.bkname.Length)
                            {
                                mark = false;
                                if (a == model.bkname[num])
                                {
                                    Sq++;
                                    mark = true;
                                }
                                if (mark)
                                {
                                    num++;
                                    break;
                                }
                                num++;
                            }

                            charA++;
                        }
                        if (charA == Sq)
                        {
                            modelList.Add(model);
                        }
                        charA = 0;
                        num   = 0;
                        Sq    = 0;
                    }
                    else if (b == 2)
                    {
                        foreach (char a in c)
                        {
                            while (num < model.DZID.Length)
                            {
                                mark = false;
                                if (a == model.DZID[num])
                                {
                                    Sq++;
                                    mark = true;
                                }
                                if (mark)
                                {
                                    num++;
                                    break;
                                }
                                num++;
                            }

                            charA++;
                        }
                        if (charA == Sq)
                        {
                            modelList.Add(model);
                        }
                        charA = 0;
                        num   = 0;
                        Sq    = 0;
                    }
                }
            }
            return(modelList);
        }