Exemplo n.º 1
0
        private void Insert_template(string account, string mess)
        {
            DTO_SMS_Template tem      = new DTO_SMS_Template();
            DAO_SMS_Template _temlate = new DAO_SMS_Template();

            tem.ID           = _temlate.RandomID();
            tem.Account      = account;
            tem.SMS_Template = mess;
            _temlate.Insert(tem);
        }
        public bool Delete(DTO_SMS_Template _temp)
        {
            Connet();
            string sql = "delete from SMS_TEMPLATE  where ID=@ID";

            try
            {
                _cmd = new SqlCommand(sql, _conn);
                _cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = _temp.ID;
                _cmd.ExecuteNonQuery();
                _cmd.Dispose();
                Disconnet();
            }
            catch (Exception ex)
            {
                Disconnet();
                return(false);

                throw ex;
            }
            return(true);
        }
        public bool Insert(DTO_SMS_Template _temp)
        {
            Connet();
            string sql = "insert into SMS_Template( SMS_Template, ID, Account) values (@SMS_Template, @ID, @Account)";

            try
            {
                _cmd = new SqlCommand(sql, _conn);
                _cmd.Parameters.Add("@SMS_Template", SqlDbType.NVarChar).Value = _temp.SMS_Template;
                _cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value            = _temp.ID;
                _cmd.Parameters.Add("@AccountID", SqlDbType.VarChar).Value     = _temp.Account;
                _cmd.ExecuteNonQuery();
                _cmd.Dispose();
                Disconnet();
            }
            catch (Exception ex)
            {
                Disconnet();
                return(false);

                throw ex;
            }
            return(true);
        }
        public bool Update(DTO_SMS_Template _temp)
        {
            Connet();
            string sql = "update Customer set SMS_Template=@SMS_Template,AccountID=@AccountID  Where ID=@ID";

            try
            {
                _cmd = new SqlCommand(sql, _conn);
                _cmd.Parameters.Add("@SMS_Template", SqlDbType.NVarChar).Value = _temp.SMS_Template;
                _cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value            = _temp.ID;
                _cmd.Parameters.Add("@AccountID", SqlDbType.VarChar).Value     = _temp.Account;
                _cmd.ExecuteNonQuery();
                _cmd.Dispose();
                Disconnet();
            }
            catch (Exception ex)
            {
                Disconnet();
                return(false);

                throw ex;
            }
            return(true);
        }
Exemplo n.º 5
0
 public bool Update(DTO_SMS_Template _temp)
 {
     return(_BUStemp.Update(_temp));
 }
Exemplo n.º 6
0
 public bool Delete(DTO_SMS_Template _temp)
 {
     return(_BUStemp.Delete(_temp));
 }
Exemplo n.º 7
0
 public bool Insert(DTO_SMS_Template _temp)
 {
     return(_BUStemp.Insert(_temp));
 }