Esempio n. 1
0
        public ActionResult SetModules(int firstID, string secondID)
        {
            string[] tempIds   = secondID.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            int[]    moduleIDs = Array.ConvertAll(tempIds, s => Convert.ToInt32(s));

            ReturnDescription description = UserInfoServices
                                            .SetUserModule(firstID, moduleIDs);

            if (description.Flag)
            {
                return(Ok(new Result
                {
                    State = 1,
                    Message = description.Message
                }));
            }
            else
            {
                return(BadRequest(new Result
                {
                    State = 0,
                    Message = description.Message
                }));
            }
        }