Exemplo n.º 1
0
        public BaseOutput DeleteSMSModel(Int64 id)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;

            try
            {
                tbl_SMSModel _SMSModel = cRUDOperation.GetSMSModelByID(id);

                if (_SMSModel != null)
                {
                    List <tbl_SMSDetail> tbl_SMSDetails = cRUDOperation.GetSMSDetailsByModelID(_SMSModel.ID);

                    foreach (var item in tbl_SMSDetails)
                    {
                        tbl_SMSDetail tbl_SMSDetail = cRUDOperation.DeleteSMSDetail(item.ID, 0);
                    }



                    tbl_SMSModel tbl_SMSModel = cRUDOperation.DeleteSMSModel(id, 0);
                }

                return(baseOutput = new BaseOutput(true, BOResultTypes.Success.GetHashCode(), BOBaseOutputResponse.SuccessResponse, ""));
            }
            catch (Exception ex)
            {
                return(baseOutput = new BaseOutput(false, BOResultTypes.Danger.GetHashCode(), BOBaseOutputResponse.DangerResponse, ex.Message));
            }
        }