Exemplo n.º 1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.Unify.Tb_Unify_Corp model)
 {
     dal.Add(model);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Unify.Tb_Unify_Corp model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.Unify.Tb_Unify_Corp> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.Unify.Tb_Unify_Corp> modelList = new List <MobileSoft.Model.Unify.Tb_Unify_Corp>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.Unify.Tb_Unify_Corp model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Unify.Tb_Unify_Corp();
                    if (dt.Rows[n]["CorpSynchCode"].ToString() != "")
                    {
                        model.CorpSynchCode = new Guid(dt.Rows[n]["CorpSynchCode"].ToString());
                    }
                    //model.UnCorpID=dt.Rows[n]["UnCorpID"].ToString();
                    if (dt.Rows[n]["VSPID"].ToString() != "")
                    {
                        model.VSPID = int.Parse(dt.Rows[n]["VSPID"].ToString());
                    }
                    if (dt.Rows[n]["CorpID"].ToString() != "")
                    {
                        model.CorpID = int.Parse(dt.Rows[n]["CorpID"].ToString());
                    }
                    model.CorpName = dt.Rows[n]["CorpName"].ToString();
                    model.Province = dt.Rows[n]["Province"].ToString();
                    model.City     = dt.Rows[n]["City"].ToString();
                    model.Borough  = dt.Rows[n]["Borough"].ToString();
                    if (dt.Rows[n]["RegMode"].ToString() != "")
                    {
                        model.RegMode = int.Parse(dt.Rows[n]["RegMode"].ToString());
                    }
                    model.CorpTypeName  = dt.Rows[n]["CorpTypeName"].ToString();
                    model.CorpAddress   = dt.Rows[n]["CorpAddress"].ToString();
                    model.CorpPost      = dt.Rows[n]["CorpPost"].ToString();
                    model.CorpDeputy    = dt.Rows[n]["CorpDeputy"].ToString();
                    model.CorpLinkMan   = dt.Rows[n]["CorpLinkMan"].ToString();
                    model.CorpMobileTel = dt.Rows[n]["CorpMobileTel"].ToString();
                    model.CorpWorkedTel = dt.Rows[n]["CorpWorkedTel"].ToString();
                    model.CorpFax       = dt.Rows[n]["CorpFax"].ToString();
                    model.CorpEmail     = dt.Rows[n]["CorpEmail"].ToString();
                    model.CorpWeb       = dt.Rows[n]["CorpWeb"].ToString();
                    if (dt.Rows[n]["RegDate"].ToString() != "")
                    {
                        model.RegDate = DateTime.Parse(dt.Rows[n]["RegDate"].ToString());
                    }
                    model.SysVersion = dt.Rows[n]["SysVersion"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    if (dt.Rows[n]["SynchFlag"].ToString() != "")
                    {
                        model.SynchFlag = int.Parse(dt.Rows[n]["SynchFlag"].ToString());
                    }
                    model.ServerIP = dt.Rows[n]["ServerIP"].ToString();
                    model.SysDir   = dt.Rows[n]["SysDir"].ToString();
                    if (dt.Rows[n]["CorpSort"].ToString() != "")
                    {
                        model.CorpSort = int.Parse(dt.Rows[n]["CorpSort"].ToString());
                    }
                    if (dt.Rows[n]["IsRecommend"].ToString() != "")
                    {
                        model.IsRecommend = int.Parse(dt.Rows[n]["IsRecommend"].ToString());
                    }
                    model.RecommendIndex = dt.Rows[n]["RecommendIndex"].ToString();
                    model.LogoImgUrl     = dt.Rows[n]["LogoImgUrl"].ToString();
                    model.CorpShortName  = dt.Rows[n]["CorpShortName"].ToString();
                    if (dt.Rows[n]["CorpSNum"].ToString() != "")
                    {
                        model.CorpSNum = int.Parse(dt.Rows[n]["CorpSNum"].ToString());
                    }
                    model.Street        = dt.Rows[n]["Street"].ToString();
                    model.CommunityName = dt.Rows[n]["CommunityName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }