Пример #1
0
 public Common.Data.JsonData Add(Organze model)
 {
     Common.Data.JsonData json = new Common.Data.JsonData()
     {
         Result = true
     };
     if (string.IsNullOrEmpty(model.Name))
     {
         json.Message = Lang.Tip_NameIsRequired;
         return(json);
     }
     if (string.IsNullOrEmpty(model.Code))
     {
         model.Code = model.Name.TextConvertChar();
     }
     model.CreateTime = DateTime.Now;
     try
     {
         json.Success = organzeDal.Add(model);
     }
     catch (Exception ex)
     {
         json.Message = ex.Message;
     }
     return(json);
 }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool Add(Organze entity)
        {
            string       sqlFormat = SqlCmdHelper.GenerateInsertSql <Organze>();
            SqlCmdHelper help      = new SqlCmdHelper()
            {
                SqlConnString = SqlConnString
            };

            SqlCmdHelper.SqlRuleMapResult rule = new SqlCmdHelper.SqlRuleMapResult();
            help.InsertSqlParam(sqlFormat, entity, rule);
            return(help.ExcuteNoQuery(string.Join(";", rule.WaitExcuteSql), rule.SqlParams.ToArray()) > 0);
        }
 public bool Edit(Organze entity)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public List <Organze> QueryWhere(Organze model)
 {
     throw new NotImplementedException();
 }