Exemplo n.º 1
0
 public string GetDataVaule(string DataType, string DataKey, string websiteOwner)
 {
     Model.KeyVauleDataInfo data = Get <Model.KeyVauleDataInfo>(string.Format(" DataType='{0}' AND DataKey='{1}' AND WebsiteOwner = '{2}'", DataType, DataKey, websiteOwner));
     if (data == null)
     {
         return("");
     }
     return(data.DataValue);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 获取DataValue
 /// </summary>
 /// <param name="DataType"></param>
 /// <param name="DataKey"></param>
 /// <returns></returns>
 public string GetDataDefVaule(string DataType, string DataKey, string DefValue = "", string websiteOwner = "")
 {
     string where = string.Format(" DataType='{0}' AND DataKey='{1}'", DataType, DataKey);
     if (!string.IsNullOrWhiteSpace(websiteOwner))
     {
         where = string.Format(" DataType='{0}' AND DataKey='{1}' AND WebsiteOwner='{2}'", DataType, DataKey, websiteOwner);
     }
     Model.KeyVauleDataInfo data = Get <Model.KeyVauleDataInfo>(where);
     if (data == null)
     {
         return(DefValue);
     }
     return(data.DataValue);
 }
Exemplo n.º 3
0
 public bool PutDataValue(Model.KeyVauleDataInfo vlueData)
 {
     Model.KeyVauleDataInfo data = Get <Model.KeyVauleDataInfo>(string.Format(" DataType='{0}' AND DataKey='{1}'", vlueData.DataType, vlueData.DataKey));
     if (data == null)
     {
         return(Add(vlueData));
     }
     else
     {
         data.Creater    = vlueData.Creater;
         data.CreateTime = vlueData.CreateTime;
         data.DataValue  = vlueData.DataValue;
         data.PreKey     = vlueData.PreKey;
         return(Update(data));
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="vlueData"></param>
        /// <param name="tran"></param>
        /// <returns></returns>
        public bool PutDataValue(Model.KeyVauleDataInfo vlueData, BLLTransaction tran = null)
        {
            if (string.IsNullOrWhiteSpace(vlueData.DataValue))
            {
                return(true);
            }

            Model.KeyVauleDataInfo data = Get <Model.KeyVauleDataInfo>(string.Format(" DataType='{0}' AND DataKey='{1}' AND WebsiteOwner='{2}'  ",
                                                                                     vlueData.DataType, vlueData.DataKey, vlueData.WebsiteOwner), tran);
            if (data != null)
            {
                vlueData.AutoId = data.AutoId;
            }
            if (vlueData.AutoId == 0)
            {
                return(tran == null?Add(vlueData) : Add(vlueData, tran));
            }
            else
            {
                return(tran == null?Update(vlueData) : Update(vlueData, tran));
            }
        }