public ModelInvokeResult <SmsSendPK> Create(SmsSend smsSend)
        {
            ModelInvokeResult <SmsSendPK> result = new ModelInvokeResult <SmsSendPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (smsSend.Id == -1)
                {
                    smsSend.Id = null;
                }
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = smsSend.GetCreateMethodName(), ParameterObject = smsSend.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new SmsSendPK {
                    Id = smsSend.Id
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
        public ModelInvokeResult <SmsSendPK> Update(string strId, SmsSend smsSend)
        {
            ModelInvokeResult <SmsSendPK> result = new ModelInvokeResult <SmsSendPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                int _Id = Convert.ToInt32(strId);
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = smsSend.GetUpdateMethodName(), ParameterObject = smsSend.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new SmsSendPK {
                    Id = _Id
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
示例#3
0
        public InvokeResult Update2(SmsSend smsSend)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            smsSend.SendTime = DateTime.Now;
            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = "SmsSend_Update2", ParameterObject = smsSend.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }