Пример #1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("CatalogEntryId", "ClassTypeId");

                LoadDataAndDataBind();

                InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression);
                DataBind();
            }

            if (String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0)
            {
                InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression);
                DataBind();
            }

            //Update column header
            HtmlTableRow headerTRow = MyListView.InnerListViewTableHeader;

            if (headerTRow != null)
            {
                List <Label> labels = ManagementHelper.CollectControls <Label>(headerTRow);
                foreach (Label label in labels)
                {
                    if (ddlFieldList.Items.Count > 0)
                    {
                        label.Text = ddlFieldList.SelectedItem == null ? ddlFieldList.Items[0].Text : ddlFieldList.SelectedItem.Text;
                    }
                }
            }
        }
Пример #2
0
        private void BindForm()
        {
            CultureInfo ci = null;

            foreach (string cultureName in _cultures)
            {
                try
                {
                    ci = new CultureInfo(cultureName);
                    ListItem item = new ListItem(ci.NativeName, ci.Name);
                    LanguagesList.Items.Add(item);
                }
                catch { }
            }

            ManagementHelper.SelectListItem(LanguagesList, ManagementContext.Current.ConsoleUICulture.Name);

            //foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
            //{
            //    ListItem item = new ListItem(ci.NativeName, ci.Name);
            //    LanguagesList.Items.Add(item);
            //}

            //DataTable languages = Language.GetAllLanguagesDT();
            //foreach (DataRow row in languages.Rows)
            //{
            //    ListItem item = new ListItem(row["FriendlyName"].ToString(), row["LangName"].ToString());
            //    LanguagesList.Items.Add(item);
            //}
        }
Пример #3
0
        /// <summary>
        /// Invokes the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="element">The element.</param>
        public void Invoke(object sender, object element)
        {
            if (element is CommandParameters)
            {
                CommandParameters cp = (CommandParameters)element;

                string      gridId = cp.CommandArguments["GridId"];
                EcfListView ecfLV  = ManagementHelper.GetControlFromCollection <EcfListView>(((Control)sender).Page.Controls, gridId);

                if (ecfLV != null)
                {
                    int    error        = 0;
                    string errorMessage = String.Empty;

                    try
                    {
                        ProcessUpdateCommand(ecfLV.Items);
                    }
                    catch (Exception ex)
                    {
                        error++;
                        errorMessage = ex.Message;
                    }

                    if (error > 0)
                    {
                        errorMessage = errorMessage.Replace("'", "\\'").Replace(Environment.NewLine, "\\n");
                        ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                           String.Format("alert('{0}{1}');", "Failed to update item(s). Error: ", errorMessage), true);
                    }
                }
            }
        }
Пример #4
0
    /// <summary>
    /// Binds the form.
    /// </summary>
    private void BindForm()
    {
        if (Config != null)
        {
            Description.Text = Config.Description;
        }

        OfferAmount.Text = "0";
        MinQuantity.Text = "0";

        Settings settings = GetSettings();

        if (settings != null)
        {
            PersistSkuEntrys     = settings.RuleSkuSet;
            MinQuantity.Text     = settings.MinQuantity.ToString();
            EntryList.DataSource = new SkuEntryHelper(settings.RuleSkuSet);
            EntryList.DataBind();
        }
        if (PromotionDto != null && PromotionDto.Promotion.Count != 0)
        {
            OfferAmount.Text = PromotionDto.Promotion[0].OfferAmount.ToString("N2");
            ManagementHelper.SelectListItem(OfferType, PromotionDto.Promotion[0].OfferType);
        }
    }
Пример #5
0
        /// <summary>
        /// Handles the Click event of the lbSaveFiles control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void lbSaveFiles_Click(object sender, EventArgs e)
        {
            FileStreamInfo[] fsi = FileUpCtrl.Files;
            if (fsi != null && fsi.Length > 0)
            {
                try
                {
                    StringBuilder filePath = new StringBuilder(Server.MapPath(ManagementHelper.GetImportExportFolderPath(_MetaDataImportFolder)));
                    filePath.Append(fsi[0].FileName);

                    if (File.Exists(filePath.ToString()))
                    {
                        File.Delete(filePath.ToString());
                    }

                    FileUpCtrl.SaveAs(fsi[0], filePath.ToString());
                    FileUpCtrl.ReleaseAll();

                    // update upload status
                    lblUploadResult.Text = String.Empty;                     //"File saved successfully.";
                    UploadResultPanel.Update();
                }
                catch (Exception ex)
                {
                    lblUploadResult.Text = ex.Message;
                    UploadResultPanel.Update();
                }
                finally
                {
                    FilesControl.DataBind();
                    FilesPanel.Update();
                }
            }
        }
