Ejemplo n.º 1
0
        private ResultDto InsertUpdate(LeadershipDto leadership)
        {
            ResultDto resultDto  = new ResultDto();
            string    objectName = "Leadership";

            try
            {
                ObjectParameter prmLeaderID = new ObjectParameter("LeadershipID", leadership.LeadershipID);

                int count = _dbContext.uspLeadershipInsertUpdate(prmLeaderID, leadership.LeadershipLevel, leadership.GroupID, leadership.LeadershipTitle, leadership.FromDate, leadership.ToDate, leadership.MemberID, leadership.StatusID, leadership.UserID);

                resultDto.ObjectId = (int)prmLeaderID.Value;

                if (resultDto.ObjectId > 0)
                {
                    resultDto.Message = string.Format("{0} details saved successfully ", objectName);
                }
                else
                {
                    resultDto.Message = string.Format("Error occured while saving {0} details", objectName);
                }
            }
            catch (Exception)
            {
                resultDto.Message  = string.Format("Service layer error occured while saving the {0} details", objectName);
                resultDto.ObjectId = -98;
            }
            return(resultDto);
        }
Ejemplo n.º 2
0
        public LeadershipDto GetByID(int LeadershipID)
        {
            List <uspLeadershipGetById_Result> lstuspLeadershipGetById_Result = _dbContext.uspLeadershipGetById(LeadershipID).ToList();
            LeadershipDto leadershipDto = Mapper.Map <uspLeadershipGetById_Result, LeadershipDto>(lstuspLeadershipGetById_Result.FirstOrDefault());

            return(leadershipDto);
        }
Ejemplo n.º 3
0
        public ActionResult CreateLeadership(string id)
        {
            int LeadershipId = string.IsNullOrEmpty(id.DecryptString()) ? default(int) : Convert.ToInt32(id.DecryptString());

            LeadershipModel lmodel = new LeadershipModel();
            LeadershipDto   dto    = new LeadershipDto();

            if (LeadershipId > 0)
            {
                dto = _leadershipService.GetByID(LeadershipId);
            }
            lmodel = Mapper.Map <LeadershipDto, LeadershipModel>(dto);

            //lmodel.ClusterID = clusterId;

            LoadDropDowns(lmodel.BranchID, lmodel.ClusterID, lmodel.GroupID);

            return(View(lmodel));
        }
Ejemplo n.º 4
0
 public ResultDto Update(LeadershipDto leadership)
 {
     return(InsertUpdate(leadership));
 }