Пример #1
0
 /// <summary>
 /// gridDoubleClickCommand
 /// </summary>
 /// <param name="selectedItem"></param>
 private void gridItemSelectCommand(CurrentViewParam viewCmdParam)
 {
     if (viewCmdParam != null)
     {
         UserAccessObject userAccess = viewCmdParam.CommandParamValue as UserAccessObject;
         if (userAccess != null)
         {
             SelectedUserAccess = userAccess;
         }
         else
         {
             //ModernDialog.ShowMessage("请选择所需要的行!", "message", System.Windows.MessageBoxButton.OK, viewCmdParam.CurrentView);
             return;
         }
         //
         if (viewCmdParam.CurrentView != null)
         {
             viewCmdParam.CurrentView.DialogResult = true;
         }
     }
 }
Пример #2
0
        /// <summary>
        /// GetAccessShop
        /// </summary>
        /// <param name="loginIPAddress"></param>
        /// <param name="loginShopNature"></param>
        /// <param name="languageCode"></param>
        /// <returns></returns>
        public static List <UserAccessObject> GetAccessShop(string loginIPAddress, string loginShopNature, string languageCode)
        {
            List <UserAccessObject> result  = null;
            string           responseResult = "";
            UserAccessObject userAccessObj  = null;
            HttpResponseResultObject <object> responseObj = null;

            try
            {
                result = new List <UserAccessObject>();

                IRMSApiReqParam apiParam = CreateIRMSApiReqParam.CreateGetAccessShopParam(loginIPAddress, loginShopNature, languageCode);
                if (apiParam != null)
                {
                    responseResult = HttpService.Post(apiParam.JsonData, apiParam.Path, 6000);
                    responseObj    = JsonConvert.DeserializeObject <HttpResponseResultObject <object> >(responseResult);
                    if (responseObj != null && responseObj.Code == SuccessCode)
                    {
                        Newtonsoft.Json.Linq.JArray arrData = responseObj.Data  as Newtonsoft.Json.Linq.JArray;
                        if (arrData != null && arrData.Count > 0)
                        {
                            foreach (Newtonsoft.Json.Linq.JObject jobj in arrData)
                            {
                                userAccessObj = jobj.ToObject <UserAccessObject>();
                                if (userAccessObj != null)
                                {
                                    result.Add(userAccessObj);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                result = null;
                CoreLibrary.NlogHelper.LogToFile(ex.ToString());
            }
            return(result);
        }