public virtual ActionResult GetSigner(RequestType requestType)
        {
            try
            {
                var data = _baseInfoComissionCouncilService.WhereSigner(s => s.RequestType == requestType).ToList();

                var ja = new JArray();

                foreach (var itemObject in data.Select(item => new JObject
                {
                    { "Id", item.Id },
                    { "Name", item.Post.Name },
                    { "PostId", item.PostId },
                    { "RowNumber", item.RowNumber },
                    { "RequestType", item.RequestType.ToString() },
                    { "RequestTypeId", (int)item.RequestType }
                }))
                {
                    ja.Add(itemObject);
                }
                var jo = new JObject {
                    { "total", data.ToList().Count }, { "rows", ja }
                };
                return(Content(JsonConvert.SerializeObject(jo)));
            }
            catch (Exception ex)
            {
                return(Json(new { isError = true, Msg = "خطا در لود اطلاعات پست" }));
            }
        }
示例#2
0
        public virtual ActionResult SendCommissionToCartable(long requestId, int rowNumber, string description, long fieldofStudyId)
        {
            //var userAuthenticationType = (AuthenticationType)Enum.Parse(typeof(AuthenticationType), User.AuthenType(), true);
            //var levelId = Convert.ToInt64(User.LevelId());
            var signer        = _baseInfoComissionCouncilService.WhereSigner(s => s.RowNumber == rowNumber && s.RequestType == RequestType.Comision).FirstOrDefault();
            var postId        = signer?.PostId ?? 0;
            var userInSigners = _cartableService.GetPersonInSigners(postId, fieldofStudyId);

            if (userInSigners.Item3 == null)
            {
                return(Json(new { isError = true, Message = userInSigners.Item2 }));
            }
            var userIdFrom = Convert.ToInt64(User.Identity.GetUserId());
            var result     = _cartableService.Confirmation(userInSigners.Item3.Id, userIdFrom, requestId, postId, rowNumber, description);

            return(Json(new { isError = !result.Item1, Message = result.Item2 }));
        }