public string InsertUpdateTaxType(TaxTypesViewModel _taxTypesObj) { try { object result = null; AppUA appUA = Session["AppUA"] as AppUA; _taxTypesObj.commonObj = new CommonViewModel(); _taxTypesObj.commonObj.CreatedBy = appUA.UserName; _taxTypesObj.commonObj.CreatedDate = common.GetCurrentDateTime(); _taxTypesObj.commonObj.UpdatedBy = appUA.UserName; _taxTypesObj.commonObj.UpdatedDate = common.GetCurrentDateTime(); if (!string.IsNullOrEmpty(_taxTypesObj.hdnCode)) { _taxTypesObj.Code = _taxTypesObj.hdnCode; } result = _taxTypeBusiness.InsertUpdateTaxType(Mapper.Map <TaxTypesViewModel, TaxTypes>(_taxTypesObj)); return(JsonConvert.SerializeObject(new { Result = "OK", Records = result })); } catch (Exception ex) { AppConstMessage cm = c.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message })); } }
public string GetTaxTypeDetailsByCode(string Code) { try { TaxTypesViewModel taxTypesObj = Mapper.Map <TaxTypes, TaxTypesViewModel>(_taxTypeBusiness.GetTaxTypeDetailsByCode(Code)); return(JsonConvert.SerializeObject(new { Result = "OK", Records = taxTypesObj })); } catch (Exception ex) { AppConstMessage cm = c.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message })); } }