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

            if (rowsCount > 0)
            {
                MobileSoft.Model.SQMSys.Tb_Sys_Organ model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model           = new MobileSoft.Model.SQMSys.Tb_Sys_Organ();
                    model.OrganCode = dt.Rows[n]["OrganCode"].ToString();
                    if (dt.Rows[n]["StreetCode"].ToString() != "")
                    {
                        model.StreetCode = new Guid(dt.Rows[n]["StreetCode"].ToString());
                    }
                    model.OrganName = dt.Rows[n]["OrganName"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    if (dt.Rows[n]["IsComp"].ToString() != "")
                    {
                        model.IsComp = int.Parse(dt.Rows[n]["IsComp"].ToString());
                    }
                    if (dt.Rows[n]["Num"].ToString() != "")
                    {
                        model.Num = int.Parse(dt.Rows[n]["Num"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.SQMSys.Tb_Sys_Organ model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.SQMSys.Tb_Sys_Organ model)
 {
     dal.Add(model);
 }