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

            if (rowsCount > 0)
            {
                Hownet.Model.WorkTicketIDBack model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.WorkTicketIDBack();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["DateTime"].ToString() != "")
                    {
                        model.DateTime = DateTime.Parse(dt.Rows[n]["DateTime"].ToString());
                    }

                    model.TicketIDCardID = dt.Rows[n]["TicketIDCardID"].ToString().Trim();

                    if (dt.Rows[n]["EmployeeIDCardID"].ToString() != "")
                    {
                        model.EmployeeIDCardID = int.Parse(dt.Rows[n]["EmployeeIDCardID"].ToString());
                    }
                    if (dt.Rows[n]["WorkTicketID"].ToString() != "")
                    {
                        model.WorkTicketID = int.Parse(dt.Rows[n]["WorkTicketID"].ToString());
                    }
                    if (dt.Rows[n]["WorkingID"].ToString() != "")
                    {
                        model.WorkingID = int.Parse(dt.Rows[n]["WorkingID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Hownet.Model.WorkTicketIDBack model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.WorkTicketIDBack model)
 {
     return(dal.Add(model));
 }