Ejemplo n.º 1
0
        protected void RadListViewBaseItems_ItemCommand(object sender, RadListViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName.ToUpper() == "UPDATE")
                {
                    TextBox      Title            = e.ListViewItem.FindControl("txtBoxItemTitle") as TextBox;
                    DropDownList CategoryName     = e.ListViewItem.FindControl("ddlCategory") as DropDownList;
                    TextBox      BaseitemCode     = e.ListViewItem.FindControl("txtBaseItemCode") as TextBox;
                    TextBox      TitleDescription = e.ListViewItem.FindControl("txtBoxTitleDesc") as TextBox;
                    TextBox      Description      = e.ListViewItem.FindControl("txtBoxDesc") as TextBox;
                    TextBox      SubDescription   = e.ListViewItem.FindControl("txtBoxSubDesc") as TextBox;
                    TextBox      ItemAttributes   = e.ListViewItem.FindControl("txtBoxAttributes") as TextBox;

                    BaseItem baseItem = new BaseItem()
                    {
                        BaseItemId               = Convert.ToInt64(e.CommandArgument),
                        BaseItemCode             = BaseitemCode.Text,
                        CategoryId               = Convert.ToInt64(CategoryName.SelectedItem.Value),
                        CategoryName             = CategoryName.SelectedItem.Text,
                        BaseItemTitle            = Title.Text,
                        BaseItemTitleDescription = TitleDescription.Text,
                        BaseItemDescription      = Description.Text,
                        BaseItemSubDescription   = SubDescription.Text,
                        BaseItemAttributes       = ItemAttributes.Text
                    };

                    bool IsSaved = _baseItemManagement.UpdateBaseItem(baseItem);
                    RadListViewBaseItems.DataSource = GetBaseItemsDataSource();
                    RadListViewBaseItems.DataBind();
                }
                else if (e.CommandName.ToUpper().Equals("DELETE"))
                {
                    string baseItemId = Convert.ToString(e.CommandArgument);
                    Session["DELBASEITEM"] = baseItemId;
                    radWindowManager.RadConfirm("Are you sure you want to delete this base item, please confirm?", "confirmCallBackUserFn", 300, 150, null, "Delete Confirmation", baseItemId);
                }
                else if (e.CommandName.ToUpper().Equals("REFRESH"))
                {
                    RadListViewBaseItems.DataSource = null;
                    RadListViewBaseItems.DataSource = GetBaseItemsDataSource();
                    RadListViewBaseItems.DataBind();
                }
                else if (e.CommandName.ToUpper().Equals("INSERT"))
                {
                    string classId    = ddlClass.SelectedItem.Value;
                    string menuTypeId = ddlClass.SelectedItem.Value;
                    string languageId = ddlLanguage.SelectedItem.Value;

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "KEY", "ShowInsertForm(" + classId + "," + menuTypeId + "," + languageId + ");", true);
                }
            }
            catch (Exception ex)
            {
                //write to Elma
                ErrorSignal.FromCurrentContext().Raise(ex);
            }
        }
Ejemplo n.º 2
0
        private void GridDataSource()
        {
            var menuclass = ddlClass.SelectedIndex;
            var menutype  = ddlMenuType.SelectedIndex;
            var language  = ddlLanguage.SelectedIndex;

            var baseItemsDataSource = _baseItemManagement.GetBaseItems(menuclass, menutype, language);

            RadListViewBaseItems.DataSource = baseItemsDataSource;
            RadListViewBaseItems.DataBind();
        }
Ejemplo n.º 3
0
        public void searchBaseItem_clicked(object sender, SearchBoxEventArgs e)
        {
            string baseItemCode = searchBaseItem.Text;

            //check for not null
            if (baseItemCode != "")
            {
                var baseItemsDataSource = _baseItemManagement.GetBaseItemList(baseItemCode);
                RadListViewBaseItems.DataSource = baseItemsDataSource;
                RadListViewBaseItems.DataBind();
            }
            else
            {
                RadListViewBaseItems.DataSource = GetBaseItemsDataSource();
                RadListViewBaseItems.DataBind();
            }
        }
Ejemplo n.º 4
0
 public void btnViewMenu_Click(object sender, EventArgs e)
 {
     ListViewDiv.Visible             = true;
     RadListViewBaseItems.DataSource = GetBaseItemsDataSource();
     RadListViewBaseItems.DataBind();
 }