コード例 #1
0
        public BaseOutput DeleteNetConsumeModel(Int64 id)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;

            try
            {
                tbl_NetConsumeModel _NetConsumeModel = cRUDOperation.GetNetConsumeModelByID(id);

                if (_NetConsumeModel != null)
                {
                    List <tbl_NetConsumeDetail> netConsumeDetails = cRUDOperation.GetNetConsumeDetailsByModelID(_NetConsumeModel.ID);

                    foreach (var item in netConsumeDetails)
                    {
                        tbl_NetConsumeDetail tbl_NetConsumeDeatilDB = cRUDOperation.DeleteNetConsumeDetail(item.ID, 0);
                    }



                    tbl_NetConsumeModel netConsumeModel = cRUDOperation.DeleteNetConsumeModel(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));
            }
        }