/// <summary> /// /// </summary> /// <param name="iContactId"></param> /// <param name="sLiquidAssets"></param> private void UpdateProspectAssets(int iProspectAssetsID, string sLiquidAssets) { #region update ProspectAssets ProspectAssets ProspectAssetsMgr = new ProspectAssets(); LPWeb.Model.ProspectAssets ProspectAssetsModel = ProspectAssetsMgr.GetModel(iProspectAssetsID); if (sLiquidAssets == string.Empty) { ProspectAssetsModel.Amount = null; } else { ProspectAssetsModel.Amount = Convert.ToDecimal(sLiquidAssets); } ProspectAssetsMgr.Update(ProspectAssetsModel); #endregion }
/// <summary> /// /// </summary> /// <param name="iContactId"></param> /// <param name="sLiquidAssets"></param> private void CreateProspectAssets(int iContactId, string sLiquidAssets) { #region create ProspectAssets LPWeb.Model.ProspectAssets ProspectAssetsModel = new LPWeb.Model.ProspectAssets(); ProspectAssetsModel.ContactId = iContactId; if (sLiquidAssets == string.Empty) { ProspectAssetsModel.Amount = null; } else { ProspectAssetsModel.Amount = Convert.ToDecimal(sLiquidAssets); } ProspectAssetsModel.Type = "Other"; ProspectAssets ProspectAssetsMgr = new ProspectAssets(); ProspectAssetsMgr.Add(ProspectAssetsModel); #endregion }
/// <summary> /// 获得数据列表 /// </summary> public List <LPWeb.Model.ProspectAssets> DataTableToList(DataTable dt) { List <LPWeb.Model.ProspectAssets> modelList = new List <LPWeb.Model.ProspectAssets>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LPWeb.Model.ProspectAssets model; for (int n = 0; n < rowsCount; n++) { model = new LPWeb.Model.ProspectAssets(); if (dt.Rows[n]["ProspectAssetId"] != null && dt.Rows[n]["ProspectAssetId"].ToString() != "") { model.ProspectAssetId = int.Parse(dt.Rows[n]["ProspectAssetId"].ToString()); } if (dt.Rows[n]["ContactId"] != null && dt.Rows[n]["ContactId"].ToString() != "") { model.ContactId = int.Parse(dt.Rows[n]["ContactId"].ToString()); } if (dt.Rows[n]["Name"] != null && dt.Rows[n]["Name"].ToString() != "") { model.Name = dt.Rows[n]["Name"].ToString(); } if (dt.Rows[n]["Account"] != null && dt.Rows[n]["Account"].ToString() != "") { model.Account = dt.Rows[n]["Account"].ToString(); } if (dt.Rows[n]["Amount"] != null && dt.Rows[n]["Amount"].ToString() != "") { model.Amount = decimal.Parse(dt.Rows[n]["Amount"].ToString()); } if (dt.Rows[n]["Type"] != null && dt.Rows[n]["Type"].ToString() != "") { model.Type = dt.Rows[n]["Type"].ToString(); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(LPWeb.Model.ProspectAssets model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LPWeb.Model.ProspectAssets model) { return(dal.Add(model)); }