Exemple #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <TFXK.Model.UserJiamen> DataTableToList(DataTable dt)
        {
            List <TFXK.Model.UserJiamen> modelList = new List <TFXK.Model.UserJiamen>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TFXK.Model.UserJiamen model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TFXK.Model.UserJiamen();
                    if (dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    model.typeID      = dt.Rows[n]["typeID"].ToString();
                    model.Jijie       = dt.Rows[n]["Jijie"].ToString();
                    model.chkOrderNum = dt.Rows[n]["chkOrderNum"].ToString();
                    if (dt.Rows[n]["orderNum"].ToString() != "")
                    {
                        model.orderNum = int.Parse(dt.Rows[n]["orderNum"].ToString());
                    }
                    model.hopePrice       = dt.Rows[n]["hopePrice"].ToString();
                    model.proCode         = dt.Rows[n]["proCode"].ToString();
                    model.otherDes        = dt.Rows[n]["otherDes"].ToString();
                    model.filePaths       = dt.Rows[n]["filePaths"].ToString();
                    model.contactUserName = dt.Rows[n]["contactUserName"].ToString();
                    if (dt.Rows[n]["userSex"].ToString() != "")
                    {
                        model.userSex = int.Parse(dt.Rows[n]["userSex"].ToString());
                    }
                    model.userTel        = dt.Rows[n]["userTel"].ToString();
                    model.userPhone      = dt.Rows[n]["userPhone"].ToString();
                    model.userEmail      = dt.Rows[n]["userEmail"].ToString();
                    model.companyName    = dt.Rows[n]["companyName"].ToString();
                    model.companyAddress = dt.Rows[n]["companyAddress"].ToString();
                    if (dt.Rows[n]["stateID"].ToString() != "")
                    {
                        model.stateID = int.Parse(dt.Rows[n]["stateID"].ToString());
                    }
                    model.des1 = dt.Rows[n]["des1"].ToString();
                    model.des2 = dt.Rows[n]["des2"].ToString();
                    model.des3 = dt.Rows[n]["des3"].ToString();
                    model.des4 = dt.Rows[n]["des4"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TFXK.Model.UserJiamen model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TFXK.Model.UserJiamen model)
 {
     return(dal.Add(model));
 }