Exemplo n.º 1
0
        public List <Chain.Model.ScreenPopUp> DataTableToList(DataTable dt)
        {
            List <Chain.Model.ScreenPopUp> modelList = new List <Chain.Model.ScreenPopUp>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.ScreenPopUp model = new Chain.Model.ScreenPopUp();
                    if (dt.Rows[i]["CallerID"] != null && dt.Rows[i]["CallerID"].ToString() != "")
                    {
                        model.CallerID = int.Parse(dt.Rows[i]["CallerID"].ToString());
                    }
                    if (dt.Rows[i]["CallerMemID"] != null && dt.Rows[i]["CallerMemID"].ToString() != "")
                    {
                        model.CallerMemID = int.Parse(dt.Rows[i]["CallerMemID"].ToString());
                    }
                    if (dt.Rows[i]["CallerMobile"] != null && dt.Rows[i]["CallerMobile"].ToString() != "")
                    {
                        model.CallerMobile = dt.Rows[i]["CallerMobile"].ToString();
                    }
                    if (dt.Rows[i]["CallerIsMem"] != null && dt.Rows[i]["CallerIsMem"].ToString() != "")
                    {
                        model.CallerIsMem = dt.Rows[i]["CallerIsMem"].ToString();
                    }
                    if (dt.Rows[i]["CallerState"] != null && dt.Rows[i]["CallerState"].ToString() != "")
                    {
                        model.CallerState = dt.Rows[i]["CallerState"].ToString();
                    }
                    if (dt.Rows[i]["CallerDuration"] != null && dt.Rows[i]["CallerDuration"].ToString() != "")
                    {
                        model.CallerDuration = dt.Rows[i]["CallerDuration"].ToString();
                    }
                    if (dt.Rows[i]["CallerRemark"] != null && dt.Rows[i]["CallerRemark"].ToString() != "")
                    {
                        model.CallerRemark = dt.Rows[i]["CallerRemark"].ToString();
                    }
                    if (dt.Rows[i]["CallerCreateTime"] != null && dt.Rows[i]["CallerCreateTime"].ToString() != "")
                    {
                        model.CallerCreateTime = DateTime.Parse(dt.Rows[i]["CallerCreateTime"].ToString());
                    }
                    if (dt.Rows[i]["CallerUserID"] != null && dt.Rows[i]["CallerUserID"].ToString() != "")
                    {
                        model.CallerUserID = int.Parse(dt.Rows[i]["CallerUserID"].ToString());
                    }
                    if (dt.Rows[i]["CallerShopID"] != null && dt.Rows[i]["CallerShopID"].ToString() != "")
                    {
                        model.CallerShopID = int.Parse(dt.Rows[i]["CallerShopID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 public bool Update(Chain.Model.ScreenPopUp model)
 {
     return(this.dal.Update(model));
 }
Exemplo n.º 3
0
 public int Add(Chain.Model.ScreenPopUp model)
 {
     return(this.dal.Add(model));
 }