コード例 #1
0
    /// <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
    }
コード例 #2
0
    /// <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
    }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LPWeb.Model.ProspectAssets model)
 {
     return(dal.Update(model));
 }
コード例 #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.ProspectAssets model)
 {
     return(dal.Add(model));
 }