Пример #6
0
 public BtsHostInstanceCollection(BizTalkCatalog catalog)
     : base(
         catalog
         , HostInstance.GetInstances(
             ManagementHelper.GetScope(typeof(HostInstance), catalog.Instance, catalog.Database), null, null))
 {
 }
        async void GetManagementInfosFromServer()
        {
            var result = await ManagementHelper.GetManagementInfos();

            var aux = JsonConvert.DeserializeObject <dynamic>(result);

            if (aux != null)
            {
                Model.ShelterName  = aux.shelterName;
                Model.ShelterMoney = aux.shelterMoney;
                Model.LastRevenue  = aux.lastRevenue;
                Model.LastExpense  = aux.lastExpense;
                Model.TotalFood    = aux.totalFood;

                var animalsJson = await PetsHelper.GetPetsList();

                var animals = JsonConvert.DeserializeObject <List <Pet> >(animalsJson);

                Model.TotalAnimals = animals.Count;
                Model.TotalDogs    = animals.Count(x => x.Type.ToLower().Equals("cachorro") || x.Type.ToLower().Equals("dog"));
                Model.TotalCats    = animals.Count(x => x.Type.ToLower().Equals("gato") || x.Type.ToLower().Equals("cat"));
            }
            else
            {
                await DisplayAlert("Oops. Algo deu errado...", aux.Message, "OK");

                await Navigation.PopAsync(true);
            }
        }
Пример #8
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        /// <param name="reset">if set to <c>true</c> [reset].</param>
        private void BindForm(bool reset)
        {
            CultureInfo ci = ManagementContext.Current.ConsoleUICulture;

            if (TaxCategoriesList.Items.Count == 1)
            {
                BindTaxCategories();
            }

            if (reset)
            {
                BindJurisdictionGroups();
            }

            TaxDto.TaxValueRow selectedRow = null;
            if (TaxValueId != 0)
            {
                selectedRow = _Tax.TaxValue.FindByTaxValueId(TaxValueId);
            }

            if (selectedRow != null)
            {
                if (reset)
                {
                    SetFormFieldsValues(selectedRow.AffectiveDate, selectedRow.Percentage.ToString("#0.000", ci), selectedRow.JurisdictionGroupId, selectedRow.TaxCategory);
                }
            }
            else if (reset)
            {
                SetFormFieldsValues(ManagementHelper.GetUserDateTimeNow(), ((double)0).ToString("#0.000", ci), -1, String.Empty);
            }
        }
Пример #9
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            if (PrincipalId != Guid.Empty)
            {
                //first check permissions
                //if permissions not present, deny
                SecurityManager.CheckRolePermission("profile:org:mng:edit");

                Organization org = ProfileContext.Current.GetOrganization(PrincipalId);

                if (org != null)
                {
                    Name.Text        = org.Name;
                    Description.Text = org.Description;

                    ProfileSearchParameters pars    = new ProfileSearchParameters();
                    ProfileSearchOptions    options = new ProfileSearchOptions();
                    pars.SqlMetaWhereClause = String.Format("OrganizationId = {0}", org.Id);
                    options.Namespace       = "Mediachase.Commerce.Profile";
                    options.Classes.Add("Account");

                    Account[] accounts = ProfileContext.Current.FindAccounts(pars, options);
                    OrgMemberList.DataSource = accounts;
                    OrgMemberList.DataBind();

                    ManagementHelper.SelectListItem(AccountState, org.State);
                }
            }
            else
            {
                //if permissions not present, deny
                SecurityManager.CheckRolePermission("profile:org:mng:create");
            }
        }
        /// <summary>
        /// Invokes the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="element">The element.</param>
        public void Invoke(object sender, object element)
        {
            if (element is CommandParameters)
            {
                CommandParameters cp = (CommandParameters)element;
                int    error         = 0;
                string errorMessage  = String.Empty;
                try
                {
                    Guid customerGuid = ManagementHelper.GetGuidFromQueryString("customerid");
                    int  orderid      = ManagementHelper.GetIntFromQueryString("id");
                    ProcessCreateCommand(orderid, customerGuid);
                }
                catch (Exception ex)
                {
                    error++;
                    errorMessage = ex.Message;
                }

                if (error > 0)
                {
                    errorMessage = errorMessage.Replace("'", "\\'").Replace(Environment.NewLine, "\\n");
                    ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("CSManagementClient.SetSaveStatus('{0}{1}');", "Failed to create Purchase Order. Error: ", errorMessage), true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("CSManagementClient.SetSaveStatus('Successfully created purchase order');"), true);
                }
            }
        }
