public ActionResult UpdateLang(PriceTypeLangModel model)
        {
            var msg       = ManagerResource.LB_OPERATION_SUCCESS;
            var isSuccess = false;

            if (!ModelState.IsValid)
            {
                string messages = string.Join("; ", ModelState.Values
                                              .SelectMany(x => x.Errors)
                                              .Select(x => x.ErrorMessage + x.Exception));
                this.AddNotification(messages, NotificationType.ERROR);

                return(Json(new { success = isSuccess, title = ManagerResource.LB_NOTIFICATION, message = messages }));
            }

            try
            {
                var code = 0;

                //Begin db transaction
                var data = new IdentityPriceTypeLang();
                data.PriceTypeId = model.PriceTypeId;
                data.Id          = model.Id;
                data.LangCode    = model.LangCode;
                data.Name        = model.Name;
                data.Description = model.Description;

                if (model.Id > 0)
                {
                    //Update
                    _mainStore.UpdateLang(data);
                }
                else
                {
                    //Add new
                    code = _mainStore.AddNewLang(data);

                    if (code == EnumCommonCode.Error)
                    {
                        return(Json(new { success = isSuccess, title = ManagerResource.LB_NOTIFICATION, message = ManagerResource.LB_DUPLICATE_DATA, clientcallback = " location.reload()" }));
                    }
                }

                isSuccess = true;
            }
            catch (Exception ex)
            {
                this.AddNotification(NotifSettings.Error_SystemBusy, NotificationType.ERROR);

                logger.Error("Failed for UpdateLang request: " + ex.ToString());

                return(Json(new { success = isSuccess, title = ManagerResource.LB_NOTIFICATION, message = NotifSettings.Error_SystemBusy }));
            }

            return(Json(new { success = isSuccess, title = ManagerResource.LB_NOTIFICATION, message = msg, clientcallback = " location.reload()" }));
        }
        public ActionResult UpdateLang()
        {
            PriceTypeLangModel model = new PriceTypeLangModel();
            var id             = Utils.ConvertToInt32(Request["Id"]);
            var roomcategoryId = Utils.ConvertToInt32(Request["PriceTypeId"]);

            if (roomcategoryId == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (id > 0)
            {
                model.IsUpdate = true;
            }

            try
            {
                model.Languages   = CommonHelpers.GetListLanguages();
                model.PriceTypeId = roomcategoryId;

                //Begin db transaction
                var info = _mainStore.GetLangDetail(id);

                if (info != null)
                {
                    model.PriceTypeId = roomcategoryId;
                    model.Id          = info.Id;
                    model.LangCode    = info.LangCode;
                    model.Name        = info.Name;
                    model.Description = info.Description;
                }
            }
            catch (Exception ex)
            {
                this.AddNotification(NotifSettings.Error_SystemBusy, NotificationType.ERROR);

                logger.Error("Failed for Show UpdateLang frm request: " + ex.ToString());
            }

            return(PartialView("../PriceType/_UpdateLang", model));
        }