예제 #1
0
        public List <Chain.Model.StaffMoney> DataTableToList(DataTable dt)
        {
            List <Chain.Model.StaffMoney> modelList = new List <Chain.Model.StaffMoney>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.StaffMoney model = new Chain.Model.StaffMoney();
                    if (dt.Rows[i]["StaffMoneyID"] != null && dt.Rows[i]["StaffMoneyID"].ToString() != "")
                    {
                        model.StaffMoneyID = int.Parse(dt.Rows[i]["StaffMoneyID"].ToString());
                    }
                    if (dt.Rows[i]["StaffID"] != null && dt.Rows[i]["StaffID"].ToString() != "")
                    {
                        model.StaffID = int.Parse(dt.Rows[i]["StaffID"].ToString());
                    }
                    if (dt.Rows[i]["StaffTotalMoney"] != null && dt.Rows[i]["StaffTotalMoney"].ToString() != "")
                    {
                        model.StaffTotalMoney = decimal.Parse(dt.Rows[i]["StaffTotalMoney"].ToString());
                    }
                    if (dt.Rows[i]["StaffOrderCode"] != null && dt.Rows[i]["StaffOrderCode"].ToString() != "")
                    {
                        model.StaffOrderCode = dt.Rows[i]["StaffOrderCode"].ToString();
                    }
                    if (dt.Rows[i]["StaffMemID"] != null && dt.Rows[i]["StaffMemID"].ToString() != "")
                    {
                        model.StaffMemID = int.Parse(dt.Rows[i]["StaffMemID"].ToString());
                    }
                    if (dt.Rows[i]["StaffGoodsID"] != null && dt.Rows[i]["StaffGoodsID"].ToString() != "")
                    {
                        model.StaffGoodsID = int.Parse(dt.Rows[i]["StaffGoodsID"].ToString());
                    }
                    if (dt.Rows[i]["StaffShopID"] != null && dt.Rows[i]["StaffShopID"].ToString() != "")
                    {
                        model.StaffShopID = int.Parse(dt.Rows[i]["StaffShopID"].ToString());
                    }
                    if (dt.Rows[i]["StaffCreateTime"] != null && dt.Rows[i]["StaffCreateTime"].ToString() != "")
                    {
                        model.StaffCreateTime = DateTime.Parse(dt.Rows[i]["StaffCreateTime"].ToString());
                    }
                    if (dt.Rows[i]["StaffOrderDetailID"] != null && dt.Rows[i]["StaffOrderDetailID"].ToString() != "")
                    {
                        model.StaffOrderDetailID = int.Parse(dt.Rows[i]["StaffOrderDetailID"].ToString());
                    }
                    if (dt.Rows[i]["StaffType"] != null && dt.Rows[i]["StaffType"].ToString() != "")
                    {
                        model.StaffType = int.Parse(dt.Rows[i]["StaffType"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 public bool Update(Chain.Model.StaffMoney model)
 {
     return(this.dal.Update(model));
 }
예제 #3
0
 public int Add(Chain.Model.StaffMoney model)
 {
     return(this.dal.Add(model));
 }