Пример #11
0
 /// <summary>
 /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
 protected override void OnInit(EventArgs e)
 {
     btnExport.Click += new EventHandler(BtnExport_Click);
     ProgressControl1.ProgressCompleted += new Mediachase.Commerce.Manager.Apps.Core.Controls.ProgressCompletedHandler(ProgressControl1_ProgressCompleted);
     FilesControl.Folder = ManagementHelper.GetImportExportFolderPath(_CatalogExportFolder);
     base.OnInit(e);
 }
Пример #12
0
    /// <summary>
    /// Binds the form.
    /// </summary>
    private void BindForm()
    {
        if (Config != null)
        {
            Description.Text = Config.Description;
        }

        OfferAmount.Text     = "0";
        MaxQuantity.Text     = "0";
        ExcludeEntry.Checked = false;

        Settings settings = GetSettings();

        if (settings != null)
        {
            EntryYFilter.SelectedEntryCode = settings.EntryYFilter;
            ExcludeEntry.Checked           = settings.Exclude;
            PersistSkuEntrys     = settings.EntryXSkuSet;
            MaxQuantity.Text     = settings.MaxYQuantity.ToString();
            EntryList.DataSource = new SkuEntryHelper(settings.EntryXSkuSet);
            EntryList.DataBind();
        }
        if (PromotionDto != null && PromotionDto.Promotion.Count != 0)
        {
            OfferAmount.Text = PromotionDto.Promotion[0].OfferAmount.ToString("N2");
            ManagementHelper.SelectListItem(OfferType, PromotionDto.Promotion[0].OfferType);
        }
    }
Пример #13
0
        /// <summary>
        /// Handles the LoadComplete event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void Page_LoadComplete(object sender, EventArgs e)
        {
            if (String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0)
            {
                object objArgs = Request.Form["__EVENTARGUMENT"];
                if (objArgs != null)
                {
                    Dictionary <string, object> cmd = new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(objArgs.ToString()) as Dictionary <string, object>;
                    if (cmd != null && cmd.Count > 1)
                    {
                        object cmdName = cmd[_CommandName];
                        if (String.Compare((string)cmdName, _MoveDialogCommand, true) == 0)
                        {
                            // process move command
                            Dictionary <string, object> args = cmd[_CommandArguments] as Dictionary <string, object>;
                            if (args != null)
                            {
                                ProcessMoveCommand(args);
                                ManagementHelper.SetBindGridFlag(MyListView.CurrentListView.ID);
                            }
                        }
                    }
                }
            }

            if (IsPostBack &&
                (ManagementHelper.GetBindGridFlag(MyListView.CurrentListView.ID) || String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0))
            {
                LoadDataAndDataBind();
                DataBind();
                MyListView.MainUpdatePanel.Update();
            }
        }
Пример #14
0
        /// <summary>
        /// Binds the element.
        /// </summary>
        private void BindElement()
        {
            ddlElement.Items.Clear();
            MetaClassCollection coll = MetaClass.GetList(MDContext, Namespace, true);

            foreach (MetaClass mc in coll)
            {
                if (mc.Parent == null)
                {
                    if (String.Compare(mc.TableName, "customeraccount", true) != 0 &&
                        String.Compare(mc.TableName, "address", true) != 0)
                    {
                        ddlElement.Items.Add(new ListItem(mc.FriendlyName, mc.Id.ToString()));
                    }
                }
            }
            if (ddlElement.Items.Count > 0)
            {
                MetaClass mc = null;
                if (MetaClassId > 0 && !IsPostBack)
                {
                    mc = MetaClass.Load(MDContext, MetaClassId);
                }
                if (mc != null)
                {
                    ManagementHelper.SelectListItem(ddlElement, mc.Parent.Id.ToString());
                }
                else
                {
                    ManagementHelper.SelectListItem(ddlElement, ddlElement.Items[0].Value);
                }
            }

            BindType();
        }
