Exemple #1
0
    protected void btnCreateLabel_Click(object sender, EventArgs e)
    {
        try
        {
            if (Session["sl_tWeight"] != null)
            {
                _totalWeight = (decimal)Session["sl_tWeight"];
            }
            _uspsSetting = (UspsSetting)Session["sl_setting"];
            if (_uspsSetting == null)
            {
                _uspsSetting = ProviderSetting(int.Parse(Session["sl_pid"].ToString()), storeId, portalId);
            }

            if (_uspsSetting.UspsMaxWeight >= _totalWeight && _uspsSetting.UspsMinWeight <= _totalWeight)
            {
                if (Page.IsValid)
                {
                    CreateLabel();
                }
            }
            else
            {
                throw new Exception("Weight limit is not matched as provider mentioned");
            }
        }
        catch (Exception ex)
        {
            ShowError(ex);
            ProcessException(ex);
        }
    }
Exemple #2
0
    private UspsSetting ProviderSetting(int providerId, int storeId, int portalId)
    {
        UspsController uspsController = new UspsController();
        AspxCommonInfo commonObj      = new AspxCommonInfo();

        commonObj.StoreID  = storeId;
        commonObj.PortalID = portalId;
        _uspsSetting       = uspsController.GetSetting(providerId, commonObj);

        Session["sl_setting"] = _uspsSetting;
        return(_uspsSetting);
    }
Exemple #3
0
 public static UspsSetting GetSetting(int providerId, AspxCommonInfo commonInfo)
 {
     try
     {
         List <KeyValuePair <string, object> > paraMeter = new List <KeyValuePair <string, object> >();
         paraMeter.Add(new KeyValuePair <string, object>("StoreID", commonInfo.StoreID));
         paraMeter.Add(new KeyValuePair <string, object>("PortalID", commonInfo.PortalID));
         paraMeter.Add(new KeyValuePair <string, object>("ShippingProviderID", providerId));
         var         sqLh    = new OracleHandler();
         UspsSetting setting = sqLh.ExecuteAsObject <UspsSetting>("usp_Aspx_GetUSPSShippingProviderSetting", paraMeter);
         return(setting);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
    protected void btnCreateLabel_Click(object sender, EventArgs e)
    {
        try
        {
            if (Session["sl_tWeight"] != null)
                _totalWeight = (decimal) Session["sl_tWeight"];
                       _uspsSetting = (UspsSetting)Session["sl_setting"];
            if (_uspsSetting == null)
                _uspsSetting = ProviderSetting(int.Parse(Session["sl_pid"].ToString()), storeId, portalId);

            if (_uspsSetting.UspsMaxWeight >= _totalWeight && _uspsSetting.UspsMinWeight <= _totalWeight)
            {
                if (Page.IsValid)
                    CreateLabel();
            }
            else
            {
                throw new Exception("Weight limit is not matched as provider mentioned");
            }

        }
        catch (Exception ex)
        {
            ShowError(ex);
            ProcessException(ex);
        }

    }
    private UspsSetting ProviderSetting(int providerId, int storeId, int portalId)
    {
        UspsController uspsController = new UspsController();
        AspxCommonInfo commonObj = new AspxCommonInfo();
        commonObj.StoreID = storeId;
        commonObj.PortalID = portalId;
        _uspsSetting = uspsController.GetSetting(providerId, commonObj);

        Session["sl_setting"] = _uspsSetting;
        return _uspsSetting;
    }