예제 #1
0
        public ActionResult Add(RefuseResonViewModel model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View("Add", model));
                }

                var refuse = new RefuseReason()
                {
                    Value = model.Value,
                };

                _UnitOfWork.RefuseReasonsRepository.Create(refuse);
                _UnitOfWork.Commit();
                var message = string.Format("تم اضافة سبب الرفض بنجاح .");
                return(RedirectToAction("Index", "RefuseResons").Success(message));
            }
            catch (Exception e)
            {
                var message = string.Format("حدث خطأ أثناء الحفظ");
                return(RedirectToAction("Add", "RefuseResons").Error(message));
            }
        }
 public static bool IsDefined(RefuseReason value)
 {
     if ((value != RefuseReason.DuplicateNodeId) && (value != RefuseReason.DuplicateNeighbor))
     {
         return(value == RefuseReason.NodeBusy);
     }
     return(true);
 }
 public static bool IsDefined(RefuseReason value)
 {
     if ((value != RefuseReason.DuplicateNodeId) && (value != RefuseReason.DuplicateNeighbor))
     {
         return (value == RefuseReason.NodeBusy);
     }
     return true;
 }
예제 #4
0
        private static string refuseReason(RefuseReason reason)
        {
            switch (reason)
            {
            case RefuseReason.AlreadyOnline:
                return("You are not allowed to connect, because you are already online.");

            case RefuseReason.Pending:
                return("You are not allowed to connect, because some of your ships are still lingering due to an unordered disconnect.");

            case RefuseReason.OptIn:
                return("You are not allowed to connect, because you didn't complete the optin cycle.");

            case RefuseReason.Banned:
                return("You are banned from using flattiverse. Please contact the administration via https://forums.flattiverse.com/.");

            case RefuseReason.ServerFull:
                return("This server is full with clients. Try again later.");

            default:
                return("Your connection has been refused due to an unknown refuse reason. Please update your connector.");
            }
        }
예제 #5
0
 public RefuseInfo(RefuseReason reason, Referral[] referrals)
 {
     this.body = new RefuseInfoDC(reason, referrals);
 }
예제 #6
0
 public RefuseInfoDC(RefuseReason reason, Referral[] referrals)
 {
     this.reason    = reason;
     this.referrals = referrals;
 }
예제 #7
0
 public static bool IsDefined(RefuseReason value)
 {
     return((value == RefuseReason.DuplicateNodeId) ||
            (value == RefuseReason.DuplicateNeighbor) ||
            (value == RefuseReason.NodeBusy));
 }
 public RefuseInfo(RefuseReason reason, Referral[] referrals)
 {
     this.body = new RefuseInfoDC(reason, referrals);
 }
 public RefuseInfoDC(RefuseReason reason, Referral[] referrals)
 {
     this.reason = reason;
     this.referrals = referrals;
 }
 public static bool IsDefined(RefuseReason value)
 {
     return ((value == RefuseReason.DuplicateNodeId) ||
             (value == RefuseReason.DuplicateNeighbor) ||
             (value == RefuseReason.NodeBusy));
 }
예제 #11
0
 internal ClientRefusedException(RefuseReason reason) : base(refuseReason(reason))
 {
 }