Пример #15
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            btnOK.Click += new EventHandler(btnOK_Click);

            ManagementHelper.RegisterExtJsStyles(this.Page);
            base.OnInit(e);
        }
Пример #16
0
        protected void AddValue_Click(object sender, System.EventArgs e)
        {
            DataTable dt = DictionaryItemsTable;

            if (dt == null)
            {
                dt = new DataTable();
                dt.Columns.AddRange(new DataColumn[] { new DataColumn("Id", typeof(int)), new DataColumn("Value", typeof(string)) });
            }

            if (MetaMultiValueCtrl.Items.FindByText(MetaValueCtrl.Text) == null)
            {
                DataRow row = dt.NewRow();
                row["Id"]    = -1;
                row["Value"] = MetaValueCtrl.Text;
                dt.Rows.Add(row);

                DictionaryItemsTable = dt;
            }

            this.MetaMultiValueCtrl.DataSource = dt;
            this.MetaMultiValueCtrl.DataBind();

            MetaValueCtrl.Text = String.Empty;

            if (MetaObject != null)
            {
                MetaDictionaryItem[] items = MetaObject.GetDictionaryItems(MetaField);
                foreach (MetaDictionaryItem item in items)
                {
                    ManagementHelper.SelectListItem(MetaMultiValueCtrl, item.Id, false);
                }
            }
        }
        public void LoadObject(object dto)
        {
            var paymentMethod = dto as PaymentMethodDto;

            if (paymentMethod == null)
            {
                return;
            }

            var isProduction = bool.Parse(paymentMethod.GetParameter(KlarnaConstants.IsProduction, "false"));

            cbIsProduction.Checked = isProduction;
            txtMerchantId.Text     = paymentMethod.GetParameter(KlarnaConstants.MerchantId, "");
            txtSecret.Text         = paymentMethod.GetParameter(KlarnaConstants.Secret, "");

            ddlLocale.DataSource = Locale.Locales.OrderBy(c => c.Country)
                                   .Select(c => new ListItem(c.Country, c.LocaleCode)).ToList();
            ddlLocale.DataBind();

            //Sweden set as default Locale
            ManagementHelper.SelectListItem(
                ddlLocale,
                paymentMethod.GetParameter(KlarnaConstants.Locale, "sv-se"),
                StringComparer.OrdinalIgnoreCase);
        }
        public HttpResponseMessage SetDutyTime(dynamic obj)
        {
            HttpResponseMessage response = new HttpResponseMessage();

            var    employee  = JsonConvert.DeserializeObject(JsonObjectConverter.ObjectToJson(obj)) as JObject;
            string emp_id    = employee.GetValue("employee_id").ToString();
            string room_num  = employee.GetValue("clinic_num").ToString();
            string Monday    = employee.GetValue("Monday").ToString();
            string Tuesday   = employee.GetValue("Tuesday").ToString();
            string Wednesday = employee.GetValue("Wednesday").ToString();
            string Thursday  = employee.GetValue("Thursday").ToString();
            string Friday    = employee.GetValue("Friday").ToString();
            string Saturday  = employee.GetValue("Saturday").ToString();
            string Sunday    = employee.GetValue("Sunday").ToString();
            Duty   item      = new Duty(room_num, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday);

            // 插入数据
            try
            {
                ManagementHelper.SetDuty(item, emp_id);
            }
            catch (Exception e)
            {
                response.Content    = new StringContent(e.Message);
                response.StatusCode = HttpStatusCode.BadRequest;
            }
            // duty表生成id
            // 设置room_num
            // max_limit设置成随机数
            // 日期随便设置了 上下午。。。
            return(response);
        }
