// PUT api/employeeculturaldetail/5 public bool Put(int id, [FromBody] EmployeeCulturalActivityEntities item) { if (id > 0) { return(_CulturalActivityDetails.UpdateEmployeeCulturalActivityDetails(id, item)); } return(false); }
public async Task <ActionResult> InsertCulturalActivityDetails(EmployeeCulturalActivityEntities Cultural) { HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url + "employeeculturaldetail", Cultural); if (responseMessage.IsSuccessStatusCode) { return(Json(new { success = true, responseText = "data saved successfuly !" }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = false, responseText = "data saved unsuccessfuly !" }, JsonRequestBehavior.AllowGet)); }
public bool UpdateEmployeeCulturalActivityDetails(int CulturalActivityId, EmployeeCulturalActivityEntities CulturalActivityEntities) { var success = false; if (CulturalActivityEntities != null) { //using (var scope = new TransactionScope()) //{ var CulturalActivityDETAILS = _UOW.CULTURAL_ACTIVITYDTLSRepository.GetByID(CulturalActivityId); if (CulturalActivityDETAILS != null) { if (CulturalActivityEntities.EMPLOYEEID != null) { CulturalActivityDETAILS.EMPLOYEEID = CulturalActivityEntities.EMPLOYEEID; } if (CulturalActivityEntities.CULTURALACTIVITY != null && CulturalActivityEntities.CULTURALACTIVITY != "") { CulturalActivityDETAILS.CULTURALACTIVITY = CulturalActivityEntities.CULTURALACTIVITY; } if (CulturalActivityEntities.OCCASION != null && CulturalActivityEntities.OCCASION != "") { CulturalActivityDETAILS.OCCASION = CulturalActivityEntities.OCCASION; } if (CulturalActivityEntities.COMMENTS != null && CulturalActivityEntities.COMMENTS != "") { CulturalActivityDETAILS.COMMENTS = CulturalActivityEntities.COMMENTS; } if (CulturalActivityEntities.PARTICIPATIONDATE != null && CulturalActivityEntities.PARTICIPATIONDATE != "") { var ACHIEVEMENTDATE1 = DateTime.ParseExact(CulturalActivityEntities.PARTICIPATIONDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture); CulturalActivityDETAILS.PARTICIPATIONDATE = ACHIEVEMENTDATE1; } _UOW.CULTURAL_ACTIVITYDTLSRepository.Update(CulturalActivityDETAILS); _UOW.Save(); //scope.Complete(); success = true; //} } } return(success); }
public int CreateEmployeeCulturalActivityDetails(EmployeeCulturalActivityEntities CulturalActivityEntities) { if (CulturalActivityEntities != null) { var ACHIEVEMENTDATE1 = (DateTime?)null; //DateTime joiningdate = Convert.ToDateTime(BasicinfoEntities.JOININGDATE); if (CulturalActivityEntities.PARTICIPATIONDATE != null) { ACHIEVEMENTDATE1 = DateTime.ParseExact(CulturalActivityEntities.PARTICIPATIONDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture); } var CulturalActivityDETAILS = new TBL_EMP_CULTURAL_ACTIVITYDTLS { PARTICIPATIONDATE = ACHIEVEMENTDATE1, EMPLOYEEID = CulturalActivityEntities.EMPLOYEEID, CULTURALACTIVITY = CulturalActivityEntities.CULTURALACTIVITY, OCCASION = CulturalActivityEntities.OCCASION, COMMENTS = CulturalActivityEntities.COMMENTS }; _UOW.CULTURAL_ACTIVITYDTLSRepository.Insert(CulturalActivityDETAILS); _UOW.Save(); } return(Convert.ToInt32(CulturalActivityEntities.ID)); }
// POST api/employeeculturaldetail public int Post([FromBody] EmployeeCulturalActivityEntities item) { return(_CulturalActivityDetails.CreateEmployeeCulturalActivityDetails(item)); }