public ActionServiceResult DeleteListEntity(List <string> listId, [FromQuery] String organizationTypeId)
        {
            dynamic tmp = null;

            if (organizationTypeId == "" || organizationTypeId == null)
            {
                List <string> resultData    = new List <string>();
                JobpositionBL jobPositionBl = new JobpositionBL();

                for (int i = 0; i < listId.Count(); i++)
                {
                    jobPositionBl.OpenconnectionDd();
                    tmp = jobPositionBl.DeleteEntityById(listId[i]);
                    jobPositionBl.DisconnectDb();
                    if (tmp != null)
                    {
                        resultData.Add(tmp.JobPositionId.ToString());
                    }
                }

                if (resultData.Count == 0)
                {
                    return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, resultData));
                }
                else
                {
                    return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, resultData));
                }
            }
            else
            {
                List <string> resultData = new List <string>();
                OrganizationtypejobpositionBL organizationtypeJobPositionBl = new OrganizationtypejobpositionBL(organizationTypeId);

                for (int i = 0; i < listId.Count(); i++)
                {
                    organizationtypeJobPositionBl.OpenconnectionDd();
                    tmp = organizationtypeJobPositionBl.DeleteEntityById(listId[i]);
                    organizationtypeJobPositionBl.DisconnectDb();
                    if (tmp != null)
                    {
                        resultData.Add(tmp.JobPositionId.ToString());
                    }
                }

                if (resultData.Count == 0)
                {
                    return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, resultData));
                }
                else
                {
                    return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, resultData));
                }
            }
        }
Example #2
0
        public ActionServiceResult GetJobpositionName([FromQuery] String organizationTypeId)
        {
            dynamic tmp = null;

            if (organizationTypeId == "" || organizationTypeId == null)
            {
                tmp = null;
            }
            else
            {
                tmp = new OrganizationtypejobpositionBL(organizationTypeId).GetListInsertEntity();
            }
            if (tmp == null)
            {
                return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, tmp));
            }
            else
            {
                return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, tmp));
            }
        }
        public ActionServiceResult GetSearchPageData(int pageindex, int pagesize, [FromQuery] string searchKey, [FromQuery] String organizationTypeId)
        {
            dynamic tmp = null;

            if (organizationTypeId == "" || organizationTypeId == null)
            {
                tmp = new JobpositionBL().GetListEntitySearchPageData(pageindex, pagesize, searchKey);
            }
            else
            {
                tmp = new OrganizationtypejobpositionBL(organizationTypeId).GetListEntitySearchPageData(pageindex, pagesize, searchKey);
            }
            if (tmp == null)
            {
                return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, tmp));
            }
            else
            {
                return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, tmp));
            }
        }
        public ActionServiceResult CoutAllSearchData([FromQuery] String searchKey, [FromQuery] String organizationTypeId)
        {
            dynamic tmp = null;

            if (organizationTypeId == "" || organizationTypeId == null)
            {
                tmp = new JobpositionBL().CountAllSearchData(searchKey);
            }
            else
            {
                tmp = new OrganizationtypejobpositionBL(organizationTypeId).CountAllSearchData(searchKey);
            }
            if (tmp == null)
            {
                return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, tmp));
            }
            else
            {
                return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, tmp));
            }
        }
        public ActionServiceResult Delete(String id, [FromQuery] String organizationTypeId)
        {
            dynamic tmp = null;

            if (organizationTypeId == "" || organizationTypeId == null)
            {
                tmp = new JobpositionBL().DeleteEntityById(id);
            }
            else
            {
                tmp = new OrganizationtypejobpositionBL(organizationTypeId).DeleteEntityById(id);
            }

            if (tmp == null)
            {
                return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, tmp));
            }
            else
            {
                return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, tmp));
            }
        }
        public ActionServiceResult Put(Guid id, [FromBody] Jobposition entity, [FromQuery] String organizationTypeId)
        {
            dynamic tmp = null;

            if (organizationTypeId == "" || organizationTypeId == null)
            {
                entity.JobPositionId = id;
                tmp = new JobpositionBL().UpdateEntity(entity);
            }
            else
            {
                tmp = new OrganizationtypejobpositionBL(organizationTypeId).UpdateEntity(entity, id.ToString());;
            }
            if (tmp == null)
            {
                return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, tmp));
            }
            else
            {
                return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, tmp));
            }
        }
        public ActionServiceResult Post([FromBody] Jobposition entity, [FromQuery] String organizationTypeId)
        {
            dynamic tmp = null;

            if (organizationTypeId == "" || organizationTypeId == null)
            {
                tmp = new JobpositionBL().InsertEntity(entity);
            }
            else
            {
                tmp = new OrganizationtypejobpositionBL(organizationTypeId).InsertEntity(entity);
            }

            if (tmp == null)
            {
                return(new ActionServiceResult("", Message.ErrorMess, Common.Code.Exception, tmp));
            }
            else
            {
                return(new ActionServiceResult("", Message.SuccessMess, Common.Code.Success, tmp));
            }
        }