Example #1
0
 public string GetQRCode(string id)
 {
     try
     {
         RequestBaseModels paraBody = new RequestBaseModels();
         paraBody.ID = id;
         NSLog.Logger.Info("GetQRCode Request", paraBody);
         var result = (ResponseApiModels)ApiResponse.Post <ResponseApiModels>(Commons.GetRegisterAccount, null, paraBody);
         NSLog.Logger.Info("GetQRCode Result", result);
         if (result != null)
         {
             if (result.Success)
             {
                 return(result.Message);
             }
             else
             {
                 NSLog.Logger.Info("GetQRCode_Fail: ", result.Message);
                 return(string.Empty);
             }
         }
         else
         {
             NSLog.Logger.Info("GetQRCode_Fail: ", result);
             return(string.Empty);
         }
     }
     catch (Exception e)
     {
         NSLog.Logger.Error("GetQRCode_Fail: ", e);
         return(string.Empty);
     }
 }
Example #2
0
        public static void GetListGeneralSetting(string storeId)
        {
            List <GeneralSettingModels> listdata = new List <GeneralSettingModels>();

            try
            {
                RequestBaseModels paraBody = new RequestBaseModels();
                paraBody.AppKey    = Commons.AppKey;
                paraBody.AppSecret = Commons.AppSecret;

                paraBody.StoreId = storeId;
                paraBody.Mode    = 1;

                NSLog.Logger.Info("GetListGeneralSetting Request: ", paraBody);
                var result = (ResponseBaseModels)ApiResponse.Post <ResponseBaseModels>(Commons.Store_Setting, null, paraBody);
                NSLog.Logger.Info("GetListGeneralSetting Result: ", result);

                dynamic data       = result.Data;
                var     lstZ       = data["ListSettings"];
                var     lstContent = JsonConvert.SerializeObject(lstZ);
                listdata = JsonConvert.DeserializeObject <List <GeneralSettingModels> >(lstContent);
                //check config
                var pendingTime = listdata.Where(ww => ww.Code == (int)Commons.ESettings.PendingTime).FirstOrDefault();
                //Commons._pendingTime = pendingTime != null ? int.Parse(pendingTime.Value) : 5;
                HttpContext.Current.Response.Cookies["WebKDSPendingTime"].Value   = (pendingTime != null ? int.Parse(pendingTime.Value) : 5).ToString();
                HttpContext.Current.Response.Cookies["WebKDSPendingTime"].Expires = DateTime.MaxValue;

                var soundPrepareScreen = listdata.Where(ww => ww.Code == (int)Commons.ESettings.SoundPrepareScreen).FirstOrDefault();
                //Commons._soundPrepareScreenIndex = soundPrepareScreen != null ? int.Parse(soundPrepareScreen.Value) : 0;

                HttpContext.Current.Response.Cookies["WebKDSSoundPrepareScreenIndex"].Value   = (soundPrepareScreen != null ? int.Parse(soundPrepareScreen.Value) : 0).ToString();
                HttpContext.Current.Response.Cookies["WebKDSSoundPrepareScreenIndex"].Expires = DateTime.MaxValue;
                //NumOfCellOrderMana
                var numOfCellOrderMana = listdata.Where(ww => ww.Code == (int)Commons.ESettings.NumOfCellOrderMana).FirstOrDefault();
                HttpContext.Current.Response.Cookies["WebKDSNumOfCellOrderMana"].Value   = (numOfCellOrderMana != null ? int.Parse(numOfCellOrderMana.Value) : 0).ToString();
                HttpContext.Current.Response.Cookies["WebKDSNumOfCellOrderMana"].Expires = DateTime.MaxValue;


                NSLog.Logger.Info("GetListGeneralSetting: WebKDSPendingTime", (pendingTime != null ? int.Parse(pendingTime.Value) : 5).ToString());
                NSLog.Logger.Info("GetListGeneralSetting: WebKDSSoundPrepareScreenIndex", (soundPrepareScreen != null ? int.Parse(soundPrepareScreen.Value) : 0).ToString());
                NSLog.Logger.Info("GetListGeneralSetting: WebKDSNumOfCellOrderMana", (numOfCellOrderMana != null ? int.Parse(numOfCellOrderMana.Value) : 0).ToString());
            }
            catch (Exception e)
            {
                NSLog.Logger.Error("GetListGeneralSetting Error: ", e);
            }
        }
Example #3
0
        public List <ClientModuleModel> GetClientModule()
        {
            var result = new List <ClientModuleModel>();

            try
            {
                RequestBaseModels paraRequestBaseModels = new RequestBaseModels();

                var     apiResult = (NSApiResponse)ApiResponse.Post <NSApiResponse>(Commons.ClientModuleSetting, null, paraRequestBaseModels);
                dynamic data      = apiResult.Data;

                NSLog.Logger.Info("Response GetClientModule", data);
                var lstObject = JsonConvert.SerializeObject(data["ListModule"]);
                result = JsonConvert.DeserializeObject <List <ClientModuleModel> >(lstObject);
            }
            catch (Exception ex)
            {
                NSLog.Logger.Error("Error GetClientModule", ex);
            }
            return(result);
        }
Example #4
0
 public bool CreateQRCode(string AppRegisteredID, string DeviceName, string CreatedUser, ref string msg)
 {
     try
     {
         RequestBaseModels paraBody = new RequestBaseModels();
         paraBody.AppRegisteredID = AppRegisteredID;
         paraBody.DeviceName      = DeviceName;
         paraBody.CreatedUser     = CreatedUser;
         NSLog.Logger.Info("RegisterAccount Request", paraBody);
         var result = (ResponseApiModels)ApiResponse.Post <ResponseApiModels>(Commons.RegisterAccount, null, paraBody);
         NSLog.Logger.Info("RegisterAccount Result", result);
         if (result != null)
         {
             if (result.Success)
             {
                 return(true);
             }
             else
             {
                 msg = result.Message;
                 NSLog.Logger.Info("RegisterAccount_Fail: ", result.Message);
                 return(false);
             }
         }
         else
         {
             NSLog.Logger.Info("RegisterAccount_Fail: ", result);
             return(false);
         }
     }
     catch (Exception e)
     {
         NSLog.Logger.Error("RegisterAccount_Fail: ", e);
         return(false);
     }
 }