public object DeleteReligion(ReligionParam MP) { try { Tbl_Religion_Master objreligion = db.TblReligionMasters.Where(r => r.ReligionID == MP.ReligionID).FirstOrDefault(); if (objreligion.Status == 1) { objreligion.Status = 0; } else { objreligion.Status = 1; } db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Religion Updated Successfully!" }); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public bool Insert(ReligionParam religionParam) { religion.Name = religionParam.Name; religion.CreateDate = DateTimeOffset.Now.LocalDateTime; myContext.Religions.Add(religion); return(saveChange.save()); }
public bool Update(int?id, ReligionParam religionParam) { var get = Get(id); get.Name = religionParam.Name; get.UpdateDate = DateTimeOffset.Now.LocalDateTime; return(saveChange.save()); }
public bool Insert(ReligionParam religionParam) { if (religionParam != null) { status = _religionRepository.Insert(religionParam); } return(status); }
public bool Update(int?Id, ReligionParam religionParam) { if (Id != null && religionParam != null) { status = _religionRepository.Update(Id, religionParam); } return(status); }
public object SaveReligion(ReligionParam MP) { try { string msg = ""; if (MP.BtnStatus == "Save") { var usercode = db.TblReligionMasters.Where(r => r.ReligionName == MP.ReligionName.ToUpper()).FirstOrDefault(); if (usercode != null) { return(new Error() { IsError = true, Message = "Religion Name Already Exists!" }); } Tbl_Religion_Master objReligion = new Tbl_Religion_Master(); objReligion.ReligionName = MP.ReligionName.ToUpper(); objReligion.CreatedBy = MP.CreatedBy; objReligion.CreatedDate = DateTime.Now; objReligion.Status = 1; db.TblReligionMasters.Add(objReligion); db.SaveChanges(); msg = "Religion Saved Successfully!"; } else { Tbl_Religion_Master objReligion = db.TblReligionMasters.Where(r => r.ReligionID == MP.ReligionID).FirstOrDefault(); var Data = db.TblReligionMasters.Where(r => r.ReligionName == MP.ReligionName.ToUpper()).FirstOrDefault(); if (Data != null) { return(new Error() { IsError = true, Message = "Religion Name Already Exists!" }); } objReligion.ReligionName = MP.ReligionName.ToUpper(); objReligion.ModifiedDate = DateTime.Now; objReligion.ReligionID = MP.ReligionID; db.SaveChanges(); msg = "Religion Updated Successfully!"; } return(new Result() { IsSucess = true, ResultData = msg }); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
// POST: api/Religions public HttpResponseMessage InsertReligion(ReligionParam religionParam) { var message = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Wrong Parameter"); var result = _iReligionService.Insert(religionParam); if (result) { message = Request.CreateResponse(HttpStatusCode.OK, "Successfully Added"); } return(message); }
public bool Update(int?Id, ReligionParam religionParam) { var result = 0; var getDataReligion = Get(Id); getDataReligion.Name = religionParam.Name; getDataReligion.UpdateDate = DateTimeOffset.UtcNow.LocalDateTime; result = myContext.SaveChanges(); if (result > 0) { status = true; } return(status); }
public bool Insert(ReligionParam religionParam) { var result = 0; religion.Name = religionParam.Name; religion.CreateDate = DateTimeOffset.UtcNow.LocalDateTime; myContext.Religions.Add(religion); result = myContext.SaveChanges(); if (result > 0) { status = true; } return(status); }
public bool Insert(ReligionParam religionParam) { if (religionParam == null) { Console.WriteLine("Insert Name"); Console.Read(); } else { status = _religionRepository.Insert(religionParam); Console.WriteLine("Success"); } return(status); }
public object GetSingleReligion(ReligionParam objgr) { try { var SingleReligionlist = db.ViewReligionLists.Where(r => r.ReligionID == objgr.ReligionID).FirstOrDefault(); return(SingleReligionlist); } catch (Exception E) { return(new Error() { IsError = true, Message = E.Message }); } }
public object DeleteReligion([FromBody] ReligionParam MP) { try { CasteBL obj = new CasteBL(); var result = obj.DeleteReligion(MP); return(result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object SaveReligion([FromBody] ReligionParam PR) { try { CasteBL OBJSAVE = new CasteBL(); var result = OBJSAVE.SaveReligion(PR); return(result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object GetSingleReligionInfo([FromBody] ReligionParam OBJGR) { try { CasteBL obj = new CasteBL(); var SingleGR = obj.GetSingleReligion(OBJGR); return(SingleGR); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public bool Insert(ReligionParam religionParam) { if (religionParam == null) { throw new NullReferenceException(); } else if (religionParam.Name == " ") { status = false; } else { status = _religionRepository.Insert(religionParam); } return(status); }
public object GetReligionMaster([FromBody] ReligionParam objid) { try { var status = objid.Status; CasteBL obj = new CasteBL(); var ERPreligion = obj.GetReligionList(status); return(ERPreligion); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public bool Update(int?Id, ReligionParam religionParam) { if (Id == null) { Console.WriteLine("Insert Id"); Console.Read(); } else if (Id == ' ') { Console.WriteLine("Dont Insert Blank Caracter"); Console.Read(); } else { status = _religionRepository.Update(Id, religionParam); Console.WriteLine("update Success"); } return(status); }
// PUT: api/Religions/5 public HttpResponseMessage UpdateReligion(int id, ReligionParam religionParam) { var message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "Bad Request"); if (string.IsNullOrWhiteSpace(id.ToString())) { message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "Invalid Id"); } else { var get = _iReligionService.Update(id, religionParam); if (get) { message = Request.CreateResponse(HttpStatusCode.OK, get); return(message); } } return(message); }
public bool Update(int?id, ReligionParam religionParam) { if (id == null) { throw new NullReferenceException(); } var get = Get(id); if (religionParam == null) { throw new NullReferenceException(); } else if (religionParam.Name == " ") { status = false; } else { status = _religionRepository.Update(id, religionParam); } return(status); }
// PUT: api/Religions/5 public void Put(int id, ReligionParam religionParam) { _religionService.Update(id, religionParam); }
// POST: api/Religions public void Post(ReligionParam religionParam) { _religionService.Insert(religionParam); }
// POST: api/Relegions public void Post(ReligionParam religionParam) { _religionRepository.Insert(religionParam); }
// PUT: api/Relegions/5 public void Put(int Id, ReligionParam religionParam) { _religionRepository.Update(Id, religionParam); }