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

            if (rowsCount > 0)
            {
                MobileSoft.Model.Order.Tb_Order_Regist model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model              = new MobileSoft.Model.Order.Tb_Order_Regist();
                    model.RegistID     = dt.Rows[n]["RegistID"].ToString();
                    model.RegistNumber = dt.Rows[n]["RegistNumber"].ToString();
                    model.CustomerType = dt.Rows[n]["CustomerType"].ToString();
                    if (dt.Rows[n]["CommID"].ToString() != "")
                    {
                        model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString());
                    }
                    model.CustName = dt.Rows[n]["CustName"].ToString();
                    //model.CustID=dt.Rows[n]["CustID"].ToString();
                    model.MobilePhone = dt.Rows[n]["MobilePhone"].ToString();
                    model.Address     = dt.Rows[n]["Address"].ToString();
                    if (dt.Rows[n]["DocumentDate"].ToString() != "")
                    {
                        model.DocumentDate = DateTime.Parse(dt.Rows[n]["DocumentDate"].ToString());
                    }
                    model.RegistMessage     = dt.Rows[n]["RegistMessage"].ToString();
                    model.ProcessingStatus  = dt.Rows[n]["ProcessingStatus"].ToString();
                    model.ProcessingExplain = dt.Rows[n]["ProcessingExplain"].ToString();
                    //model.ReleaseID=dt.Rows[n]["ReleaseID"].ToString();
                    model.ScheduleType = dt.Rows[n]["ScheduleType"].ToString();
                    if (dt.Rows[n]["ReleaseServiceComDate"].ToString() != "")
                    {
                        model.ReleaseServiceComDate = DateTime.Parse(dt.Rows[n]["ReleaseServiceComDate"].ToString());
                    }
                    model.ReleaseServiceComtime = dt.Rows[n]["ReleaseServiceComtime"].ToString();
                    if (dt.Rows[n]["ReleaseStartTime"].ToString() != "")
                    {
                        model.ReleaseStartTime = DateTime.Parse(dt.Rows[n]["ReleaseStartTime"].ToString());
                    }
                    if (dt.Rows[n]["ReleaseEndTime"].ToString() != "")
                    {
                        model.ReleaseEndTime = DateTime.Parse(dt.Rows[n]["ReleaseEndTime"].ToString());
                    }
                    model.ReleasePeriodOfStarttime = dt.Rows[n]["ReleasePeriodOfStarttime"].ToString();
                    model.ReleasePeriodOfEndtime   = dt.Rows[n]["ReleasePeriodOfEndtime"].ToString();
                    model.UserCode = dt.Rows[n]["UserCode"].ToString();
                    if (dt.Rows[n]["IssueDate"].ToString() != "")
                    {
                        model.IssueDate = DateTime.Parse(dt.Rows[n]["IssueDate"].ToString());
                    }
                    //model.BussId=dt.Rows[n]["BussId"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    if (dt.Rows[n]["SumCount"].ToString() != "")
                    {
                        model.SumCount = decimal.Parse(dt.Rows[n]["SumCount"].ToString());
                    }
                    if (dt.Rows[n]["SumPrice"].ToString() != "")
                    {
                        model.SumPrice = decimal.Parse(dt.Rows[n]["SumPrice"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }