public HttpResponseMessage UpdateReportConfigParam(HttpRequestMessage reqObject) { int result = 0; _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject); if (_requestedDataObject != null && _requestedDataObject.BusinessData != null) { _ReportConfigParam = JsonConvert.DeserializeObject <ReportConfigParam>(_requestedDataObject.BusinessData); bool IsValid = ModelValidation.TryValidateModel(_IReportConfigarationService, out _modelErrorMsg); if (IsValid) { result = _IReportConfigarationService.UpdateReportConfigParam(_ReportConfigParam); } } if (!string.IsNullOrWhiteSpace(_modelErrorMsg)) { _serviceResponse = _IDataManipulation.SetResponseObject(result, _modelErrorMsg); } else if (result == 1) { _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been updated successfully"); } else { _serviceResponse = _IDataManipulation.SetResponseObject(result, "information hasn't been updated"); } _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject); return(_response); }
public int AddReportConfigParam(List <ReportConfigParam> _ReportConfigurationList) { try { int result = 0; if (_ReportConfigurationList != null && _ReportConfigurationList.Count > 0) { List <ReportConfigParam> List_ReportConfigParam = new List <ReportConfigParam>(); var _max = _IUoW.mTakaDbQuery().MaxSl(_ReportConfigurationList[0].FunctionId) + 1; for (int i = 0; i < _ReportConfigurationList.Count; i++) { ReportConfigParam _ObjReportConfigParam = new ReportConfigParam(); _ObjReportConfigParam.SlNo = _max; _ObjReportConfigParam.IsMandatory = _ReportConfigurationList[i].IsMandatory == "True" ? "1" : "0"; _ObjReportConfigParam.IsVisible = _ReportConfigurationList[i].IsVisible == "True" ? "1" : "0"; _ObjReportConfigParam.IsReadonly = _ReportConfigurationList[i].IsReadonly == "True" ? "1" : "0"; _ObjReportConfigParam.ControlType = _ReportConfigurationList[i].ControlType; _ObjReportConfigParam.DefaultValue = _ReportConfigurationList[i].DefaultValue; _ObjReportConfigParam.FunctionId = _ReportConfigurationList[i].FunctionId; _ObjReportConfigParam.ListSpName = _ReportConfigurationList[i].ListSpName; _ObjReportConfigParam.MaxValue = _ReportConfigurationList[i].MaxValue; _ObjReportConfigParam.MinValue = _ReportConfigurationList[i].MinValue; _ObjReportConfigParam.Parameter = _ReportConfigurationList[i].Parameter; _ObjReportConfigParam.ParameterDatatype = _ReportConfigurationList[i].ParameterDatatype; _ObjReportConfigParam.ParameterMaxlength = _ReportConfigurationList[i].ParameterMaxlength; _ObjReportConfigParam.ParameterName = _ReportConfigurationList[i].ParameterName; _ObjReportConfigParam.ParameterUserAsist = _ReportConfigurationList[i].ParameterUserAsist; _ObjReportConfigParam.AuthStatusId = "U"; _ObjReportConfigParam.LastAction = "ADD"; _ObjReportConfigParam.MakeBy = "mtaka"; _ObjReportConfigParam.MakeDT = System.DateTime.Now; _max += 1; List_ReportConfigParam.Add(_ObjReportConfigParam); } result = _IUoW.Repository <ReportConfigParam>().AddRange(List_ReportConfigParam); if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, null, List_ReportConfigParam, "ADD", "0001", _ReportConfigurationList[0].FunctionId, 1, "ReportConfigParam", "MTK_RPT_CONFIG_PARAM", "FunctionId", null, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } } if (result == 1) { _IUoW.Commit(); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "AddReportConfigParam(obj)", string.Empty); return(0); } }
public int UpdateReportConfigParam(ReportConfigParam _ReportConfiguration) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_ReportConfiguration.FunctionId)) { IsRecordExist = _IUoW.Repository <ReportConfigParam>().IsRecordExist(x => x.FunctionId == _ReportConfiguration.FunctionId && x.SlNo == _ReportConfiguration.SlNo); if (IsRecordExist) { //var _oldReportConfiguration = _IUoW.Repository<ReportConfigParam>().GetBy(x => x.FunctionId == _ReportConfiguration.FunctionId && x.SlNo == _ReportConfiguration.SlNo); //var _oldReportConfigurationForLog = ObjectCopier.DeepCopy(_oldReportConfiguration); _ReportConfiguration.IsMandatory = _ReportConfiguration.IsMandatory == "True" ? "1" : "0"; _ReportConfiguration.IsVisible = _ReportConfiguration.IsVisible == "True" ? "1" : "0"; _ReportConfiguration.IsReadonly = _ReportConfiguration.IsReadonly == "True" ? "1" : "0"; _ReportConfiguration.AuthStatusId = "U"; _ReportConfiguration.LastAction = "EDT"; _ReportConfiguration.LastUpdateDT = System.DateTime.Now; _ReportConfiguration.MakeBy = "mtaka"; result = _IUoW.Repository <ReportConfigParam>().Update(_ReportConfiguration); if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; //result = _IAuthLogService.AddAuthLog(_IUoW, null, _ReportConfiguration, "EDT", "0001", "090102010", 1, "ReportConfigParam", "MTK_SP_TRANSACTION_TEMPLATE", "FunctionId", _ReportConfiguration.FunctionId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateReportConfigParam(obj)", string.Empty); return(0); } }
public int DeleteReportConfigParam(ReportConfigParam _ReportConfiguration) { throw new NotImplementedException(); }