コード例 #1
0
        public ActionResult SaveBulletin(string prm = "")
        {
            BulletinModel objBulletinModel = new BulletinModel();

            try
            {
                //if prm(Paramter) is empty means Add condition else edit condition
                if (!String.IsNullOrEmpty(prm))
                {
                    int BulletinId;
                    //decrypt parameter and set in BulletinId variable
                    int.TryParse(CommonUtils.Decrypt(prm), out BulletinId);
                    //Get Bulletin detail by  Bulletin Id
                    serviceResponse  = objUtilityWeb.GetAsync(WebApiURL.Bulletin + "/GetBulletinById?BulletinId=" + BulletinId.ToString());
                    objBulletinModel = serviceResponse.StatusCode == HttpStatusCode.OK ? serviceResponse.Content.ReadAsAsync <BulletinModel>().Result : null;
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex, "Bulletin", "SaveBulletin Get");
            }

            return(View("SaveBulletin", objBulletinModel));
        }
コード例 #2
0
        public ActionResult ActivateDeactivateBulletin(string prm = "")
        {
            BulletinModel objBulletinModel = new BulletinModel();

            try
            {
                //if prm(Paramter) is empty means Add condition else edit condition
                if (!String.IsNullOrEmpty(prm))
                {
                    int BulletinId;
                    int Status;
                    //decrypt parameter and set in BulletinId variable
                    int.TryParse(CommonUtils.Decrypt(prm.Split('~')[0]), out BulletinId);
                    int.TryParse(prm.Split('~')[1], out Status);
                    //Get Bulletin detail by  Bulletin Id


                    serviceResponse  = objUtilityWeb.GetAsync(WebApiURL.Bulletin + "/UpdateBulletinStatusByID?BulletinId=" + BulletinId.ToString() + "&status=" + Status);
                    objBulletinModel = serviceResponse.StatusCode == HttpStatusCode.OK ? serviceResponse.Content.ReadAsAsync <BulletinModel>().Result : null;

                    //serviceResponse = objUtilityWeb.GetAsync(WebApiURL.UserLogin + "/GetUserListById?UserId=" + UserId.ToString());
                    //objUserLogin = serviceResponse.StatusCode == HttpStatusCode.OK ? serviceResponse.Content.ReadAsAsync<UserLogin>().Result : null;
                    //if (objUserLogin != null)
                    //{

                    //    serviceResponse = objUtilityWeb.GetAsync(WebApiURL.UserLogin + "/UpdateUserStatusByID?UserId=" + BulletinId.ToString() + "&status=" + Status);
                    //    objUserLogin = serviceResponse.StatusCode == HttpStatusCode.OK ? serviceResponse.Content.ReadAsAsync<UserLogin>().Result : null;


                    //    //Admin_UpdateUserStatusByID

                    //}
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex, "Bulletin", "ViewBulletin");
            }

            return(RedirectToAction("ViewBulletin"));
        }