Пример #19
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            // Bind segments
            TargetSegments.DataSource = SegmentManager.GetSegmentDto();
            TargetSegments.DataBind();

            if (_campaign != null)
            {
                //first check permissions
                //if permissions not present, deny
                SecurityManager.CheckRolePermission("marketing:campaigns:mng:edit");

                CampaignDto.CampaignRow row = _campaign.Campaign[0];
                CampaignName.Text        = row.Name;
                this.AvailableFrom.Value = ManagementHelper.GetUserDateTime(row.StartDate);
                this.ExpiresOn.Value     = ManagementHelper.GetUserDateTime(row.EndDate);
                IsActive.IsSelected      = row.IsActive;
                IsArchived.IsSelected    = row.IsArchived;
                Comments.Text            = row.Comments;

                foreach (CampaignDto.CampaignSegmentRow segmentRow in row.GetCampaignSegmentRows())
                {
                    ManagementHelper.SelectListItem(TargetSegments, segmentRow.SegmentId.ToString(), false);
                }
            }
            else
            {
                //first check permissions
                //if permissions not present, deny
                SecurityManager.CheckRolePermission("marketing:campaigns:mng:create");

                this.AvailableFrom.Value = ManagementHelper.GetUserDateTimeNow();
                this.ExpiresOn.Value     = ManagementHelper.GetUserDateTimeNow().AddMonths(1);
            }
        }
Пример #20
0
    /// <summary>
    /// Binds the form.
    /// </summary>
    private void BindForm()
    {
        if (Config != null)
        {
            Description.Text = Config.Description;
        }

        OfferAmount.Text = "0";

        if (PromotionDto != null && PromotionDto.Promotion.Count != 0)
        {
            PromotionDto.PromotionRow row = PromotionDto.Promotion[0];
            object settingsObj            = DeseralizeSettings(typeof(Settings));
            if (settingsObj != null)
            {
                Settings settings = (Settings)settingsObj;
                EntryXFilter.SelectedEntryCode = settings.EntryXFilter;
                EntryYFilter.SelectedEntryCode = settings.EntryYFilter;
                SourceQuantity.Text            = settings.SourceQuantity.ToString();
                TargetQuantity.Text            = settings.TargetQuantity.ToString();
            }

            OfferAmount.Text = PromotionDto.Promotion[0].OfferAmount.ToString("N2");
            ManagementHelper.SelectListItem(OfferType, PromotionDto.Promotion[0].OfferType);
        }
    }
Пример #21
0
        /// <summary>
        /// Invokes the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="element">The element.</param>
        public void Invoke(object sender, object element)
        {
            if (element is CommandParameters)
            {
                CommandParameters  cp   = (CommandParameters)element;
                WorkflowDefinition work = null;
                int    error            = 0;
                string errorMessage     = String.Empty;
                try
                {
                    work = WorkflowConfiguration.Instance.GetWorkflow(cp.CommandName);
                    Guid customerGuid = ManagementHelper.GetGuidFromQueryString("customerid");
                    int  orderid      = ManagementHelper.GetIntFromQueryString("id");
                    ProcessWorkflowCommand(cp.CommandName, orderid, customerGuid, ManagementHelper.GetValueFromQueryString("class", ""));
                }
                catch (Exception ex)
                {
                    error++;
                    errorMessage = ex.Message;
                }

                if (error > 0)
                {
                    errorMessage = errorMessage.Replace("'", "\\'").Replace(Environment.NewLine, "\\n");
                    ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("CSManagementClient.SetSaveStatus('Failed to process workflow command \"{0}\". Error: {1}');", work.DisplayName, errorMessage), true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("CSManagementClient.SetSaveStatus('Successfully completed \"{0}\". Make sure to save the order before proceeding.');", work.DisplayName), true);
                }
            }
        }
Пример #22
0
        /// <summary>
        /// Invokes the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="element">The element.</param>
        public void Invoke(object sender, object element)
        {
            if (element is CommandParameters)
            {
                CommandParameters cp = (CommandParameters)element;
                int    error         = 0;
                int    numEmails     = 0;
                string errorMessage  = String.Empty;
                try
                {
                    Guid customerGuid = ManagementHelper.GetGuidFromQueryString("customerid");
                    int  orderid      = ManagementHelper.GetIntFromQueryString("id");
                    numEmails = ProcessNotificationCommand(orderid, customerGuid, ManagementHelper.GetValueFromQueryString("class", ""));
                }
                catch (Exception ex)
                {
                    LogManager.GetLogger(GetType()).Error("Order Notification Error.", ex);
                    error++;
                    errorMessage = ex.Message;
                }

                if (error > 0)
                {
                    errorMessage = errorMessage.Replace("'", "\\'").Replace(Environment.NewLine, "\\n");
                    ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("CSManagementClient.SetSaveStatus('{0}{1} Check log for more details.');", "Failed to send notification. Error: ", errorMessage), true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("CSManagementClient.SetSaveStatus('Successfully sent {0} notifications');", numEmails.ToString()), true);
                }
            }
        }
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            // bind available Shipping gateway classes
            BindClassNames();

            if (_ShippingMethodDto != null && _ShippingMethodDto.ShippingOption.Count > 0)
            {
                try
                {
                    ShippingMethodDto.ShippingOptionRow shippingRow = _ShippingMethodDto.ShippingOption[0];

                    this.lblShippingMethodId.Text = shippingRow.ShippingOptionId.ToString();
                    this.tbName.Text        = shippingRow.Name;
                    this.tbDescription.Text = shippingRow.Description;
                    this.tbSystemName.Text  = shippingRow.SystemKeyword;

                    ManagementHelper.SelectListItem(ddlClassName, shippingRow.ClassName);

                    // do not allow to change system name
                    this.tbSystemName.Enabled = false;
                }
                catch (Exception ex)
                {
                    DisplayErrorMessage("Error during binding form: " + ex.Message);
                }
            }
            else
            {
                // set default form values
                this.tbSystemName.Enabled = true;
            }
        }
Пример #24
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            CultureInfo ci = GetCurrentCulture();

            if (TaxId > 0)
            {
                if (_TaxDto.Tax.Count > 0)
                {
                    this.tbName.Text      = _TaxDto.Tax[0].Name;
                    this.tbSortOrder.Text = _TaxDto.Tax[0].SortOrder.ToString();

                    ManagementHelper.SelectListItem2(TaxTypeList, _TaxDto.Tax[0].TaxType.ToString());
                }
                else
                {
                    DisplayErrorMessage(String.Format("Tax with id={0} not found.", TaxId));
                    return;
                }
            }
            else
            {
                this.tbSortOrder.Text = "0";
            }

            BindTaxLanguagesList();
        }
Пример #25
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            if (CurrencyId > 0)
            {
                bool found = false;
                if (_Currency.Currency.Count > 0)
                {
                    CurrencyDto.CurrencyRow row = _Currency.Currency.FindByCurrencyId(CurrencyId);
                    if (row != null)
                    {
                        this.tbCurrencyName.Text = row.Name;
                        this.CodeText.Text       = row.CurrencyCode;
                        if (!row.IsModifiedDateNull())
                        {
                            this.ModifiedDateLabel.Text = ManagementHelper.GetUserDateTime(row.ModifiedDate).ToString();
                        }

                        found = true;
                    }
                }
                if (!found)
                {
                    DisplayErrorMessage(String.Format("Currency with id={0} not found.", CurrencyId));
                    return;
                }
            }
        }
Пример #26
0
        /// <summary>
        /// Binds the form.
        /// </summary>
        private void BindForm()
        {
            // Bind Meta classes
            MetaClass catalogEntry = MetaClass.Load(CatalogContext.MetaDataContext, "CatalogEntry");

            MetaClassList.Items.Clear();
            if (catalogEntry != null)
            {
                MetaClassCollection metaClasses = catalogEntry.ChildClasses;
                foreach (MetaClass metaClass in metaClasses)
                {
                    MetaClassList.Items.Add(new ListItem(metaClass.FriendlyName, metaClass.Id.ToString()));
                }

                MetaClassList.DataBind();
            }

            // Bind Templates
            TemplateDto templates = DictionaryManager.GetTemplateDto();

            if (templates.main_Templates.Count > 0)
            {
                DataView view = templates.main_Templates.DefaultView;
                view.RowFilter             = "TemplateType = 'entry'";
                DisplayTemplate.DataSource = view;
                DisplayTemplate.DataBind();
            }

            if (CatalogEntryId > 0)
            {
                if (_CatalogEntryDto.CatalogEntry.Count > 0)
                {
                    Name.Text           = _CatalogEntryDto.CatalogEntry[0].Name;
                    AvailableFrom.Value = ManagementHelper.GetUserDateTime(_CatalogEntryDto.CatalogEntry[0].StartDate);
                    ExpiresOn.Value     = ManagementHelper.GetUserDateTime(_CatalogEntryDto.CatalogEntry[0].EndDate);
                    CodeText.Text       = _CatalogEntryDto.CatalogEntry[0].Code;
                    IsActive.IsSelected = _CatalogEntryDto.CatalogEntry[0].IsActive;

                    ManagementHelper.SelectListItem(DisplayTemplate, _CatalogEntryDto.CatalogEntry[0].TemplateName);
                    ManagementHelper.SelectListItem(MetaClassList, _CatalogEntryDto.CatalogEntry[0].MetaClassId);

                    // Bind Sort order
                    foreach (CatalogRelationDto.NodeEntryRelationRow row in _CatalogRelationDto.NodeEntryRelation)
                    {
                        if (row.CatalogEntryId == _CatalogEntryDto.CatalogEntry[0].CatalogEntryId &&
                            row.CatalogId == this.ParentCatalogId &&
                            row.CatalogNodeId == this.ParentCatalogNodeId)
                        {
                            SortOrder.Text = row.SortOrder.ToString();
                        }
                    }
                }
            }
            else
            {
                this.AvailableFrom.Value = ManagementHelper.GetUserDateTime(DateTime.UtcNow);
                this.ExpiresOn.Value     = ManagementHelper.GetUserDateTime(DateTime.UtcNow).AddYears(1);
            }
        }
Пример #27
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        public void BindData()
        {
            BindCancelStatusesDropDown();
            BindDefaultTransactionTypesDropDown();

            // fill in the form fields
            if (_paymentMethodDto != null && _paymentMethodDto.PaymentMethodParameter != null)
            {
                PaymentMethodDto.PaymentMethodParameterRow param = null;

                // TestMode parameter
                param = GetParameterByName(AuthorizeTokenExGateway.TestParameterName);
                if (param != null)
                {
                    bool testFlag;
                    bool.TryParse(param.Value, out testFlag);
                    TestFlagYes.Checked = testFlag;
                    TestFlagNo.Checked  = !testFlag;
                }

                param = GetParameterByName(AuthorizeTokenExGateway.UserParameterName);
                if (param != null)
                {
                    User.Text = param.Value;
                }

                param = GetParameterByName(AuthorizeTokenExGateway.TransactionKeyParameterName);
                if (param != null)
                {
                    Password.Text = param.Value;
                }

                param = GetParameterByName(AuthorizeTokenExGateway.PaymentOptionParameterName);
                if (param != null)
                {
                    ListItem li = RadioButtonListOptions.Items.FindByValue(param.Value);
                    if (li != null)
                    {
                        li.Selected = true;
                    }
                }

                param = GetParameterByName(AuthorizeTokenExGateway.RecurringMethodParameterName);
                if (param != null)
                {
                    ManagementHelper.SelectListItem(ddlRecurringMethod, param.Value, StringComparer.Ordinal);
                }

                param = GetParameterByName(AuthorizeTokenExGateway.CancelStatusParameterName);
                if (param != null)
                {
                    ManagementHelper.SelectListItem(ddlCancelStatus, param.Value, StringComparer.Ordinal);
                }
            }
            else
            {
                this.Visible = false;
            }
        }
Пример #28
0
 /// <summary>
 /// Handles the LoadComplete event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void Page_LoadComplete(object sender, EventArgs e)
 {
     if (IsPostBack && ManagementHelper.GetBindGridFlag(MyListView.CurrentListView.ID))
     {
         LoadDataAndDataBind();
         MyListView.MainUpdatePanel.Update();
     }
 }
Пример #29
0
 /// <summary>
 /// Handles the LoadComplete event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void Page_LoadComplete(object sender, EventArgs e)
 {
     if (ManagementHelper.GetBindGridFlag(MyListView.CurrentListView.ID) || String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0)
     {
         LoadDataAndDataBind(ProfileContext.Current.Profile.PageSettings.GetSettingString(SortExpressionSettingKey));                 //MyListView.CurrentListView.SortExpression);
         MyListView.MainUpdatePanel.Update();
     }
 }
Пример #30
0
 private void SelectItemInDropDown(DropDownList list, CommonSettingsManager.SettingsNames value)
 {
     SettingsDto.CommonSettingsRow[] rows = (SettingsDto.CommonSettingsRow[])_SettingsDto.CommonSettings.Select(String.Format("Name='{0}'", value));
     if (rows != null && rows.Length > 0)
     {
         ManagementHelper.SelectListItemIgnoreCase(list, rows[0].Value);
     }
 }