public BaseOutput DeleteCALLModel(Int64 id) { CRUDOperation cRUDOperation = new CRUDOperation(); BaseOutput baseOutput; try { tbl_CALLModel _CALLModel = cRUDOperation.GetCALLModelByID(id); if (_CALLModel != null) { List <tbl_CALLDetail> tbl_CALLDetails = cRUDOperation.GetCALLDetailsByModelID(_CALLModel.ID); foreach (var item in tbl_CALLDetails) { tbl_CALLDetail tbl_CALLDetail = cRUDOperation.DeleteCALLDetail(item.ID, 0); } tbl_CALLModel tbl_CALLModel = cRUDOperation.DeleteCALLModel(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)); } }
public BaseOutput UpdateCALLModel(CALLModel item) { CRUDOperation cRUDOperation = new CRUDOperation(); BaseOutput baseOutput; try { tbl_CALLModel tblCALLModel = new tbl_CALLModel() { ID = item.ID, UserID = item.UserID, TotalCallCount = item.TotalCallCount, OutCallCount = item.OutCallCount, OutCallSecond = item.OutCallSecond, InCallCount = item.InCallCount, InCallSecond = item.InCallSecond, MissedCallCount = item.MissedCallCount, OutCallForeignCount = item.OutCallForeignCount, OutCallForeignSecond = item.OutCallForeignSecond, InCallForeignCount = item.InCallForeignCount, InCallForeignSecond = item.InCallForeignSecond, OutCallRoamingCount = item.OutCallRoamingCount, OutCallRoamingSecond = item.OutCallRoamingSecond, InCallRoamingCount = item.InCallRoamingCount, InCallRoamingSecond = item.InCallRoamingSecond, BeginDate = item.BeginDate, EndDate = item.EndDate, }; tbl_CALLModel _CALLModel = cRUDOperation.UpdateCALLModel(tblCALLModel); if (_CALLModel != null) { foreach (var callDetail in item.CALLDetails) { tbl_CALLDetail tblCALLDetail = cRUDOperation.UpdateCALLDetail(callDetail); } } 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)); } }
public BaseOutput GetCALLModelsByID(Int64 id, out CALLModel callModel) { CRUDOperation cRUDOperation = new CRUDOperation(); BaseOutput baseOutput; callModel = null; try { tbl_CALLModel item = cRUDOperation.GetCALLModelByID(id); if (item != null) { callModel = new CALLModel() { ID = item.ID, UserID = item.UserID, TotalCallCount = item.TotalCallCount, OutCallCount = item.OutCallCount, OutCallSecond = item.OutCallSecond, InCallCount = item.InCallCount, InCallSecond = item.InCallSecond, MissedCallCount = item.MissedCallCount, OutCallForeignCount = item.OutCallForeignCount, OutCallForeignSecond = item.OutCallForeignSecond, InCallForeignCount = item.InCallForeignCount, InCallForeignSecond = item.InCallForeignSecond, OutCallRoamingCount = item.OutCallRoamingCount, OutCallRoamingSecond = item.OutCallRoamingSecond, InCallRoamingCount = item.InCallRoamingCount, InCallRoamingSecond = item.InCallRoamingSecond, BeginDate = item.BeginDate, EndDate = item.EndDate }; List <tbl_CALLDetail> tblCALLDetails = cRUDOperation.GetCALLDetailsByModelID(callModel.ID); callModel.CALLDetails = tblCALLDetails; } 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)); } }
public BaseOutput AddCALLModel(CALLModel item) { CRUDOperation cRUDOperation = new CRUDOperation(); BaseOutput baseOutput; try { tbl_CALLModel callModel = new tbl_CALLModel() { UserID = item.UserID, TotalCallCount = item.TotalCallCount, OutCallCount = item.OutCallCount, OutCallSecond = item.OutCallSecond, InCallCount = item.InCallCount, InCallSecond = item.InCallSecond, MissedCallCount = item.MissedCallCount, OutCallForeignCount = item.OutCallForeignCount, OutCallForeignSecond = item.OutCallForeignSecond, InCallForeignCount = item.InCallForeignCount, InCallForeignSecond = item.InCallForeignSecond, OutCallRoamingCount = item.OutCallRoamingCount, OutCallRoamingSecond = item.OutCallRoamingSecond, InCallRoamingCount = item.InCallRoamingCount, InCallRoamingSecond = item.InCallRoamingSecond, BeginDate = item.BeginDate, EndDate = item.EndDate, }; List <tbl_CALLDetail> tblCALLDetails = new List <tbl_CALLDetail>(); tblCALLDetails = item.CALLDetails; tbl_CALLModel _CALLModel = cRUDOperation.AddCALLModel(callModel, tblCALLDetails); 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)); } }