Пример #1
0
 public void Update(SalutationDetails Details)
 {
     try
     {
         Save(Details);
     }
     catch (Exception ex)
     {
         throw base.ThrowException(ex);
     }
 }
Пример #2
0
        public Int32 Insert(SalutationDetails Details)
        {
            try
            {
                Save(Details);

                return Int32.Parse(base.getLAST_INSERT_ID(this));
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Пример #3
0
        public Int32 Save(SalutationDetails Details)
        {
            try
            {
                string SQL = "CALL procSaveSalutation(@SalutationID, @SalutationCode, @SalutationName, @CreatedOn, @LastModified);";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("SalutationID", Details.SalutationID);
                cmd.Parameters.AddWithValue("SalutationCode", Details.SalutationCode);
                cmd.Parameters.AddWithValue("SalutationName", Details.SalutationName);
                cmd.Parameters.AddWithValue("CreatedOn", Details.CreatedOn == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreatedOn);
                cmd.Parameters.AddWithValue("LastModified", Details.LastModified == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.LastModified);

                return base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }