Ejemplo n.º 1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long  Add(university.Model.CCOM.User_property model)
 {
     return(dal.Add(model));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.User_property model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <university.Model.CCOM.User_property> DataTableToList(DataTable dt)
        {
            List <university.Model.CCOM.User_property> modelList = new List <university.Model.CCOM.User_property>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                university.Model.CCOM.User_property model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.User_property();
                    if (dt.Rows[n]["UP_id"].ToString() != "")
                    {
                        model.UP_id = long.Parse(dt.Rows[n]["UP_id"].ToString());
                    }
                    model.UP_ID_picture = dt.Rows[n]["UP_ID_picture"].ToString();
                    model.UP_picture    = dt.Rows[n]["UP_picture"].ToString();
                    if (dt.Rows[n]["UP_nation"].ToString() != "")
                    {
                        model.UP_nation = int.Parse(dt.Rows[n]["UP_nation"].ToString());
                    }
                    if (dt.Rows[n]["UP_nationality"].ToString() != "")
                    {
                        model.UP_nationality = int.Parse(dt.Rows[n]["UP_nationality"].ToString());
                    }
                    if (dt.Rows[n]["UP_politics"].ToString() != "")
                    {
                        model.UP_politics = int.Parse(dt.Rows[n]["UP_politics"].ToString());
                    }
                    if (dt.Rows[n]["UP_degree"].ToString() != "")
                    {
                        model.UP_degree = int.Parse(dt.Rows[n]["UP_degree"].ToString());
                    }
                    model.UP_high_school = dt.Rows[n]["UP_high_school"].ToString();
                    model.UP_CEE_number  = dt.Rows[n]["UP_CEE_number"].ToString();
                    model.UP_AEE_number  = dt.Rows[n]["UP_AEE_number"].ToString();
                    model.UP_AEE_picture = dt.Rows[n]["UP_AEE_picture"].ToString();
                    model.UP_PE_Iphone   = dt.Rows[n]["UP_PE_Iphone"].ToString();
                    model.UP_PE_Aphone   = dt.Rows[n]["UP_PE_Aphone"].ToString();
                    if (dt.Rows[n]["UP_province"].ToString() != "")
                    {
                        model.UP_province = int.Parse(dt.Rows[n]["UP_province"].ToString());
                    }
                    model.UP_address        = dt.Rows[n]["UP_address"].ToString();
                    model.UP_receiver       = dt.Rows[n]["UP_receiver"].ToString();
                    model.UP_receiver_phone = dt.Rows[n]["UP_receiver_phone"].ToString();
                    model.UP_postal_code    = dt.Rows[n]["UP_postal_code"].ToString();
                    if (dt.Rows[n]["User_id"].ToString() != "")
                    {
                        model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString());
                    }
                    if (dt.Rows[n]["Agency_id"].ToString() != "")
                    {
                        model.Agency_id = int.Parse(dt.Rows[n]["Agency_id"].ToString());
                    }
                    if (dt.Rows[n]["Period_id"].ToString() != "")
                    {
                        model.Period_id = int.Parse(dt.Rows[n]["Period_id"].ToString());
                    }
                    model.UP_CCOM_number = dt.Rows[n]["UP_CCOM_number"].ToString();
                    if (dt.Rows[n]["UP_calculation_status"].ToString() != "")
                    {
                        model.UP_calculation_status = int.Parse(dt.Rows[n]["UP_calculation_status"].ToString());
                    }
                    if (dt.Rows[n]["UP_overseas"].ToString() != "")
                    {
                        if ((dt.Rows[n]["UP_overseas"].ToString() == "1") || (dt.Rows[n]["UP_overseas"].ToString().ToLower() == "true"))
                        {
                            model.UP_overseas = true;
                        }
                        else
                        {
                            model.UP_overseas = false;
                        }
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }