public object DeleteDesignation(DesignationParam MP) { try { Tbl_Designation_Master objdesignation = db.Tbl_Designation_Master.Where(r => r.DesignationID == MP.DesignationID).FirstOrDefault(); if (objdesignation.Status == 1) { objdesignation.Status = 0; } else { objdesignation.Status = 1; } db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Designation Updated Successfully!" }); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public object SaveDesignation(DesignationParam MP) { try { string msg = ""; if (MP.BtnStatus == "Save") { var usercode = db.Tbl_Designation_Master.Where(r => r.Designation == MP.Designation.ToUpper()).FirstOrDefault(); if (usercode != null) { return(new Error() { IsError = true, Message = "Designation Name Already Exists!" }); } Tbl_Designation_Master objDesignation = new Tbl_Designation_Master(); objDesignation.Designation = MP.Designation.ToUpper(); objDesignation.CreatedBy = MP.CreatedBy; objDesignation.CreatedDate = DateTime.Now; objDesignation.Status = 1; db.Tbl_Designation_Master.Add(objDesignation); db.SaveChanges(); msg = "Designation Saved Successfully!"; } else { Tbl_Designation_Master objDesignation = db.Tbl_Designation_Master.Where(r => r.DesignationID == MP.DesignationID).FirstOrDefault(); var Data = db.Tbl_Designation_Master.Where(r => r.Designation == MP.Designation.ToUpper()).FirstOrDefault(); if (Data != null) { return(new Error() { IsError = true, Message = "Designation Name Already Exists!" }); } objDesignation.Designation = MP.Designation.ToUpper(); objDesignation.ModifiedDate = DateTime.Now; objDesignation.DesignationID = MP.DesignationID; db.SaveChanges(); msg = "Designation Updated Successfully!"; } return(new Result() { IsSucess = true, ResultData = msg }); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public object GetSingleDesignation(DesignationParam objgr) { try { var SingleDesignationlist = db.ViewDesignationLists.Where(r => r.DesignationID == objgr.DesignationID).FirstOrDefault(); return(SingleDesignationlist); } catch (Exception E) { return(new Error() { IsError = true, Message = E.Message }); } }
public object GetSingleDesignationInfo([FromBody] DesignationParam OBJGR) { try { DepartmentBL obj = new DepartmentBL(); var SingleGR = obj.GetSingleDesignation(OBJGR); return(SingleGR); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public object DeleteDesignation([FromBody] DesignationParam MP) { try { DepartmentBL obj = new DepartmentBL(); var result = obj.DeleteDesignation(MP); return(result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object SaveDesignation([FromBody] DesignationParam PR) { try { DepartmentBL OBJSAVE = new DepartmentBL(); var result = OBJSAVE.SaveDesignation(PR); return(result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object GetDesignationMaster([FromBody] DesignationParam objid) { try { var status = objid.Status; DepartmentBL obj = new DepartmentBL(); var ERPDesignation = obj.GetDesignationList(status); return(ERPDesignation); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }