Inheritance: UI2DSprite
Esempio n. 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.InspectEvent, container, false);

            titleTextView = view.FindViewById<TextView>(Resource.Id.titleTextView);
            timeTextView = view.FindViewById<TextView>(Resource.Id.timeTextView);
            distanceTextView = view.FindViewById<TextView>(Resource.Id.distanceTextView);
            descriptionTextView = view.FindViewById<TextView>(Resource.Id.descriptionTextView);
            currentUsersEventButton = view.FindViewById<Button>(Resource.Id.current_users_event_btn);
            eventCreatorIconImageView = view.FindViewById<RoundedImageView>(Resource.Id.eventCreatorIcon);

            topLeftToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonLeft);
            topRightToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonRight);
            topLeftToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonLeft);
            topRightToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonRight);

            topLeftToolbarImageButton.SetImageResource(Resource.Drawable.ic_chevron_left);
            topLeftToolbarButton.Visibility = ViewStates.Gone;
            topLeftToolbarImageButton.Visibility = ViewStates.Visible;
            topRightToolbarButton.Visibility = ViewStates.Gone;
            topRightToolbarImageButton.Visibility = ViewStates.Gone;

            titleTextView.Text = chosenEvent.Title;
            timeTextView.Text = chosenEvent.Time;
            distanceTextView.Text = chosenEvent.Position;
            descriptionTextView.Text = chosenEvent.Description;
            currentUsersEventButton.Text = chosenEvent.CurrentUsers + "/" + chosenEvent.TotalUsers;
            currentUsersEventButton.Click += CurrentUsersEventButton_Click;
            eventCreatorIconImageView.Click += EventCreatorIconImageView_Click;

            return view;
        }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = HR_EmployeeSalaryRulesManager.DeleteHR_EmployeeSalaryRules(Convert.ToInt32(linkButton.CommandArgument));
        HR_EmployeeSalaryRulesManager.LoadHR_EmployeeSalaryRulesPage(gvHR_EmployeeSalaryRules, rptPager, 1, ddlPageSize);
 }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            cs = new ClientSocket(this);

            _smsSentBroadcastReceiver = new SMSSentReceiver();
            _smsDeliveredBroadcastReceiver = new SMSDeliveredReceiver();
            _smsSentBroadcastReceiver.sentErrorReSendEvent += reSend;
            _smsDeliveredBroadcastReceiver.deliverErrorReSendEvent += reSend;

            ipText = FindViewById<EditText>(Resource.Id.IPText);
            connectButton = FindViewById<ImageButton>(Resource.Id.connectImageButton);

            connectButton.Click += delegate
            {
                if (ipText.Text != "") {
                    cs.Connect(ipText.Text);
                }
                else {
                    ipText.SetBackgroundColor(Android.Graphics.Color.Red);
                    ipText.Error = "Enter IP address!";
                }
            };
        }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = INV_MRRInfoMasterManager.DeleteINV_MRRInfoMaster(Convert.ToInt32(linkButton.CommandArgument));
        INV_MRRInfoMasterManager.LoadINV_MRRInfoMasterPage(gvINV_MRRInfoMaster, rptPager, 1, ddlPageSize);
 }
Esempio n. 5
0
        public TileChunkArea(UIManager.UIManager uiManager)
        {
            var tileChunkArea = uiManager.UIManagerAreas.TileChunkArea = new UIArea<TileChunk>(null, 700, 500, 390, 390) {Closable = true};
            tileChunkArea.Visible = false;

            uiManager.AddArea(tileChunkArea);
            tileChunkArea.AddControl(new TextArea(30, 25, "Tile Chunks") {Color = "blue"});

            tileChunkArea.AddControl(chunkPieceList = new ScrollBox(30, 70, 96 - 16, 3, 64) {BackColor = "rgb(50,60,127)"});

            TileChunk[] tileChunks = SonicManager.Instance.SonicLevel.TileChunks.Array();
            for (int index = 0; index < tileChunks.Length; index++) {
                var tileChunk = tileChunks[index];
                ImageButton<TileChunk> chunkButton = new ImageButton<TileChunk>(tileChunk, 0, 0, 0, 0);
                chunkButton.OnDraw = (cnv, x, y) => {
//                                         chunkButton.Data.DrawUI(cnv, new Point(x, y), new DoublePoint(0.5d, 0.5d), 0);
//                                         chunkButton.Data.DrawUI(cnv, new Point(x, y), new DoublePoint(0.5d, 0.5d), 1);
                                     };
                chunkButton.Font = UIManager.UIManager.SmallTextFont;
                chunkButton.Text = "Chunk #" + index;
                chunkButton.Click = (e) => { tileChunkArea.Data = tileChunk; };
                chunkPieceList.AddControl(chunkButton);
            }

            Image image = new Image(125, 70, 256, 256);
            int areaDrawScale = 2;
            image.OnDraw += (context, x, y) => {
                                if (tileChunkArea.Data == null) return;
//                                tileChunkArea.Data.DrawUI(context, new Point(x, y), new Point(areaDrawScale, areaDrawScale), 0);
//                                tileChunkArea.Data.DrawUI(context, new Point(x, y), new Point(areaDrawScale, areaDrawScale), 1);
                            };
            image.Click += (e) => {
                               if (tileChunkArea.Data == null) return;
//                               var tilePiece = tileChunkArea.Data.GetBlockAt(e.X / areaDrawScale, e.Y / areaDrawScale);

//                               uiManager.UIManagerAreas.TilePieceArea.Visible = false;
//                               uiManager.UIManagerAreas.TilePieceArea.Data = tilePiece;
//                               tilePieceList.ScrollIndex = Math.Max(uiManager.sonicManager.SonicLevel.TilePieces.IndexOf(tilePiece) - 1, 0);
                           };
            tileChunkArea.AddControl(image);

            buildTilePiece(uiManager);

            /*
                        var table=tileChunkArea.AddControl(new Table(10, 40, 350, 280));
                        var row = table.AddRow(new TableRow(50.Percent()));
                        var cell = row.AddCell(new TableCell(50.Percent(), 50.Percent()));
                        cell.AddControl(new Button(0, 0, 0, 0, "Text"));
                        cell = row.AddCell(new TableCell(50.Percent(), 50.Percent()));
                        cell.AddControl(new Button(0, 0, 0, 0, "Text1")); 



                        row = table.AddRow(new TableRow(100));
                        cell = row.AddCell(new TableCell(100, 100));
                        cell.AddControl(new Button(0, 0, 100, 100, "Text"));
                        cell = row.AddCell(new TableCell(100, 100){FullSize=false});
                        cell.AddControl(new Button(0, 0, 100, 50, "Text1"));
                        cell.AddControl(new Button(0, 50, 100, 50, "Text2"));*/
        }
Esempio n. 6
0
 protected void lbClose_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = STD_ClassManager.HistorySTD_Class(Convert.ToInt32(linkButton.CommandArgument),Profile.card_id);
     STD_ClassManager.LoadSTD_ClassPageSearch(gvSTD_Class, rptPager, 1, ddlPageSize,  txtClassForSearch.Text);
 }
        private void CreateControls()
        {
            _panel = new Panel();
            _panel.CssClass = "panTemper";

            _image = new Image();
            _image.ImageUrl = "~/Images/Temper1.png";
            _image.CssClass = "imgBt";
            _panel.Controls.Add(_image);

            _imBtAdd = new ImageButton();
            _imBtAdd.ImageUrl = "~/Images/up_plus.png";
            _imBtAdd.CssClass = "imgBtV";
            _imBtAdd.Click += _imBtAdd_Click;
            _panel.Controls.Add(_imBtAdd);

            _temperLabel = new Label();
            _temperLabel.Text = ((ITemperature)_data.Device).Temperature.ToString();
            _temperLabel.CssClass = "labelTemperat";
            _panel.Controls.Add(_temperLabel);

            _imBtDel = new ImageButton();
            _imBtDel.ImageUrl = "~/Images/down_minus.png";
            _imBtDel.CssClass = "imgBt imgBtV";
            _imBtDel.Click += _imBtDel_Click;
            _panel.Controls.Add(_imBtDel);

            Controls.Add(_panel);
        }
Esempio n. 8
0
        public void AddButton(int x, int y, int width, int height, SkinForm form,EventHandler ClickHandler)
        {
            ImageButton img = new ImageButton(new Rectangle(x, y, width, height), form);
            img.Click += ClickHandler;

            this.Buttons.Add(img);
        }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = Quiz_FillInTheBlanksDetailsManager.DeleteQuiz_FillInTheBlanksDetails(Convert.ToInt32(linkButton.CommandArgument));
        Quiz_FillInTheBlanksDetailsManager.LoadQuiz_FillInTheBlanksDetailsPage(gvQuiz_FillInTheBlanksDetails, rptPager, 1, ddlPageSize);
 }
Esempio n. 10
0
        protected override void OnCreate(Bundle bundle)
        {
			base.OnCreate(bundle);

            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            if (toolbar != null)
            {
				toolbar.SetBackgroundResource (Settings.AppTheme == AppTheme.Red ? Resource.Drawable.red_gradient : Resource.Drawable.blue_gradient);
                SetSupportActionBar(toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);
            }

            var id = Intent.GetLongExtra (RecipientId, 0);
			viewModel = new ConversationViewModel (id);
           
            messagesListView = FindViewById<ListView>(Resource.Id.messages_list_view);

            //TODO: use RecycleView
			var adapter = new ObservableAdapaterBase<MessageViewModel>(ApplicationContext, viewModel.Messages,
                OnMessageTemplate, 
                OnMessageViewCreate);
            adapter.AssignListView(messagesListView);

            sendButton = FindViewById<ImageButton>(Resource.Id.send_button);
            typingText = FindViewById<TextView>(Resource.Id.typing_text);
            inputText = FindViewById<EditText>(Resource.Id.input_text);
            inputText.AfterTextChanged += InputTextChanged;

            sendButton.Click += OnSendClick;
			viewModel.PropertyChanged += ViewModel_PropertyChanged;
			viewModel.ExecuteLoadMessagesCommand ();
        }
Esempio n. 11
0
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.FeedbackFragment, container, false);
            feedbackPositiveButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackPositiveButton);
            feedbackNeutralButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackNeutralButton);
            feedbackNegativeButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackNegativeButton);

            feedbackPositiveButton.Click += (sender, e) => SetRating (ratingPositive);
            feedbackNeutralButton.Click += (sender, e) => SetRating (ratingNeutral);
            feedbackNegativeButton.Click += (sender, e) => SetRating (ratingNegative);

            feedbackMessageEditText = view.FindViewById<EditText> (Resource.Id.FeedbackMessageText).SetFont (Font.Roboto);
            feedbackMessageEditText.AfterTextChanged += OnEdit;

            submitFeedbackButton = view.FindViewById<Button> (Resource.Id.SendFeedbackButton).SetFont (Font.Roboto);
            submitFeedbackButton.Click += OnSendClick;

            feedbackContainer = view.FindViewById<LinearLayout> (Resource.Id.FeedbackContainer);
            disclaimerContainer = view.FindViewById<LinearLayout> (Resource.Id.FeedbackDisclaimer);
            noUserRegisterButton = view.FindViewById<Button> (Resource.Id.FeedbackRegisterButton);

            bool offline = ServiceContainer.Resolve<AuthManager> ().OfflineMode;
            disclaimerContainer.Visibility = offline ? ViewStates.Visible : ViewStates.Gone;
            feedbackContainer.Visibility = offline ? ViewStates.Gone : ViewStates.Visible;

            noUserRegisterButton.Click += OpenRegisterScreen;

            SetRating (userRating);

            return view;
        }
Esempio n. 12
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = STD_ExamInfoManager.DeleteSTD_ExamInfo(Convert.ToInt32(linkButton.CommandArgument));
        STD_ExamInfoManager.LoadSTD_ExamInfoPage(gvSTD_ExamInfo, rptPager, 1, ddlPageSize);
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = USER_RoleWiseMenuManager.DeleteUSER_RoleWiseMenu(Convert.ToInt32(linkButton.CommandArgument));
        USER_RoleWiseMenuManager.LoadUSER_RoleWiseMenuPage(gvUSER_RoleWiseMenu, rptPager, 1, ddlPageSize);
 }
Esempio n. 14
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = COMN_RemarkManager.DeleteCOMN_Remark(Convert.ToInt32(linkButton.CommandArgument));
     COMN_RemarkManager.LoadCOMN_RemarkPageByID(gvCOMN_Remark, rptPager, 1, ddlPageSize, txtID.Text);
 }
Esempio n. 15
0
 public void CreditsControl(ImageButton button)
 {
     if (button.ID == "credits_back")
     {
         ChangeMenuState("MainMenu");
     }
 }
Esempio n. 16
0
 public void ControlsControl(ImageButton button)
 {
     if (button.ID == "controls_back")
     {
         ChangeMenuState("Options");
     }
 }
Esempio n. 17
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.PlayAnimation);
            ImageView btns = FindViewById<ImageView> (Resource.Id.imgNewLoginHeader);
            TextView header = FindViewById<TextView> (Resource.Id.txtFirstScreenHeader);
            RelativeLayout relLayout = FindViewById<RelativeLayout> (Resource.Id.relativeLayout1);
            ImageHelper.setupTopPanel (btns, header, relLayout, header.Context);
            Header.headertext = Application.Context.Resources.GetString (Resource.String.animationPlaybackTitle);
            Header.fontsize = 36f;
            ImageHelper.fontSizeInfo (header.Context);
            header.SetTextSize (Android.Util.ComplexUnitType.Dip, Header.fontsize);
            header.Text = Header.headertext;

            animationView = FindViewById<WebView> (Resource.Id.animationView);

            ImageButton btnBack = FindViewById<ImageButton> (Resource.Id.btnBack);
            btnBack.Tag = 0;
            btnBack.Click += delegate {
                Finish ();
            };
            ImageButton btnPlay = FindViewById<ImageButton> (Resource.Id.btnPlay);
            btnPlay.Tag = 1;
            LinearLayout bottom = FindViewById<LinearLayout> (Resource.Id.bottomHolder);
            ImageButton[] buttons = new ImageButton[2];
            buttons [0] = btnBack;
            buttons [1] = btnPlay;
            ImageHelper.setupButtonsPosition (buttons, bottom, header.Context);
        }
        protected override void OnStart()
        {
            Console.WriteLine("OnStart");
            base.OnStart();
            _listview =  this.FindViewById<ListView>(Resource.Id.DlgListviewMainListview);
            _btnSearch = this.FindViewById<ImageButton>(Resource.Id.btnDlgSearch);
            _edDlgSearch = this.FindViewById<EditText>(Resource.Id.edDlgSearch);
            _edDlgSearch.EditorAction += (object sender, TextView.EditorActionEventArgs e) => 
                {
                    if (e.ActionId == Android.Views.InputMethods.ImeAction.Search)
                    {
                        BtnSearchAsync();
                    }
                };

            _btnSearch.Click+= (sender, e) => {
                BtnSearchAsync();
            };

            _listview.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>  {
                _kunde = _kunden[e.Position];
                _edTarget.Text = _kunde.Name;
                _state.SetLastKundenVK(_kunde);
                _state.SetArtikelKundenStaffelPreise(_kunde);
                this.Dismiss();
            };
        }
Esempio n. 19
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = COMN_CampusManager.DeleteCOMN_Campus(Convert.ToInt32(linkButton.CommandArgument));
        COMN_CampusManager.LoadCOMN_CampusPage(gvCOMN_Campus, rptPager, 1, ddlPageSize);
 }
Esempio n. 20
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = HR_DesignationManager.DeleteHR_Designation(Convert.ToInt32(linkButton.CommandArgument));
        HR_DesignationManager.LoadHR_DesignationPage(gvHR_Designation, rptPager, 1, ddlPageSize);
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            
            InitializeHelloWorldServiceClient();

            getRandomMonkeyButton = FindViewById<Button>(Resource.Id.getRandomMonkeyButton);
            getRandomMonkeyButton.Click += getRandomMonkeyButton_Click;

            randomMonkeyLabel = FindViewById<TextView>(Resource.Id.randomMonkeyLabel);

            familyText = FindViewById<EditText>(Resource.Id.familyText);
            subfamilyText = FindViewById<EditText>(Resource.Id.subfamilyText);
            genusText = FindViewById<EditText>(Resource.Id.genusText);

            searchButton = FindViewById<ImageButton>(Resource.Id.searchButton);
            searchButton.Click += searchButton_Click;

            searchResultsList = FindViewById<ListView>(Resource.Id.searchResultsList);

            adapter = new Adapters.MonkeyInformationAdapter(this, Enumerable.Empty<MonkeyInformation>());
            searchResultsList.Adapter = adapter;
        }
Esempio n. 22
0
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton(); linkButton = (ImageButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("AdminHR_Department.aspx?ID=" + id);
 }
Esempio n. 23
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.InspectUser, container, false);

            //mProfilePic = view.FindViewById<ProfilePictureView>(Resource.Id.profilePic);
            mProfilePic = view.FindViewById<RoundedImageView>(Resource.Id.profilePic);
            mNameText = view.FindViewById<TextView>(Resource.Id.nameTxt);
            addUserAsFriendBtn = view.FindViewById<Button>(Resource.Id.addUserAsFriendsBtn);
            trackUserBtn = view.FindViewById<Button>(Resource.Id.trackUserBtn);

            topLeftToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonLeft);
            topRightToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonRight);
            topLeftToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonLeft);
            topRightToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonRight);

            topLeftToolbarButton.Visibility = ViewStates.Gone;
            topLeftToolbarImageButton.Visibility = ViewStates.Gone;
            topRightToolbarButton.Visibility = ViewStates.Gone;
            topRightToolbarImageButton.Visibility = ViewStates.Gone;

            addUserAsFriendBtn.Visibility = ViewStates.Invisible;
            trackUserBtn.Visibility = ViewStates.Invisible;

            //mProfilePic.ProfileId = Profile.CurrentProfile.Id;

            webClient = new WebClient();
            profilePicUri = new Uri("https://graph.facebook.com/"+Profile.CurrentProfile.Id+"/picture?height=500&width=500");
            webClient.DownloadDataAsync(profilePicUri);
            webClient.DownloadDataCompleted += WebClient_DownloadDataCompleted;

            mNameText.Text = Profile.CurrentProfile.Name;

            return view;
        }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = INV_IteamSubCategoryManager.DeleteINV_IteamSubCategory(Convert.ToInt32(linkButton.CommandArgument));
        INV_IteamSubCategoryManager.LoadINV_IteamSubCategoryPage(gvINV_IteamSubCategory, rptPager, 1, ddlPageSize);
 }
Esempio n. 25
0
        private void CreateControls()
        {
            _panel = new Panel();
            _panel.CssClass = "panVolume";

            _image = new Image();
            _image.ImageUrl = "~/Images/sound_low.png";
            _image.CssClass = "imgBt";
            _panel.Controls.Add(_image);

            _imBtAdd = new ImageButton();
            _imBtAdd.ImageUrl = "~/Images/up_plus.png";
            _imBtAdd.CssClass = "imgBtV";
            _imBtAdd.Click += _imBtAdd_Click;
            _panel.Controls.Add(_imBtAdd);

            _volumeLabel = new Label();
            _volumeLabel.Text = ((IVolume)_data.Device).Volume.ToString();
            _volumeLabel.CssClass = "labelVolume";
            _panel.Controls.Add(_volumeLabel);

            _imBtDel = new ImageButton();
            _imBtDel.ImageUrl = "~/Images/down_minus.png";
            _imBtDel.CssClass = "imgBt imgBtV";
            _imBtDel.Click += _imBtDel_Click;
            _panel.Controls.Add(_imBtDel);

            Controls.Add(_panel);
        }
    private HtmlGenericControl constructControl(IProvider provider)
    {
        string iconPath = Utility.GetSocialAuthConfiguration().IconFolder.Path ;
        if (string.IsNullOrEmpty(iconPath))
            iconPath = "images/socialauthicons/";
        iconPath += provider.ProviderType.ToString() + ".png";
        bool isconnected = SocialAuthUser.IsConnectedWith(provider.ProviderType);
        bool iscurrent = (SocialAuthUser.CurrentProvider == provider.ProviderType);
        HtmlGenericControl providerDiv = new HtmlGenericControl("div");
        providerDiv.Attributes.Add("class", "provider");
        ImageButton imgB = new ImageButton()
        {
            ID = "img" + provider.ProviderType,
            CommandArgument = provider.ProviderType.ToString(),
            ImageUrl = iconPath
        };
        if (isconnected)
        {
            HtmlGenericControl tickspan = new HtmlGenericControl("span");
            tickspan.InnerHtml = "<img src='images/socialauthicons/" + (iscurrent ? "currentyes" : "yes") + ".png' style='top:0px;left:0px;z-index:100'/>";
            tickspan.Style.Add("position", "absolute");

            providerDiv.Controls.Add(tickspan);
        }
        //if (iscurrent)
        //    imgB.Style.Add("border", "1px solid yellow");
        imgB.Command += new CommandEventHandler(imgB_Command);
        providerDiv.Controls.Add(imgB);
        return providerDiv;
    }
Esempio n. 27
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = LeaveTypeManager.DeleteLeaveType(Convert.ToInt32(linkButton.CommandArgument));
     showLeaveTypeGrid();
 }
Esempio n. 28
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = ACC_HeadUserManager.DeleteACC_HeadUser(Convert.ToInt32(linkButton.CommandArgument));
        ACC_HeadUserManager.LoadACC_HeadUserPage(gvACC_HeadUser, rptPager, 1, ddlPageSize);
 }
Esempio n. 29
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     ImageButton linkButton = new ImageButton();
     linkButton = (ImageButton)sender;
     bool result = LIB_BookManager.DeleteLIB_Book(Convert.ToInt32(linkButton.CommandArgument));
     LIB_BookManager.LoadLIB_BookPage(gvLIB_Book, rptPager, 1, ddlPageSize);
 }
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     SetContentView(Resource.Layout.Response);
     userDao = new UserDao();
     postService = new PostService();
     audioService = new SendAudioService();
     deliverPostService = new SendPostService();
     actionBar = SupportActionBar;
     actionBar.SetHomeButtonEnabled(false);
     actionBar.SetDisplayHomeAsUpEnabled(false);
     actionBar.SetDisplayUseLogoEnabled(false);
     actionBar.SetDisplayShowHomeEnabled(false);
     actionBar.Title = "Responder";
     chronometer = FindViewById<TextView>(Resource.Id.recording_lenght);
     previewRecord = FindViewById<ImageView>(Resource.Id.record_image);
     message = FindViewById<EditText>(Resource.Id.criar_topico_conteudo);
     submit = FindViewById<Button>(Resource.Id.criar_topico_submit);
     submit.Click += new System.EventHandler(submit_Click);
     record = FindViewById<ImageButton>(Resource.Id.btn_gravar);
     record.Click += new System.EventHandler(record_Click);
     ServiceLocator.Dispatcher = new DispatchAdapter(this);
     ServiceLocator.Recorder = new RecordAdapter();
     timer = new System.Timers.Timer(1000);
     timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
     timer.Enabled = true;
 }
Esempio n. 31
0
        protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Header)
            {
                LoadSortFieldOptions(e);
            }
            else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr            = (DataRowView)e.Item.DataItem;
                ImageButton imgItemDelete = (ImageButton)e.Item.FindControl("imgItemDelete");
                ImageButton imgItemEdit   = (ImageButton)e.Item.FindControl("imgItemEdit");

                HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
                chkList.Value = dr["ContactID"].ToString();
                if (chkList.Value == "1" || chkList.Value == "2")
                {
                    chkList.Attributes.Add("disabled", "false");
                    imgItemDelete.Enabled = false; imgItemDelete.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    imgItemEdit.Enabled   = false; imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                }
                else
                {
                    imgItemDelete.Enabled = cmdDelete.Visible; if (!imgItemDelete.Enabled)
                    {
                        imgItemDelete.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    }
                    imgItemEdit.Enabled = cmdEdit.Visible; if (!imgItemEdit.Enabled)
                    {
                        imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    }
                    if (imgItemDelete.Enabled)
                    {
                        imgItemDelete.Attributes.Add("onClick", "return confirm_item_delete();");
                    }
                }

                HyperLink lnkContactCode = (HyperLink)e.Item.FindControl("lnkContactCode");
                lnkContactCode.Text        = dr["ContactCode"].ToString();
                lnkContactCode.NavigateUrl = "Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);

                HyperLink lnkContactName = (HyperLink)e.Item.FindControl("lnkContactName");
                lnkContactName.Text        = dr["ContactName"].ToString();
                lnkContactName.NavigateUrl = "Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);

                Label lblBirthDate = (Label)e.Item.FindControl("lblBirthDate");
                lblBirthDate.Text = Convert.ToDateTime(dr["BirthDate"].ToString()).ToString("dd-MMM-yyyy");

                Label lblRewardCardNo = (Label)e.Item.FindControl("lblRewardCardNo");
                lblRewardCardNo.Text = dr["RewardCardNo"].ToString();

                Label lblRewardCardStatus = (Label)e.Item.FindControl("lblRewardCardStatus");
                lblRewardCardStatus.Text = Enum.Parse(typeof(RewardCardStatus), dr["RewardCardStatus"].ToString()).ToString();

                if (Convert.ToBoolean(dr["RewardActive"].ToString()))
                {
                    lblRewardCardStatus.Text += "(Active)";
                }
                else
                {
                    lblRewardCardStatus.Text += "(InActive)";
                }

                Label lblRewardExpiryDate = (Label)e.Item.FindControl("lblRewardExpiryDate");
                lblRewardExpiryDate.Text = Convert.ToDateTime(dr["ExpiryDate"].ToString()).ToString("dd-MMM-yyyy");

                Label lblRewardPoints = (Label)e.Item.FindControl("lblRewardPoints");
                lblRewardPoints.Text = dr["RewardPoints"].ToString();

                Label lblRewardRedeemedPoints = (Label)e.Item.FindControl("lblRewardRedeemedPoints");
                lblRewardRedeemedPoints.Text = dr["RedeemedPoints"].ToString();

                Label lblRewardTotalPurchases = (Label)e.Item.FindControl("lblRewardTotalPurchases");
                lblRewardTotalPurchases.Text = dr["TotalPurchases"].ToString();
            }
        }
Esempio n. 32
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.LayoutFragment3, container, false);

            q1    = view.FindViewById <TextView>(Resource.Id.txtQuestion1);
            ans11 = view.FindViewById <Button>(Resource.Id.btnQ1C1);
            ans12 = view.FindViewById <Button>(Resource.Id.btnQ1C2);
            ans13 = view.FindViewById <Button>(Resource.Id.btnQ1C3);
            ans1  = view.FindViewById <TextView>(Resource.Id.txtAnswer1);

            q2    = view.FindViewById <TextView>(Resource.Id.txtQuestion2);
            ans21 = view.FindViewById <Button>(Resource.Id.btnQ2C1);
            ans22 = view.FindViewById <Button>(Resource.Id.btnQ2C2);
            ans23 = view.FindViewById <Button>(Resource.Id.btnQ2C3);
            ans2  = view.FindViewById <TextView>(Resource.Id.txtAnswer2);

            q3    = view.FindViewById <TextView>(Resource.Id.txtQuestion3);
            ans31 = view.FindViewById <Button>(Resource.Id.btnQ3C1);
            ans32 = view.FindViewById <Button>(Resource.Id.btnQ3C2);
            ans33 = view.FindViewById <Button>(Resource.Id.btnQ3C3);
            ans3  = view.FindViewById <TextView>(Resource.Id.txtAnswer3);

            btnBack = view.FindViewById <ImageButton>(Resource.Id.btnBackfrom3);
            btnNext = view.FindViewById <ImageButton>(Resource.Id.btnContinueFrom3);

            ShortCutFunctions sc = new ShortCutFunctions();


            /*
             * q1.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum][0];
             * ans11.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum][1];
             * ans12.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum][2];
             * ans13.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum][3];
             *
             * q2.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 1][0];
             * ans21.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 1][1];
             * ans22.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 1][2];
             * ans23.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 1][3];
             *
             * q3.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 2][0];
             * ans31.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 2][1];
             * ans32.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 2][2];
             * ans33.Text = result.IFR_Day_Local_Questions_Alternate[N_IFR_Day_Local_Alternate.questionNum + 2][3]; */

            q1.Text    = "Ceiling (Day)";
            ans11.Text = "> 3000 ft";
            ans12.Text = "2501 - 3000 ft";
            ans13.Text = "2000 - 2500 ft";

            q2.Text    = "Visibility (Day)";
            ans21.Text = "5 + SM";
            ans22.Text = "4 SM";
            ans23.Text = "3 SM";

            q3.Text    = "Best IAP Available";
            ans31.Text = "Precision";
            ans32.Text = "Non-Precision";
            ans33.Text = "Circling";

            return(view);
        }
Esempio n. 33
0
        public override View GetPropertyWindowLayout(Context context)
        {
            LinearLayout gridLinearLayout = new LinearLayout(context)
            {
                Orientation = Android.Widget.Orientation.Vertical
            };

            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            layoutParams.TopMargin            = 25;
            gridLinearLayout.LayoutParameters = layoutParams;
            gridLinearLayout.SetBackgroundResource(Resource.Drawable.LinearLayout_Border);

            int width = (int)(context.Resources.DisplayMetrics.WidthPixels - context.Resources.DisplayMetrics.Density) / 3;

            LinearLayout linearLayout4 = new LinearLayout(context);

            linearLayout4.Orientation = Android.Widget.Orientation.Horizontal;
            linearLayout4.SetPadding(0, (int)(10 * currentDensity), 0, 0);

            TextView selectText = new TextView(context)
            {
                Text     = "Connector Style",
                Gravity  = GravityFlags.Start,
                TextSize = 5 * currentDensity
            };

            selectText.SetWidth((int)(width * 0.4 * currentDensity));

            Spinner spinner = new Spinner(context, SpinnerMode.Dialog);

            spinner.SetMinimumHeight((int)(20 * currentDensity));
            spinner.SetBackgroundColor(Color.Gray);
            spinner.DropDownWidth = (int)(200 * currentDensity);

            List <string> list = new List <string>();

            list.Add("Default");
            list.Add("Dashed");
            list.Add("Dotted");
            ArrayAdapter <string> dataAdapter = new ArrayAdapter <string>(context, Android.Resource.Layout.SimpleSpinnerItem, list);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter       = dataAdapter;
            spinner.ItemSelected += sType_spinner_ItemSelected;

            spinner.SetGravity(GravityFlags.Start);
            spinner.SetMinimumWidth(width - (int)(width * 0.4));

            linearLayout4.AddView(selectText);
            linearLayout4.AddView(spinner);

            LinearLayout linearLayout3 = new LinearLayout(context);

            linearLayout3.SetPadding(0, (int)(10 * currentDensity), 0, 0);
            linearLayout3.SetMinimumHeight((int)(40 * currentDensity));

            TextView connectorSize = new TextView(context)
            {
                Text     = "Connector Size",
                Gravity  = GravityFlags.CenterVertical,
                TextSize = 5 * currentDensity
            };

            connectorSize.SetMinimumHeight((int)(40 * currentDensity));
            connectorSize.SetWidth((int)(width * 0.4 * currentDensity));

            LinearLayout plusMinus = new LinearLayout(context);

            plusMinus.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent);
            plusMinus.SetMinimumWidth(width - (int)(width * 0.4));

            ImageButton minusButton = new ImageButton(context);

            minusButton.SetMinimumHeight((int)(40 * currentDensity));
            minusButton.Click += MinusButton_Click;
            string imageId = "diagramsub.png";

            if (imageId != null)
            {
                var imageData = LoadResource(imageId).ToArray();
                minusButton.SetImageBitmap(BitmapFactory.DecodeByteArray(imageData, 0, imageData.Length));
            }
            plusMinus.AddView(minusButton);

            label               = new TextView(context);
            label.Text          = "1";
            label.TextAlignment = TextAlignment.Center;
            label.Gravity       = GravityFlags.Center;
            label.SetMinimumHeight((int)(40 * currentDensity));
            label.SetWidth((int)(40 * currentDensity));
            plusMinus.AddView(label);

            ImageButton plusButton = new ImageButton(context);

            imageId           = "diagramplus.png";
            plusButton.Click += PlusButton_Click;
            plusButton.SetMinimumHeight((int)(40 * currentDensity));
            if (imageId != null)
            {
                var imageData = LoadResource(imageId).ToArray();
                plusButton.SetImageBitmap(BitmapFactory.DecodeByteArray(imageData, 0, imageData.Length));
            }
            plusMinus.AddView(plusButton);

            linearLayout3.AddView(connectorSize);
            linearLayout3.AddView(plusMinus);

            gridLinearLayout.AddView(linearLayout4);
            gridLinearLayout.AddView(linearLayout3);

            return(gridLinearLayout);
        }
Esempio n. 34
0
        protected void GrdHistor_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            PerfilesGrid();
            Idioma = (DataTable)ViewState["TablaIdioma"];
            if (e.Row.RowType == DataControlRowType.DataRow)  // registros
            {
                ImageButton IbtProcesar = e.Row.FindControl("IbtProcesar") as ImageButton;
                if (IbtProcesar != null)
                {
                    if ((int)ViewState["VblCE2"] == 0)
                    {
                        IbtProcesar.Visible = false;
                    }
                    DataRow[] Result = Idioma.Select("Objeto='IbtProcesar'");
                    foreach (DataRow RowIdioma in Result)
                    {
                        IbtProcesar.ToolTip = RowIdioma["Texto"].ToString().Trim();
                    }
                }

                DataRowView dr   = e.Row.DataItem as DataRowView;
                string      VbIR = dr["Identificador"].ToString();
                if (VbIR.Equals("I"))
                {
                    e.Row.BackColor = System.Drawing.Color.LightGoldenrodYellow;
                }
                else
                {
                    e.Row.BackColor = System.Drawing.Color.Aquamarine;
                    if (IbtProcesar != null)
                    {
                        IbtProcesar.Visible = false;
                    }
                }
                if (ViewState["Tipo"].ToString().Equals("MY"))
                {
                    if (IbtProcesar != null)
                    {
                        IbtProcesar.Visible = false;
                    }
                }

                ImageButton imgE = e.Row.FindControl("IbtEdit") as ImageButton;
                if (imgE != null)
                {
                    imgE.Enabled = true;
                    DataRow[] Result = Idioma.Select("Objeto='IbtEdit'");
                    foreach (DataRow RowIdioma in Result)
                    {
                        imgE.ToolTip = RowIdioma["Texto"].ToString().Trim();
                    }
                }
                ImageButton imgD = e.Row.FindControl("IbtDelete") as ImageButton;
                if (imgD != null)
                {
                    DataRow[] Result = Idioma.Select("Objeto='IbtDelete'");
                    foreach (DataRow RowIdioma in Result)
                    {
                        imgD.ToolTip = RowIdioma["Texto"].ToString().Trim();
                    }
                    Result = Idioma.Select("Objeto= 'IbtDeleteOnClick'");
                    foreach (DataRow row in Result)
                    {
                        imgD.OnClientClick = string.Format("return confirm('" + row["Texto"].ToString().Trim() + "');");
                    }
                }
            }
            if ((e.Row.RowState & DataControlRowState.Edit) > 0)
            {
                ImageButton IbtUpdate = (e.Row.FindControl("IbtUpdate") as ImageButton);
                DataRow[]   Result    = Idioma.Select("Objeto= 'IbtUpdate'");
                foreach (DataRow row in Result)
                {
                    IbtUpdate.ToolTip = row["Texto"].ToString().Trim();
                }
                ImageButton IbtCancel = (e.Row.FindControl("IbtCancel") as ImageButton);
                Result = Idioma.Select("Objeto= 'IbtCancel'");
                foreach (DataRow row in Result)
                {
                    IbtCancel.ToolTip = row["Texto"].ToString().Trim();
                }

                TextBox TxtFecEv = (e.Row.FindControl("TxtFecEv") as TextBox);
                if ((int)ViewState["VblCE6"] == 0)
                {
                    TxtFecEv.Visible = false;
                }                                                               //Editar fecha

                DataRowView DRV = e.Row.DataItem as DataRowView;
                if (TxtFecEv != null)
                {
                    TxtFecEv.Text = Cnx.ReturnFecha(DRV["Fecha"].ToString().Trim().Equals("") ? "01/01/1900" : DRV["Fecha"].ToString().Trim());
                }
            }
        }
Esempio n. 35
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.IncidentReport);

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            // Create ActionBarDrawerToggle button and add it to the toolbar
            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);


            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close);

            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();

            navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            setupDrawerContent(navigationView);

            navigationView.NavigationItemSelected += HomeNavigationView_NavigationItemSelected;

            string input     = Intent.GetStringExtra("rent");
            string userinput = Intent.GetStringExtra("user");

            najam = JsonConvert.DeserializeObject <Data_classes.Rent>(input);
            user  = JsonConvert.DeserializeObject <List <User> >(userinput);
            //RequestWindowFeature(WindowFeatures.NoTitle);
            //SetContentView(Resource.Layout.PrijavaIncidenta);
            Button prijaviinc = FindViewById <Button>(Resource.Id.posaljiIncident);

            odaberiSliku = FindViewById <ImageButton>(Resource.Id.odaberiSliku);
            EditText opis = FindViewById <EditText>(Resource.Id.Incidenttekst);

            prijaviinc.Click += (e, s) =>
            {
                RemoveRent slanje = new RemoveRent();
                slanje.IssueDesc = opis.Text;
                slanje.RentID    = najam.Rentid;
                var klijent = new RestClient("http://marichely.me/");
                var zahtjev = new RestRequest("rolling/issues", Method.POST);
                zahtjev.RequestFormat = DataFormat.Json;
                zahtjev.AddParameter("text/json", JsonConvert.SerializeObject(slanje), ParameterType.RequestBody);
                zahtjev.AddHeader("userapikey", user[0].ApiKey);
                IRestResponse odgovor = klijent.Execute(zahtjev);
                zahtjev = new RestRequest("issues/pictures", Method.POST);
                if ((int)odgovor.StatusCode == 200)
                {
                    Toast.MakeText(this, "Successfully created the incident", ToastLength.Short).Show();
                    string issueid = odgovor.Content;

                    if (path != null)
                    {
                        zahtjev = new RestRequest("issues/pictures", Method.POST);
                        zahtjev.RequestFormat = DataFormat.Json;
                        zahtjev.AddHeader("userapikey", user[0].ApiKey);
                        zahtjev.AddHeader("incident", issueid);
                        zahtjev.AddFile("picture", path);
                        IRestResponse odgovor2 = klijent.Execute(zahtjev);
                        if ((int)odgovor2.StatusCode == 200)
                        {
                            Toast.MakeText(this, "Successfully created the incident", ToastLength.Short).Show();
                        }
                    }
                }
            };
            odaberiSliku.Click += (s, e) =>
            {
                var imageIntent = new Intent();
                imageIntent.SetType("image/*");
                imageIntent.SetAction(Intent.ActionGetContent);
                StartActivityForResult(
                    Intent.CreateChooser(imageIntent, "Select photo"), 0);
            };
        }
Esempio n. 36
0
        /// <summary>
        /// ItemDataBound
        /// </summary>
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string        img, alt, publishedTask;
                HtmlTableRow  tr  = (HtmlTableRow)e.Item.FindControl("trList");
                HtmlInputText txt = null;
                if (e.Item.ItemIndex % 2 == 0)
                {
                    tr.Attributes.Add("class", "even");
                }
                else
                {
                    tr.Attributes.Add("class", "old");
                }

                try
                {
                    PNK_ProductCategory data = (PNK_ProductCategory)e.Item.DataItem;

                    //Role
                    Literal ltr = null;
                    ltr      = (Literal)e.Item.FindControl("ltrchk");
                    ltr.Text = string.Format(@"<INPUT class='txt' TYPE='checkbox' ID='cb{0}' NAME='cid[]' value='{1}' onclick='isChecked(this.checked);' >",
                                             e.Item.ItemIndex, data.Id);

                    //Check
                    if (data.Published == "1")
                    {
                        img           = "tick.png";
                        alt           = LocalizationUtility.GetText(ltrAdminPublish.Text);
                        publishedTask = "unpublish";
                    }
                    else
                    {
                        img           = "publish_x.png";
                        alt           = LocalizationUtility.GetText(ltrAminUnPublish.Text);
                        publishedTask = "publish";
                    }

                    //Order
                    txt       = (HtmlInputText)e.Item.FindControl("txtOrder");
                    txt.Value = DBConvert.ParseString(data.Ordering);

                    //Id
                    HtmlInputButton btId = (HtmlInputButton)e.Item.FindControl("btId");
                    btId.Value = DBConvert.ParseString(data.Id);

                    //Base img
                    HtmlImage baseImage = (HtmlImage)e.Item.FindControl("baseImage");
                    baseImage.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], data.BaseImage);
                    HtmlAnchor hypBaseImage = (HtmlAnchor)e.Item.FindControl("hypBaseImage");

                    //set link
                    HyperLink hdflink = new HyperLink();
                    hdflink           = (HyperLink)e.Item.FindControl("hdflink");
                    hypBaseImage.HRef = hdflink.NavigateUrl = template_path + LinkHelper.GetAdminLink("edit_productcategory", data.Id);

                    //HtmlTableCell td = (HtmlTableCell)e.Item.FindControl("tdName");
                    //td.Attributes.Add("onclick", string.Format("listItemTask('cb{0}', 'Edit')", e.Item.ItemIndex));
                    //td = (HtmlTableCell)e.Item.FindControl("trUpdateDate");
                    //td.Attributes.Add("onclick", string.Format("listItemTask('cb{0}', 'Edit')", e.Item.ItemIndex));
                    ImageButton imgctr = (ImageButton)e.Item.FindControl("btnPublish");
                    imgctr.ImageUrl = string.Format("/Admin/images/{0}", img);
                    imgctr.Attributes.Add("alt", alt);
                    HtmlTableCell btn = (HtmlTableCell)e.Item.FindControl("tdbtn");
                    btn.Attributes.Add("onclick", string.Format(" return listItemTask('cb{0}', '{1}')", e.Item.ItemIndex, publishedTask));

                    //Name
                    ltr = (Literal)e.Item.FindControl("ltrName");
                    hypBaseImage.Attributes["title"] = baseImage.Alt = baseImage.Attributes["title"] = ltr.Text = data.ProductCategoryDesc.TreeNameDesc;
                    // Utils.GetScmplitBySpace(data.ProductCategoryDesc.Name, data.PathTree);
                    //Server.HtmlDecode(getScmplit(data.Lvl) + "&bull; | " + data.Lvl + " | " + data.ProductCategoryDesc.Name);
                }
                catch { }
            }
        }
    protected object UniGrid_OnExternalDataBound(object sender, string sourceName, object parameter)
    {
        switch (sourceName)
        {
        case "clickrate":
            return(string.Format("{0:F0}", parameter));

        case "linktarget":
            return(string.Format(@"<a href=""#"" onclick=""OpenTarget('{0}')"">{1}</a>",
                                 parameter,
                                 HTMLHelper.HTMLEncode(TextHelper.LimitLength(parameter.ToString(), 50))));

        case "linktargettooltip":
            return(HTMLHelper.HTMLEncode(parameter.ToString()));

        case "linkdescription":
            return(HTMLHelper.HTMLEncode(TextHelper.LimitLength(parameter.ToString(), 25)));

        case "linkdescriptiontooltip":
            return(HTMLHelper.HTMLEncode(parameter.ToString()));

        case "view":
            if (sender is ImageButton)
            {
                ImageButton imageButton = sender as ImageButton;
                GridViewRow gvr         = parameter as GridViewRow;
                if (gvr != null)
                {
                    DataRowView drv = gvr.DataItem as DataRowView;
                    if (drv != null)
                    {
                        int totalClics = ValidationHelper.GetInteger(drv["TotalClicks"], 0);
                        if (totalClics <= 0)
                        {
                            imageButton.Style.Add(HtmlTextWriterStyle.Display, "none");
                        }
                    }
                }
            }
            return(sender);

        case "deleteoutdated":
            if (sender is ImageButton)
            {
                ImageButton imageButton = sender as ImageButton;
                GridViewRow gvr         = parameter as GridViewRow;
                if (gvr != null)
                {
                    DataRowView drv = gvr.DataItem as DataRowView;
                    if (drv != null)
                    {
                        bool isOutdated = ValidationHelper.GetBoolean(drv["LinkOutdated"], false);
                        if (!isOutdated)
                        {
                            imageButton.Style.Add(HtmlTextWriterStyle.Display, "none");
                        }
                    }
                }
            }
            return(sender);

        default:
            return(parameter);
        }
    }
Esempio n. 38
0
		public async Task CreatedWithCorrectButtonType()
		{
			var imageButton = new ImageButton();
			UIButtonType buttonType = await GetControlProperty(imageButton, uiButton => uiButton.ButtonType);
			Assert.AreNotEqual(UIButtonType.Custom, buttonType);
		}
        public PageProduct(FrigoBaseDeDonnée produit)
        {
            Content = grid;
            prod    = produit;



            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(2, GridUnitType.Star)
            });

            //grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });

            grid.BackgroundColor = Color.White;


            StackLayout stackTop = new StackLayout();

            stackTop.HorizontalOptions = LayoutOptions.Center;

            Titre.Text = produit.Name;
            Titre.HorizontalTextAlignment = TextAlignment.Center;
            Titre.FontSize = 25;


            // Grid.SetColumnSpan(stackTop, 2);
            ImageButton Close = new ImageButton();

            Close.Source          = "Assets/croix.png";
            Close.HeightRequest   = 50;
            Close.Scale           = 0.5;
            Close.VerticalOptions = LayoutOptions.Start;
            Close.Clicked        += (sender, e) => {
                Navigation.PopAsync();
            };
            stackTop.Children.Add(Close);

            stackTop.Children.Add(Titre);
            grid.Children.Add(stackTop, 0, 0);
            ImageButton nutriscore = new ImageButton();

            nutriscore.WidthRequest = 140;
            stackTop.Children.Add(nutriscore);

            switch (produit.Nutriscore)
            {
            case "a":
                nutriscore.Source = "Assets/A.png";
                break;

            case "b":
                nutriscore.Source = "Assets/B.png";
                break;

            case "c":
                nutriscore.Source = "Assets/C.png";
                break;

            case "d":
                nutriscore.Source = "Assets/D.png";
                break;

            case "e":
                nutriscore.Source = "Assets/E.png";
                break;

            default:
                Label isnot = new Label
                {
                    Text = "The nutriscore is not set for this product"
                };
                stackTop.Children.Add(isnot);
                break;
            }
            quantity.Text = produit.Quantity;
            stackTop.Children.Add(quantity);


            Label espace2 = new Label
            {
                HeightRequest = 70
            };


            grid.Children.Add(baspage, 0, 1);
            Label pour100g = new Label
            {
                Text                    = "Repères nutritionnels pour 100 g/100 mL",
                FontAttributes          = FontAttributes.Bold,
                FontSize                = 30,
                HorizontalTextAlignment = TextAlignment.Center
            };

            baspage.Children.Add(pour100g);



            baspage.Children.Add(espace2);


            comparatif(produit.GommetesSucre, produit.Sucre, "Sugar");
            comparatif(produit.GommetesSel, produit.Sel, "Salt");
            comparatif(produit.GommetesMG, produit.Matiere_grasse, "Fat");
            comparatif("", produit.Proteine, "Protein");
            ingredient.Text = "Ingrédients: " + prod.Ingrédients;

            baspage.Children.Add(espace);

            if (produit.Ingrédients == null || produit.Ingrédients == "")
            {
                ImageButton save = new ImageButton
                {
                    Source            = "Assets/save.png",
                    HeightRequest     = 40,
                    HorizontalOptions = LayoutOptions.Center,
                    ClassId           = produit.Name
                };
                save.Clicked += Save_Clicked;
                baspage.Children.Add(ajoutdescription);
                baspage.Children.Add(save);
            }
            else
            {
                baspage.Children.Add(ingredient);
            }
        }
        public void comparatif(string productgommette, float productquantite, string type)
        {
            StackLayout stack = new StackLayout
            {
                Orientation = StackOrientation.Horizontal
            };

            baspage.Children.Add(stack);
            ImageButton image = new ImageButton
            {
                WidthRequest = 37
            };
            Label label = new Label
            {
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = 25,
                VerticalTextAlignment = TextAlignment.Center
            };

            stack.Children.Add(image);
            stack.Children.Add(label);
            if (productquantite == -1)
            {
                ImageButton plus = new ImageButton
                {
                    Source       = "Assets/plus.png",
                    WidthRequest = 37
                };
                plus.Clicked += Plus_Clicked;
                stack.Children.Add(plus);

                image.Source = "Assets/interrogation.png";
                label.Text   = "The quantity of " + type + " is not set for this product ";
            }
            else
            {
                label.Text = productquantite + "g: " + type;
                switch (productgommette)
                {
                case "low":
                    image.Source = "Assets/RondVert.png";
                    label.Text  += " in few quantity";
                    break;

                case "moderate":
                    image.Source = "Assets/Rond_orange.png";
                    label.Text  += " In moderate quantity";
                    break;

                case "high":
                    image.Source = "Assets/RoundRouge.png";
                    label.Text  += " In heigh quantity";
                    break;

                default:

                    break;
                }
            }
            stack.HorizontalOptions = LayoutOptions.FillAndExpand;
        }
        protected void rptShoppingCart_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label   lblSkuCode        = e.Item.FindControl("lblSkuCode") as Label;
                Label   lblSkuDescription = e.Item.FindControl("lblSkuDescription") as Label;
                TextBox txtQuantity       = e.Item.FindControl("txtQuantity") as TextBox;
                //Label lblQuantity = e.Item.FindControl("lblQuantity") as Label;
                Label                lblSkuInitialPrice = e.Item.FindControl("lblSkuInitialPrice") as Label;
                ImageButton          btnRemoveItem      = e.Item.FindControl("btnRemoveItem") as ImageButton;
                HtmlContainerControl holderQuantity     = e.Item.FindControl("holderQuantity") as HtmlContainerControl;
                HtmlContainerControl holderRemove       = e.Item.FindControl("holderRemove") as HtmlContainerControl;
                Image                imgProduct         = e.Item.FindControl("imgProduct") as Image;

                Sku cartItem = e.Item.DataItem as Sku;

                lblSkuDescription.Text = cartItem.ShortDescription;
                //lblQuantity.Text = txtQuantity.Text = cartItem.Quantity.ToString();
                lblSkuInitialPrice.Text = String.Format("${0:0.##}", cartItem.InitialPrice);
                if (cartItem.ImagePath != null && cartItem.ImagePath.Length > 0)
                {
                    imgProduct.ImageUrl = cartItem.ImagePath;
                    lblSkuCode.Visible  = false;
                }
                else
                {
                    imgProduct.Visible = false;
                    lblSkuCode.Text    = cartItem.SkuCode.ToString();
                }


                btnRemoveItem.CommandArgument = cartItem.SkuId.ToString();

                //txtQuantity.Attributes["onchange"] = Page.ClientScript.GetPostBackEventReference(refresh, "");

                switch (QuantityMode)
                {
                case ShoppingCartQuanityMode.Hidden:
                    holderQuantity.Visible = false;
                    break;

                //case ShoppingCartQuanityMode.Editable:
                //    lblQuantity.Visible = false;
                //    break;
                //case ShoppingCartQuanityMode.Readonly:
                //    txtQuantity.Visible = false;
                //    break;
                default:
                    break;
                }

                if (HideRemoveButton)
                {
                    holderRemove.Visible = false;
                }
            }
            else if (e.Item.ItemType == ListItemType.Header)
            {
                HtmlContainerControl holderHeaderQuantity = e.Item.FindControl("holderHeaderQuantity") as HtmlContainerControl;
                HtmlContainerControl holderHeaderRemove   = e.Item.FindControl("holderHeaderRemove") as HtmlContainerControl;
                if (QuantityMode == ShoppingCartQuanityMode.Hidden)
                {
                    holderHeaderQuantity.Visible = false;
                }

                if (HideRemoveButton)
                {
                    holderHeaderRemove.Visible = false;
                }
            }
        }
        private void CreateShopTable(List<Cart> purchaseList, out int subTotal)
        {
            subTotal = new int();

            ProductModel model = new ProductModel();

            foreach(Cart cart in purchaseList)
            {
                Product product = model.GetProduct(cart.ProductID);

                //utworz przycisk obrazu
                ImageButton btnImage = new ImageButton
                {
                    ImageUrl = string.Format("~/Images/Products/{0}", product.Image),
                    PostBackUrl = string.Format("~/Pages/Product.aspx?id={0}", product.Id)
                };

                //utworz link do usuwania
                LinkButton lnkDelete = new LinkButton
                {
                    PostBackUrl = string.Format("~/Pages/ShoppingCart.aspx?productId={0}", cart.ID),
                    Text = "Usuń produkt",
                    ID = "del" + cart.ID
                };

                //zdarzenie po kliknięciu
                lnkDelete.Click += Delete_Item;

                //utworz liste rozwijana ilosci
                //wygeneruj pd 1 do 20
                int[] amount = Enumerable.Range(1, 20).ToArray();
                DropDownList ddlAmount = new DropDownList
                {
                    DataSource = amount,
                    AppendDataBoundItems = true,
                    AutoPostBack = true,
                    ID = cart.ID.ToString()
                };

                ddlAmount.DataBind();
                ddlAmount.SelectedValue = cart.Amount.ToString();
                ddlAmount.SelectedIndexChanged += ddlAmount_SelectedIndexChanged;

                //utworz tabele html z 2 wierszami
                Table table = new Table { CssClass = "cartTable" };
                TableRow a = new TableRow();
                TableRow b = new TableRow();

                //utworz 6 komorek A
                TableCell a1 = new TableCell { RowSpan = 2, Width = 50 };
                TableCell a2 = new TableCell { Text = string.Format("<h4>{0}</h4><br/>{1}<br/>W magazynie", 
                    product.Name, "Produkt numer: " + product.Id ), 
                    HorizontalAlign = HorizontalAlign.Left, Width=350};
                TableCell a3 = new TableCell { Text = "Cena za jedną sztukę<hr/>" };
                TableCell a4 = new TableCell { Text = "Ilość<hr/>" };
                TableCell a5 = new TableCell { Text = "Łącznie<hr/>" };
                TableCell a6 = new TableCell { };

                //utworz 6 komorek B
                TableCell b1 = new TableCell { };
                TableCell b2 = new TableCell { Text = product.Price + "zł" };
                TableCell b3 = new TableCell { };
                TableCell b4 = new TableCell { Text = cart.Amount * product.Price + "zł" };
                TableCell b5 = new TableCell { };
                TableCell b6 = new TableCell { };

                //ustaw specjalne sterowanie
                a1.Controls.Add(btnImage);
                a6.Controls.Add(lnkDelete);
                b3.Controls.Add(ddlAmount);

                //dodanie komórek do wierszy
                a.Cells.Add(a1);
                a.Cells.Add(a2);
                a.Cells.Add(a3);
                a.Cells.Add(a4);
                a.Cells.Add(a5);
                a.Cells.Add(a6);

                b.Cells.Add(b1);
                b.Cells.Add(b2);
                b.Cells.Add(b3);
                b.Cells.Add(b4);
                b.Cells.Add(b5);
                b.Cells.Add(b6);

                //dodanie wierszy do tabeli
                table.Rows.Add(a);
                table.Rows.Add(b);

                //dodaj tabele do panelu pnlShoppingCart
                pnlShoppingCart.Controls.Add(table);

                //dodaj całkowitą ilosc pozycji w koszyku do subtotal
                subTotal += cart.Amount * Convert.ToInt32(product.Price);

            }

            //dodaj koszyk aktualnego użytkownika do wartości sesji użytkownika
            Session[User.Identity.GetUserId()] = purchaseList;
        }
Esempio n. 43
0
        public virtual void MakeGridView(Panel PN_GridView, String EditPage)
        {
            // converver le panneau parent (utilisé dans certaines méthodes de cette classe)
            this.PN_GridView         = PN_GridView;
            Page.Session["EditPage"] = EditPage;
            Table Grid = null;

            if (reader.HasRows)
            {
                Grid = new Table();

                // Construction de l'entête de la GridView
                TableRow tr = new TableRow();
                for (int columnIndex = 0; columnIndex < ColumnTitles.Count; columnIndex++)
                {
                    if (ColumnsVisibility[columnIndex])
                    {
                        TableCell td = new TableCell();
                        tr.Cells.Add(td);
                        Label LBL_Header = new Label();
                        LBL_Header.Text = "<b>" + ColumnTitles[columnIndex] + "</b>";

                        if (ColumnsSortEnable[columnIndex])
                        {
                            ImageButton BTN_Sort = new ImageButton();
                            // assignation du delegate du clic (voir sa définition plus bas dans le code)
                            BTN_Sort.Click += new ImageClickEventHandler(SortField_Click);
                            // IMPORTANT!!!
                            // il faut placer dans le répertoire Images du projet l'icône qui représente un tri
                            BTN_Sort.ImageUrl = @"~/Images/Sort.png";
                            // afin de bien reconnaitre quel champ il faudra trier on construit ici un ID
                            // pour le bouton
                            BTN_Sort.ID = "Sort_" + FieldsNames[columnIndex];
                            td.Controls.Add(BTN_Sort);
                        }
                        td.Controls.Add(LBL_Header);
                    }
                }
                Grid.Rows.Add(tr);

                // Construction des rangées de la GridView
                while (Next())
                {
                    tr = new TableRow();
                    for (int fieldIndex = 0; fieldIndex < FieldsValues.Count; fieldIndex++)
                    {
                        if (ColumnsVisibility[fieldIndex])
                        {
                            TableCell td = new TableCell();
                            if (CellsContentDelegate[fieldIndex] != null)
                            {
                                // construction spécialisée du contenu d'une cellule
                                // définie dans les sous classes
                                //td.Controls.Add(CellsContentDelegate[fieldIndex]());///////////jai mis ca en commentaire pour le faire fonctionner
                            }                                                                   //il n'aime pas les id
                            else
                            {
                                Type type = FieldsTypes[fieldIndex];
                                if (SQLHelper.IsNumericType(type))
                                {
                                    td.Text = FieldsValues[fieldIndex].ToString();
                                    // IMPORTANT! Il faut inclure dans la section style
                                    // une classe numeric qui impose l'alignement à droite
                                    td.CssClass = "numeric";
                                }
                                else
                                if (type == typeof(DateTime))
                                {
                                    td.Text = DateTime.Parse(FieldsValues[fieldIndex]).ToString();     //.ToShortDateString()
                                }
                                else
                                {
                                    td.Text = SQLHelper.FromSql(FieldsValues[fieldIndex]);
                                }
                            }
                            tr.Cells.Add(td);
                        }
                        Grid.Rows.Add(tr);
                    }
                }
            }
            PN_GridView.Controls.Clear();
            if (Grid != null)
            {
                PN_GridView.Controls.Add(Grid);
            }
            EndQuerySQL();
        }
Esempio n. 44
0
        // コンストラクタ


        // 非公開静的メソッド

        /// <summary>
        /// 指定した ImageButton のインスタンスの DataContext を ImageButtonViewModel クラスのインスタンスとして取得します。
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        private static ImageButtonViewModel getViewModel(ImageButton instance)
        {
            return(instance.DataContext as ImageButtonViewModel);
        }
Esempio n. 45
0
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType.Equals(DataControlRowType.Header))
            {
                for (int iCol = 0; iCol < e.Row.Cells.Count; iCol++)
                {
                    e.Row.Cells[iCol].Attributes.Add("class", "table_h");
                    e.Row.Cells[iCol].Wrap = false;
                }
            }
            else if (e.Row.RowType.Equals(DataControlRowType.DataRow) || e.Row.RowState.Equals(DataControlRowState.Alternate))
            {
                #region Set datagrid row color
                string strEvenColor, strOddColor, strMouseOverColor;
                strEvenColor      = ((DataSet)Application["xmlconfig"]).Tables["colorDataGridRow"].Rows[0]["Even"].ToString();
                strOddColor       = ((DataSet)Application["xmlconfig"]).Tables["colorDataGridRow"].Rows[0]["Odd"].ToString();
                strMouseOverColor = ((DataSet)Application["xmlconfig"]).Tables["colorDataGridRow"].Rows[0]["MouseOver"].ToString();

                e.Row.Style.Add("valign", "top");
                e.Row.Style.Add("cursor", "hand");
                e.Row.Attributes.Add("onMouseOver", "this.style.backgroundColor='" + strMouseOverColor + "'");

                if (e.Row.RowState.Equals(DataControlRowState.Alternate))
                {
                    e.Row.Attributes.Add("bgcolor", strOddColor);
                    e.Row.Attributes.Add("onMouseOut", "this.style.backgroundColor='" + strOddColor + "'");
                }
                else
                {
                    e.Row.Attributes.Add("bgcolor", strEvenColor);
                    e.Row.Attributes.Add("onMouseOut", "this.style.backgroundColor='" + strEvenColor + "'");
                }
                #endregion
                Label lblNo = (Label)e.Row.FindControl("lblNo");
                int   nNo   = (GridView1.PageSize * GridView1.PageIndex) + e.Row.RowIndex + 1;
                lblNo.Text = nNo.ToString();
                Label  lblbudget_code = (Label)e.Row.FindControl("lblbudget_code");
                Label  lblbudget_name = (Label)e.Row.FindControl("lblbudget_name");
                Label  lblc_active    = (Label)e.Row.FindControl("lblc_active");
                string strStatus      = lblc_active.Text;

                #region set ImageStatus
                ImageButton imgStatus = (ImageButton)e.Row.FindControl("imgStatus");
                if (strStatus.Equals("Y"))
                {
                    imgStatus.ImageUrl = ((DataSet)Application["xmlconfig"]).Tables["imgStatus"].Rows[0]["img"].ToString();
                    imgStatus.Attributes.Add("title", ((DataSet)Application["xmlconfig"]).Tables["imgStatus"].Rows[0]["title"].ToString());
                    imgStatus.Attributes.Add("onclick", "return false;");
                }
                else
                {
                    imgStatus.ImageUrl = ((DataSet)Application["xmlconfig"]).Tables["imgStatus"].Rows[0]["imgdisable"].ToString();
                    imgStatus.Attributes.Add("title", ((DataSet)Application["xmlconfig"]).Tables["imgStatus"].Rows[0]["titledisable"].ToString());
                    imgStatus.Attributes.Add("onclick", "return false;");
                }
                #endregion

                #region set ImageView

                ImageButton imgView = (ImageButton)e.Row.FindControl("imgView");
                imgView.Attributes.Add("onclick", "OpenPopUp('800px','250px','90%','แสดง" + base.PageDes + "','budget_view.aspx?budget_code=" + lblbudget_code.Text + "','1');return false;");
                imgView.ImageUrl = ((DataSet)Application["xmlconfig"]).Tables["imgView"].Rows[0]["img"].ToString();
                imgView.Attributes.Add("title", ((DataSet)Application["xmlconfig"]).Tables["imgView"].Rows[0]["title"].ToString());
                #endregion

                #region set Image Edit & Delete
                ImageButton imgEdit    = (ImageButton)e.Row.FindControl("imgEdit");
                Label       lblCanEdit = (Label)e.Row.FindControl("lblCanEdit");
                imgEdit.Attributes.Add("onclick", "OpenPopUp('800px','250px','90%','แก้ไข" + base.PageDes + "','budget_control.aspx?budget_type=" + this.BudgetType + "&mode=edit&budget_code=" + lblbudget_code.Text +
                                       "&page=" + GridView1.PageIndex.ToString() + "&canEdit=Y','1');return false;");
                imgEdit.ImageUrl = ((DataSet)Application["xmlconfig"]).Tables["imgEdit"].Rows[0]["img"].ToString();
                imgEdit.Attributes.Add("title", ((DataSet)Application["xmlconfig"]).Tables["imgEdit"].Rows[0]["title"].ToString());

                ImageButton imgDelete = (ImageButton)e.Row.FindControl("imgDelete");
                imgDelete.ImageUrl = ((DataSet)Application["xmlconfig"]).Tables["imgDelete"].Rows[0]["img"].ToString();
                imgDelete.Attributes.Add("title", ((DataSet)Application["xmlconfig"]).Tables["imgDelete"].Rows[0]["title"].ToString());
                imgDelete.Attributes.Add("onclick", "return confirm(\"คุณต้องการลบแผนงบประมาณ    " + lblbudget_code.Text + " : " + lblbudget_name.Text + " ?\");");
                #endregion

                #region check user can edit/delete
                imgEdit.Visible   = base.IsUserEdit;
                imgDelete.Visible = base.IsUserDelete;
                #endregion
            }
        }
        protected void rcbAction_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            if (rcbAction.SelectedValue == "4")
            {
                string _prm = "Reports.aspx?id=so0" + lblid.Text + "&idx=0&prj=" + lblprjcode.Text;
                ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "window.open('" + _prm + "','','left=210,top=100,width=1110,height=600,menubar=1,toolbar=1,scrollbars=1,status=0,resizable=0');", true);
                ScriptManager.RegisterStartupScript(this, typeof(string), "close", "CallAutoSize();", true);
            }
            else if (rcbAction.SelectedValue == "2")
            {
                if (confirm.Value == "yes")
                {
                    Delete_So();
                    Response.Redirect("SOLog.aspx?" + Request.QueryString.ToString());
                }
            }
            else if (rcbAction.SelectedValue == "0")
            {
                Session["issued"] = lbissued.Text;
                string _prm = "soadd.aspx?" + Request.QueryString.ToString();
                Response.Redirect(_prm);
            }
            else if (rcbAction.SelectedValue == "3")
            {
                loadusers();
                string script = "function f(){$find(\"" + RadWindow_SOReissue.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
                ScriptManager.RegisterStartupScript(this, typeof(string), "close", "CallAutoSize();", true);
            }
            else
            {
                int      count      = 0;
                string   serialNo   = string.Empty;
                ListView _photoList = new ListView();
                for (int i = 0; i <= mydetails.Items.Count - 1; i++)
                {
                    CheckBox checkbox = (CheckBox)mydetails.Items[i].FindControl("chkselect");
                    if (checkbox.Checked == true)
                    {
                        count += 1;
                        Label _itmid = (Label)mydetails.Items[i].FindControl("so_itm_idLabel");
                        lblsoitmid.Text = _itmid.Text;
                        serialNo        = ((Label)mydetails.Items[i].FindControl("slno")).Text;;
                        _photoList      = (ListView)mydetails.Items[i].FindControl("lvPhoto");
                    }
                }
                if (count == 0)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Select Row');CallAutoSize();", true);
                }
                else if (count > 1)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Select One Row');CallAutoSize();", true);
                }
                else if (count == 1)
                {
                    if (rcbAction.SelectedValue == "1")
                    {
                        lblSubjectText.Text = lbdoc.Text;
                        Load_So_Items();

                        DataTable dt = new DataTable();
                        dt.Columns.Add("photo");
                        dt.Columns.Add("PhotoID");

                        for (int i = 0; i < _photoList.Items.Count; i++)
                        {
                            ImageButton _imgbtn = (ImageButton)_photoList.Items[i].Controls[1].FindControl("ImageButton2");
                            DataRow     dr      = dt.NewRow();
                            dr["photo"] = _imgbtn.ImageUrl.ToString();
                            Label _lblID = (Label)_photoList.Items[i].Controls[1].FindControl("lblPhotID");
                            dr["PhotoID"] = _lblID.Text;
                            dt.Rows.Add(dr);
                        }
                        lvPhotoList.DataSource = dt;
                        lvPhotoList.DataBind();

                        string script = "function f(){$find(\"" + RadWindow_SOEdit.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);$find(\"" + RadWindow_SOEdit.ClientID + "\").set_title('" + lblsono.Text + " > Item " + serialNo + " > Comment Edit'); ";
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
                        ScriptManager.RegisterStartupScript(this, typeof(string), "close", "CallAutoSize();", true);
                    }
                }
            }

            rcbAction.ClearSelection();
        }
Esempio n. 47
0
    private void CreateShopTable(IEnumerable <Cart> carts, out double subTotal)
    {
        subTotal = new double();
        ProductsModel model = new ProductsModel();


        foreach (Cart cart in carts)
        {
            Product product = model.GetProduct(cart.ProductID);

            //Create imagne buton

            ImageButton btnImage = new ImageButton
            {
                ImageUrl    = string.Format("~/Images/Products/{0}", product.Image),
                PostBackUrl = string.Format("~/Pages/Product.aspx?id={0}", product.Id),
            };

            //Create delete link
            LinkButton lnkDelete = new LinkButton
            {
                PostBackUrl = string.Format("~/Pages/ShoppingCart.aspx?productId={0}", cart.ID),
                Text        = "Delete Item",
                ID          = "del" + cart.ID
            };

            //Add onclick event
            lnkDelete.Click += Delete_Item;

            //Create quantity dropdown list
            int[]        amount    = Enumerable.Range(1, 20).ToArray();
            DropDownList ddlAmount = new DropDownList
            {
                DataSource           = amount,
                AppendDataBoundItems = true,
                AutoPostBack         = true,
                ID = cart.ID.ToString()
            };

            ddlAmount.DataBind();
            ddlAmount.SelectedValue         = cart.Amount.ToString();
            ddlAmount.SelectedIndexChanged += ddlAmount_SelectedIndexChanged;

            //Create html tables
            Table table = new Table {
                CssClass = "cartTable"
            };
            TableRow a = new TableRow();
            TableRow b = new TableRow();

            //create 6 cells for a
            TableCell a1 = new TableCell {
                RowSpan = 2, Width = 50
            };
            TableCell a2 = new TableCell {
                Text = string.Format("<h4>{0}</h4><br/>{1}<br/>In Stock", product.Name, "Item No: " + product.Id), HorizontalAlign = HorizontalAlign.Left, Width = 350
            };
            TableCell a3 = new TableCell {
                Text = "Unit Price<hr/>"
            };
            TableCell a4 = new TableCell {
                Text = "Quantity<hr/>"
            };
            TableCell a5 = new TableCell {
                Text = "Item Total<hr/>"
            };
            TableCell a6 = new TableCell {
            };

            //create 6 cells for b
            TableCell b1 = new TableCell {
            };
            TableCell b2 = new TableCell {
                Text = "R " + product.Price
            };
            TableCell b3 = new TableCell {
            };
            TableCell b4 = new TableCell {
                Text = "R " + Math.Round((cart.Amount * product.Price).Value, 2)
            };                                                                                                 //This line had to be ammended as it was throwing a error: cannot convert from double? to double.
            TableCell b5 = new TableCell {
            };
            TableCell b6 = new TableCell {
            };


            //set speical controls
            a1.Controls.Add(btnImage);
            a6.Controls.Add(lnkDelete);
            b3.Controls.Add(ddlAmount);

            //add cells to rows
            a.Cells.Add(a1);
            a.Cells.Add(a2);
            a.Cells.Add(a3);
            a.Cells.Add(a4);
            a.Cells.Add(a5);
            a.Cells.Add(a6);

            b.Cells.Add(b1);
            b.Cells.Add(b2);
            b.Cells.Add(b3);
            b.Cells.Add(b4);
            b.Cells.Add(b5);
            b.Cells.Add(b6);

            //Add rows to table
            table.Rows.Add(a);
            table.Rows.Add(b);

            //add table to pnlShoppingCart
            pnlShoppingCart.Controls.Add(table);

            //Add total amount item in cart to subtotal
            subTotal += (cart.Amount * product.Price).Value;    //This line also had to be ammened like on line 95.
        }


        //Add curent users shopping cart to user specific session
        Session[User.Identity.GetUserId()] = carts;
    }
Esempio n. 48
0
        protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType.Equals(DataControlRowType.Header))
            {
                #region Create Item Header
                bool bSort = false;
                int  i     = 0;
                for (i = 0; i < GridView1.Columns.Count; i++)
                {
                    if (ViewState["sort"].Equals(GridView1.Columns[i].SortExpression))
                    {
                        bSort = true;
                        break;
                    }
                }
                if (bSort)
                {
                    foreach (System.Web.UI.Control c in e.Row.Controls[i].Controls)
                    {
                        if (c.GetType().ToString().Equals("System.Web.UI.WebControls.DataControlLinkButton"))
                        {
                            if (ViewState["direction"].Equals("ASC"))
                            {
                                ((LinkButton)c).Text += "<img border=0 src='" + ((DataSet)Application["xmlconfig"]).Tables["imgAsc"].Rows[0]["img"].ToString() + "'>";
                            }
                            else
                            {
                                ((LinkButton)c).Text += "<img border=0 src='" + ((DataSet)Application["xmlconfig"]).Tables["imgDesc"].Rows[0]["img"].ToString() + "'>";
                            }
                        }
                    }
                }
                #endregion
            }
            else if (e.Row.RowType.Equals(DataControlRowType.Pager))
            {
                TableCell   tbc      = e.Row.Cells[0];
                Label       lblPrev  = null;
                Label       lblNext  = null;
                ImageButton lbtnPrev = null;
                ImageButton lbtnNext = null;

                #region find and store Previous and Next Page
                TableRow tbr = (TableRow)tbc.Controls[0].Controls[0];
                foreach (System.Web.UI.Control c in tbr.Controls)
                {
                    if (c.GetType().ToString().Equals("System.Web.UI.WebControls.Label"))
                    {
                        Label lbl = (Label)c;
                        if (lbl.Text.IndexOf("P") != -1)
                        {
                            lblPrev      = lbl;
                            lblPrev.Text = string.Empty;
                        }
                        if (lbl.Text.IndexOf("N") != -1)
                        {
                            lblNext      = lbl;
                            lblNext.Text = string.Empty;
                        }
                    }
                    if (c.Controls[0].GetType().ToString().Equals("System.Web.UI.WebControls.DataControlImageButton"))
                    {
                        ImageButton lbtn = (ImageButton)c.Controls[0];
                        if (lbtn.AlternateText.IndexOf("P") != -1)
                        {
                            lbtnPrev          = lbtn;
                            lbtnPrev.ImageUrl = "~/images/prev.gif";
                        }
                        if (lbtn.AlternateText.IndexOf("N") != -1)
                        {
                            lbtnNext          = lbtn;
                            lbtnNext.ImageUrl = "~/images/next.gif";
                        }
                    }
                }
                #endregion

                #region render new pager
                tbc.Text = string.Empty;
                Literal lblPager = new Literal();
                lblPager.Text = "<TABLE border='0' width='100%' cellpadding='0' cellspacing='0'><TR><TD width='30%' valign='middle'>";
                tbc.Controls.Add(lblPager);

                Label lblTotalRecord = new Label();
                lblTotalRecord.Attributes.Add("class", "label_h");
                lblTotalRecord.Text = "พบข้อมูล " + txthTotalRecord.Value.ToString() + " รายการ.";
                tbc.Controls.Add(lblTotalRecord);

                lblPager      = new Literal();
                lblPager.Text = "</TD><TD width='30%' align='center' valign='middle'>";
                tbc.Controls.Add(lblPager);

                DropDownList cboPerPage = new DropDownList();
                cboPerPage.ID = "cboPerPage";

                DataTable entries;
                if ((DataSet)Application["xmlconfig"] == null)
                {
                    return;
                }
                else
                {
                    entries = ((DataSet)Application["xmlconfig"]).Tables["RecordPerPage"];
                }

                for (int i = 0; i < entries.Rows.Count; i++)
                {
                    cboPerPage.Items.Add(new ListItem(entries.Rows[i][0].ToString(), entries.Rows[i][1].ToString()));
                }

                if (cboPerPage.Items.FindByValue(strRecordPerPage) != null)
                {
                    cboPerPage.Items.FindByValue(strRecordPerPage).Selected = true;
                }

                cboPerPage.AutoPostBack          = true;
                cboPerPage.SelectedIndexChanged += new System.EventHandler(cboPerPage_SelectedIndexChanged);
                tbc.Controls.Add(cboPerPage);

                lblPager      = new Literal();
                lblPager.Text = "&nbsp;&nbsp;&nbsp;<span class=\"label_h\">รายการ/หน้า</span></TD><TD width='40%' align='right' valign='middle'>";
                tbc.Controls.Add(lblPager);

                if (lblPrev != null)
                {
                    tbc.Controls.Add(lblPrev);
                }
                else if (lbtnPrev != null)
                {
                    tbc.Controls.Add(lbtnPrev);
                }

                lblPager      = new Literal();
                lblPager.Text = "&nbsp;&nbsp;&nbsp;<span class=\"label_h\">หน้าที่: </span>";
                tbc.Controls.Add(lblPager);

                TextBox txtPage = new TextBox();
                txtPage.AutoPostBack = false;
                txtPage.ID           = "txtPage";
                txtPage.Width        = System.Web.UI.WebControls.Unit.Parse("30px");
                txtPage.Attributes.Add("class", "text1");
                txtPage.Style.Add("text-align", "right");
                int nCurrentPage = (GridView1.PageIndex + 1);
                txtPage.Text = nCurrentPage.ToString();//strPageNo;
                txtPage.Attributes.Add("onkeypress", "javascript: return checkKeyCode(event);");
                txtPage.Attributes.Add("onkeyup", "javasctipt: checkInt(this, " + GridView1.PageCount.ToString() + ");");
                tbc.Controls.Add(txtPage);

                lblPager      = new Literal();
                lblPager.Text = "<span class=\"label_h\"> จากทั้งหมด " + GridView1.PageCount.ToString() + "&nbsp;&nbsp;</span>";
                tbc.Controls.Add(lblPager);

                lblPager      = new Literal();
                lblPager.Text = "&nbsp;&nbsp;";
                tbc.Controls.Add(lblPager);

                ImageButton imgGo = new ImageButton();
                imgGo.ID       = "imgGo";
                imgGo.ImageUrl = ((DataSet)Application["xmlconfig"]).Tables["imgGo"].Rows[0]["img"].ToString();
                imgGo.Attributes.Add("title", ((DataSet)Application["xmlconfig"]).Tables["imgGo"].Rows[0]["title"].ToString());
                imgGo.Attributes.Add("onclick", "javascript: return checkPage(" + GridView1.PageCount.ToString() + ",'กรุณาระบุข้อมูลให้ถูกต้อง.|||ctl00$ContentPlaceHolder2$GridView1$ctl01$txtPage');");
                imgGo.Click += new System.Web.UI.ImageClickEventHandler(this.imgGo_Click);
                tbc.Controls.Add(imgGo);

                lblPager      = new Literal();
                lblPager.Text = "&nbsp;&nbsp;&nbsp;";
                tbc.Controls.Add(lblPager);

                if (lblNext != null)
                {
                    tbc.Controls.Add(lblNext);
                }
                else if (lbtnNext != null)
                {
                    tbc.Controls.Add(lbtnNext);
                }

                lblPager      = new Literal();
                lblPager.Text = "</TD></TR></TABLE>";
                tbc.Controls.Add(lblPager);

                #endregion
            }
        }
Esempio n. 49
0
        public void Execute()
        {
            double buttonSize;

            buttonSize = Application.Current.MainPage.Width / (gameSettings.SizeOfGrid + 2);

            mainStack.Children.Add(new Label()
            {
                Text                    = gameSettings.EnemyName + "'s",
                FontSize                = 25,
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                TextColor               = Theme.LabelTextColour,
                BackgroundColor         = Theme.BgColour
            });

            for (double i = -1; i < gameSettings.SizeOfGrid; i++)
            {
                StackLayout stack = new StackLayout();
                stack.Orientation       = StackOrientation.Horizontal;
                stack.HorizontalOptions = LayoutOptions.CenterAndExpand;

                if (i == -1)
                {
                    Label flabel = new Label()
                    {
                        Text = " ",
                        HorizontalOptions       = LayoutOptions.CenterAndExpand,
                        HorizontalTextAlignment = TextAlignment.Center,
                        VerticalTextAlignment   = TextAlignment.Center,
                        TextColor            = Theme.LabelTextColour,
                        HeightRequest        = buttonSize / 2,
                        WidthRequest         = buttonSize / 2,
                        MinimumHeightRequest = buttonSize / 2,
                        MinimumWidthRequest  = buttonSize / 2
                    };
                    stack.Children.Add(flabel);
                    for (int j = 0; j < gameSettings.SizeOfGrid; j++)
                    {
                        Label label = new Label()
                        {
                            Text                    = (j + 1).ToString(),
                            TextColor               = Theme.LabelTextColour,
                            HorizontalOptions       = LayoutOptions.CenterAndExpand,
                            HorizontalTextAlignment = TextAlignment.Center,
                            VerticalTextAlignment   = TextAlignment.Center,
                            HeightRequest           = buttonSize,
                            WidthRequest            = buttonSize,
                            MinimumHeightRequest    = buttonSize,
                            MinimumWidthRequest     = buttonSize
                        };
                        stack.Children.Add(label);
                    }
                }
                else
                {
                    for (double j = -1; j < gameSettings.SizeOfGrid; j++)
                    {
                        if (j == -1)
                        {
                            switch (i)
                            {
                            case 0:
                                stack.Children.Add(MakeLabel("A", buttonSize));
                                break;

                            case 1:
                                stack.Children.Add(MakeLabel("B", buttonSize));
                                break;

                            case 2:
                                stack.Children.Add(MakeLabel("C", buttonSize));
                                break;

                            case 3:
                                stack.Children.Add(MakeLabel("D", buttonSize));
                                break;

                            case 4:
                                stack.Children.Add(MakeLabel("E", buttonSize));
                                break;

                            case 5:
                                stack.Children.Add(MakeLabel("F", buttonSize));
                                break;

                            case 6:
                                stack.Children.Add(MakeLabel("G", buttonSize));
                                break;

                            case 7:
                                stack.Children.Add(MakeLabel("H", buttonSize));
                                break;

                            case 8:
                                stack.Children.Add(MakeLabel("I", buttonSize));
                                break;

                            case 9:
                                stack.Children.Add(MakeLabel("J", buttonSize));
                                break;

                            default:
                                break;
                            }
                        }
                        else
                        {
                            ImageButton button = new ImageButton()
                            {
                                Source               = FileManager.SRCGridButton,
                                ClassId              = i.ToString() + "," + j.ToString(),
                                BorderWidth          = 1,
                                HeightRequest        = buttonSize,
                                WidthRequest         = buttonSize,
                                MinimumHeightRequest = buttonSize,
                                MinimumWidthRequest  = buttonSize,
                                HorizontalOptions    = LayoutOptions.CenterAndExpand
                            };
                            button.Clicked += game.GridButton_Clicked;
                            stack.Children.Add(button);

                            gameSettings.EnemyGrid[(int)i, (int)j] = button;
                        }
                    }
                }
                mainStack.Children.Add(stack);
            }

            buttonSize = buttonSize / 2;

            secStack.Children.Add(new Label()
            {
                Text                    = "Yours",
                FontSize                = 25,
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                TextColor               = Theme.LabelTextColour,
                BackgroundColor         = Theme.BgColour
            });

            for (double i = -1; i < gameSettings.SizeOfGrid; i++)
            {
                StackLayout stack = new StackLayout();
                stack.Orientation       = StackOrientation.Horizontal;
                stack.HorizontalOptions = LayoutOptions.CenterAndExpand;

                if (i == -1)
                {
                    Label flabel = new Label()
                    {
                        Text = " ",
                        HorizontalOptions       = LayoutOptions.CenterAndExpand,
                        HorizontalTextAlignment = TextAlignment.Center,
                        VerticalTextAlignment   = TextAlignment.Center,
                        TextColor            = Theme.LabelTextColour,
                        HeightRequest        = buttonSize,
                        WidthRequest         = buttonSize,
                        MinimumHeightRequest = buttonSize,
                        MinimumWidthRequest  = buttonSize
                    };
                    stack.Children.Add(flabel);
                    for (int j = 0; j < gameSettings.SizeOfGrid; j++)
                    {
                        Label label = new Label()
                        {
                            Text = (j + 1).ToString(),
                            HorizontalOptions       = LayoutOptions.CenterAndExpand,
                            HorizontalTextAlignment = TextAlignment.Center,
                            VerticalTextAlignment   = TextAlignment.Center,
                            TextColor            = Theme.LabelTextColour,
                            HeightRequest        = buttonSize,
                            WidthRequest         = buttonSize,
                            MinimumHeightRequest = buttonSize,
                            MinimumWidthRequest  = buttonSize
                        };
                        stack.Children.Add(label);
                    }
                }
                else
                {
                    for (double j = -1; j < gameSettings.SizeOfGrid; j++)
                    {
                        if (j == -1)
                        {
                            switch (i)
                            {
                            case 0:
                                stack.Children.Add(MakeLabel("A", buttonSize));
                                break;

                            case 1:
                                stack.Children.Add(MakeLabel("B", buttonSize));
                                break;

                            case 2:
                                stack.Children.Add(MakeLabel("C", buttonSize));
                                break;

                            case 3:
                                stack.Children.Add(MakeLabel("D", buttonSize));
                                break;

                            case 4:
                                stack.Children.Add(MakeLabel("E", buttonSize));
                                break;

                            case 5:
                                stack.Children.Add(MakeLabel("F", buttonSize));
                                break;

                            case 6:
                                stack.Children.Add(MakeLabel("G", buttonSize));
                                break;

                            case 7:
                                stack.Children.Add(MakeLabel("H", buttonSize));
                                break;

                            case 8:
                                stack.Children.Add(MakeLabel("I", buttonSize));
                                break;

                            case 9:
                                stack.Children.Add(MakeLabel("J", buttonSize));
                                break;

                            default:
                                break;
                            }
                        }
                        else
                        {
                            if (gameSettings.YourShotCoodinates.Contains(i.ToString() + "," + j.ToString()))
                            {
                                ImageButton button = new ImageButton()
                                {
                                    Source               = FileManager.SRCGridButtonShotGlass,
                                    ClassId              = i.ToString() + "," + j.ToString(),
                                    BorderWidth          = 1,
                                    HeightRequest        = buttonSize,
                                    WidthRequest         = buttonSize,
                                    MinimumHeightRequest = buttonSize,
                                    MinimumWidthRequest  = buttonSize,
                                    HorizontalOptions    = LayoutOptions.CenterAndExpand
                                };

                                stack.Children.Add(button);
                                gameSettings.YourGrid[(int)i, (int)j] = button;
                            }
                            else
                            {
                                ImageButton button = new ImageButton()
                                {
                                    Source               = FileManager.SRCGridButton,
                                    ClassId              = i.ToString() + "," + j.ToString(),
                                    BorderWidth          = 1,
                                    HeightRequest        = buttonSize,
                                    WidthRequest         = buttonSize,
                                    MinimumHeightRequest = buttonSize,
                                    MinimumWidthRequest  = buttonSize,
                                    HorizontalOptions    = LayoutOptions.CenterAndExpand
                                };

                                stack.Children.Add(button);
                                gameSettings.YourGrid[(int)i, (int)j] = button;
                            }
                        }
                    }
                }

                secStack.Children.Add(stack);
            }
        }
Esempio n. 50
0
        /// <summary>
        /// to set the PAge Header,Call  FillBanks() to fill the bank names from the database
        /// call  GetLivelihoodItems() to get the the livlihood Items  from the database
        /// call  BindLivelihoodItems() to Bind the the livlihood Items  from the database
        ///  call  GetBankDetails() to get the the Bank Details  from the database

        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            string Mode = string.Empty;

            if (Request.QueryString["ProjectID"] != null)
            {
                Session["PROJECT_ID"]   = Convert.ToInt32(Request.QueryString["ProjectID"]);
                Session["HH_ID"]        = Convert.ToInt32(Request.QueryString["HHID"]);
                Session["PROJECT_CODE"] = Request.QueryString["ProjectCode"].ToString();
                Mode = Request.QueryString["Mode"].ToString();
            }
            CompSocioEconomyMenu1.HighlightMenu = CompSocioEconomyMenu.MenuValue.Livelihood;
            ViewMasterCopy1.HighlightMenu       = ViewMasterCopy.MenuValue.LivelihoodDetails;

            if (Session["USER_ID"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            if (Session["PROJECT_ID"] == null)
            {
                Response.Redirect("~/UI/Project/ViewProjects.aspx");
            }
            if (Session["HH_ID"] == null)
            {
                Response.Redirect("~/UI/Compensation/PAPList.aspx");
            }
            if (!IsPostBack)
            {
                if (Session["PROJECT_CODE"] != null)
                {
                    Master.PageHeader = Session["PROJECT_CODE"].ToString() + " - Socio-Economic - Livelihood";
                }
                else
                {
                    Response.Redirect("~/UI/Project/ViewProjects.aspx");
                }

                FillBanks();
                GetLivelihoodItems();
                BindLivelihoodItems();
                GetBankDetails();
                txtAccountNo.Attributes.Add("onchange", "setDirtyText();");
                txtAccountName.Attributes.Add("onchange", "setDirtyText();");
                btnSave.Attributes.Add("onclick", " isDirty = 0;");
                btnClear.Attributes.Add("onclick", " isDirty = 0;");
                btnSaveBank.Attributes.Add("onclick", " isDirty = 0;");
                btnClearBank.Attributes.Add("onclick", " isDirty = 0;");
                projectFrozen();
                if (CheckAuthorization.HasUpdatePrivilege(UtilBO.PrivilegeCode.PRIV_SOCIO_ECONOMIC) == false)
                {
                    chkHasBankAccount.Enabled = false;
                    btnSaveBank.Visible       = false;
                    btnClearBank.Visible      = false;
                    btnSave.Visible           = false;
                    btnClear.Visible          = false;
                }
            }
            if (Mode == "Readonly")
            {
                CompSocioEconomyMenu1.Visible = false;
                Label userNameLabel = (Label)Master.FindControl("userNameLabel");
                userNameLabel.Visible = false;
                LinkButton lnkLogout = (LinkButton)Master.FindControl("lnkLogout");
                lnkLogout.Visible = false;
                Menu NavigationMenu = (Menu)Master.FindControl("NavigationMenu");
                NavigationMenu.Visible = false;
                ImageButton imgSearch = (ImageButton)HouseholdSummary1.FindControl("imgSearch");
                imgSearch.Visible         = false;
                chkHasBankAccount.Enabled = false;
                btnSaveBank.Visible       = false;
                btnClearBank.Visible      = false;
                btnSave.Visible           = false;
                btnClear.Visible          = false;
            }
            if (!Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "MasterJS"))
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MasterJS",
                                                            CreateStartupScript());
            }
        }
Esempio n. 51
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.VoiceCall);
            this.callType = this.Intent.GetStringExtra("callType");
            if (friend == null)
            {
                if (this.callType.Equals("incoming"))
                {
                    friend          = new AppCore.User();
                    friend.Jid      = this.Intent.GetStringExtra("userChat");
                    friend.username = LegionUtils.GetUserNameClear(friend.Jid);
                }
                else
                {
                    friend = LegionUtils.getUserson(Intent.GetStringExtra("userChat"));
                }
            }
            App      = App.Instance;
            xmppFace = new XmppFacade();
            App.Xmpp.OnReceiveSessionAccept += (sender, e) =>
            {
                Log.Info("Success connection");
                timer.Interval = 1000;
                timer.Elapsed += OnTimedEvent;
                timer.Enabled  = true;
            };

            Layout       = (RelativeLayout)FindViewById(Resource.Id.layout);
            Bgconnection = (ImageView)FindViewById(Resource.Id.
                                                   bgconnection);
            avatar = (ImageView)FindViewById(Resource.Id.avatarFriend);
            if (friend.Photo != null)
            {
                Bitmap bitmap = xmppFace.Base64ToBitmap(friend.Photo);
                var    d      = new CircleDrawable(bitmap);
                avatar.SetBackgroundDrawable(d);
            }
            TxUserName      = (TextView)FindViewById(Resource.Id.userNameFriend);
            TxUserName.Text = friend.username;
            TxConnection    = (TextView)FindViewById(Resource.Id.time);

            LeaveButton = (ImageButton)FindViewById(Resource.Id.leaveButton);

            // Load native libraries.
            if (!Build.CpuAbi.ToLower().Contains("x86") && !Build.CpuAbi.ToLower().Contains("arm64"))
            {
                Java.Lang.JavaSystem.LoadLibrary("audioprocessing");
                Java.Lang.JavaSystem.LoadLibrary("audioprocessingJNI");
            }
            Java.Lang.JavaSystem.LoadLibrary("opus");
            Java.Lang.JavaSystem.LoadLibrary("opusJNI");
            Java.Lang.JavaSystem.LoadLibrary("vpx");
            Java.Lang.JavaSystem.LoadLibrary("vpxJNI");

            LeaveButton.Click += new EventHandler(LeaveButton_Click);

            Messaging.Log.Debug("VoiceCallActivity adding event handler Xmpp_OnReceiveSessionTerminate");
            //loadXmppConnect(this);
            //App.Instance.Xmpp.OnReceiveSessionTerminate += Xmpp_OnReceiveSessionTerminate;
            //App.Instance.Xmpp.OnReceiveSessionInitiate += Xmpp_OnReceiveSessionInitiate;


            if (!SignallingStarted)
            {
                StartSignalling();
            }

            if (!LocalMediaStarted)
            {
                StartLocalMedia();
            }
        }
Esempio n. 52
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            try
            {
                SetContentView(Resource.Layout.RegionForSearching);


                applyCityFragment = new ApplyCityFragment();
                fragmentManager   = this.FragmentManager;

                InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                searchET                = FindViewById <EditText>(Resource.Id.searchET);
                close_searchBn          = FindViewById <ImageButton>(Resource.Id.close_searchBn);
                activityIndicatorSearch = FindViewById <ProgressBar>(Resource.Id.activityIndicatorSearch);
                search_recyclerView     = FindViewById <RecyclerView>(Resource.Id.search_recyclerView);
                searchLL                = FindViewById <LinearLayout>(Resource.Id.searchLL);
                nothingIV               = FindViewById <ImageView>(Resource.Id.nothingIV);
                searchIV                = FindViewById <ImageView>(Resource.Id.searchIV);
                nothingTV               = FindViewById <TextView>(Resource.Id.nothingTV);
                headerTV                = FindViewById <TextView>(Resource.Id.headerTV);
                your_city_valueTV       = FindViewById <TextView>(Resource.Id.your_city_valueTV);
                recyclerView            = FindViewById <RecyclerView>(Resource.Id.recyclerView);
                layoutManager           = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
                recyclerView.SetLayoutManager(layoutManager);
                back_button        = FindViewById <ImageButton>(Resource.Id.back_button);
                autolocatonBn      = FindViewById <Button>(Resource.Id.autolocatonBn);
                backRelativeLayout = FindViewById <RelativeLayout>(Resource.Id.backRelativeLayout);
                tintLL             = FindViewById <RelativeLayout>(Resource.Id.tintLL);
                noTV              = FindViewById <TextView>(Resource.Id.noTV);
                yesTV             = FindViewById <TextView>(Resource.Id.yesTV);
                activityIndicator = FindViewById <ProgressBar>(Resource.Id.activityIndicator);
                activityIndicator.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply);
                activityIndicatorSearch.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply);
                search_layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
                search_recyclerView.SetLayoutManager(search_layoutManager);
                headerTV.Text = city_coord_for_edit_prefs.GetString("region_name", String.Empty);
                Typeface tf = Typeface.CreateFromAsset(Assets, "Roboto-Regular.ttf");
                headerTV.SetTypeface(tf, TypefaceStyle.Bold);
                autolocatonBn.SetTypeface(tf, TypefaceStyle.Normal);
                searchET.SetTypeface(tf, TypefaceStyle.Normal);
                FindViewById <TextView>(Resource.Id.textView5).SetTypeface(tf, TypefaceStyle.Normal);
                your_city_valueTV.SetTypeface(tf, TypefaceStyle.Normal);
                yesTV.SetTypeface(tf, TypefaceStyle.Normal);
                noTV.SetTypeface(tf, TypefaceStyle.Normal);
                nothingTV.SetTypeface(tf, TypefaceStyle.Normal);

                backRelativeLayout.Click += (s, e) =>
                {
                    OnBackPressed();
                };
                back_button.Click += (s, e) =>
                {
                    OnBackPressed();
                };

                searchET.TextChanged += async(s, e) =>
                {
                    if (!String.IsNullOrEmpty(searchET.Text))
                    {
                        nothingIV.Visibility               = ViewStates.Gone;
                        nothingTV.Visibility               = ViewStates.Gone;
                        searchLL.Visibility                = ViewStates.Visible;
                        close_searchBn.Visibility          = ViewStates.Visible;
                        activityIndicatorSearch.Visibility = ViewStates.Visible;
                        search_recyclerView.Visibility     = ViewStates.Gone;
                        var search_content = await countryMethods.CitySearch(city_coord_for_edit_prefs.GetString("region_id", String.Empty), searchET.Text);

                        if (!search_content.ToLower().Contains("пошло не так".ToLower()) && !search_content.Contains("null"))
                        //try
                        {
                            search_recyclerView.Visibility = ViewStates.Visible;
                            deserialized_search            = JsonConvert.DeserializeObject <List <CitySearch> >(search_content.ToString());
                            List <CitySearch> searchDisplayings = new List <CitySearch>();
                            foreach (var item in deserialized_search)
                            {
                                searchDisplayings.Add(new CitySearch {
                                    id = item.id, city = item.city
                                });
                            }

                            citySearchAdapter = new CitySearchProfileEditAdapter(searchDisplayings, showFragment, this, tf);
                            citySearchAdapter.NotifyDataSetChanged();
                            search_recyclerView.SetAdapter(citySearchAdapter);

                            citySearchAdapter.NotifyDataSetChanged();
                        }
                        //catch
                        else
                        {
                            search_recyclerView.Visibility = ViewStates.Gone;
                            nothingIV.Visibility           = ViewStates.Visible;
                            nothingTV.Visibility           = ViewStates.Visible;
                        }

                        //search_recyclerView.Visibility = ViewStates.Visible;
                        activityIndicatorSearch.Visibility = ViewStates.Gone;
                    }
                    else
                    {
                        searchIV.Visibility       = ViewStates.Visible;
                        close_searchBn.Visibility = ViewStates.Gone;
                        //searchLL.Visibility = ViewStates.Visible;
                        searchLL.Visibility = ViewStates.Gone;
                    }
                };
                close_searchBn.Click += (s, e) =>
                {
                    searchET.Text = null;
                    imm.HideSoftInputFromWindow(searchET.WindowToken, 0);
                    searchLL.Visibility = ViewStates.Gone;
                };

                searchET.EditorAction += (object sender, EditText.EditorActionEventArgs e) =>
                {
                    imm.HideSoftInputFromWindow(searchET.WindowToken, 0);
                };


                activityIndicator.Visibility = ViewStates.Visible;
                var citiesJson = await countryMethods.CityList(city_coord_for_edit_prefs.GetString("region_id", String.Empty));

                activityIndicator.Visibility = ViewStates.Gone;
                var deserialized_cities = JsonConvert.DeserializeObject <List <CitySearch> >(citiesJson);

                var cityForRegAdapter = new CityProfileEditAdapter(deserialized_cities, showFragment, this, tf);
                recyclerView.SetAdapter(cityForRegAdapter);
            }
            catch
            {
                StartActivity(typeof(MainActivity));
            }
        }
    protected void btnBuscar_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton img = (ImageButton)sender;
        GridViewRow row = (GridViewRow)img.Parent.Parent;

        System.Text.StringBuilder sbScript = new System.Text.StringBuilder();

        hidIdCartel.Value     = Server.HtmlDecode(row.Cells[1].Text);
        hidIdModelo.Value     = Server.HtmlDecode(row.Cells[2].Text);
        hidDigitos.Value      = Server.HtmlDecode(row.Cells[3].Text);
        hidNom.Value          = Server.HtmlDecode(row.Cells[4].Text) + " DE " + Server.HtmlDecode(row.Cells[5].Text);
        hidCartelModelo.Value = Server.HtmlDecode(row.Cells[4].Text);
        hidNroDigitos.Value   = Server.HtmlDecode(row.Cells[5].Text);

        if (CARTEL_MODELO_BL.ExistePlantilla(Convert.ToInt32(hidIdCartel.Value),
                                             Convert.ToInt32(hidIdModelo.Value),
                                             Convert.ToInt32(hidDigitos.Value)) == true)
        {
            CARTEL_MODELO_BE = CARTEL_MODELO_BL.ObtenerPorID1(Convert.ToInt32(hidIdCartel.Value),
                                                              Convert.ToInt32(hidIdModelo.Value),
                                                              Convert.ToInt32(hidDigitos.Value));

            if (CARTEL_MODELO_BE != null)
            {
                lblCartel.Text    = CARTEL_MODELO_BE.DESCRIPCION.ToString().Trim();
                lblDigitos.Text   = CARTEL_MODELO_BE.NRODIGITOS.ToString().Trim();
                lblPlantilla.Text = CARTEL_MODELO_BE.NOM_PLANTILLA.ToString().Trim();

                grvCampos.DataSource = CARTEL_MODELO_BE.CAMPOS;
                grvCampos.DataBind();

                sbScript.AppendFormat("document.getElementById('{0}').style.visibility='visible';", btnVerPlantilla.ClientID);

                pnlBtnConfigurar.Visible  = false;
                pnlDialgPlantilla.Visible = false;
                pnlDetalle.Visible        = true;
            }
            else
            {
                Util.RegisterAsyncAlert(upnlBusqueda, "__Alerta__", System.Configuration.ConfigurationManager.AppSettings["MCP_NEP"] + " " + Convert.ToString(hidNom.Value));

                sbScript.AppendFormat("document.getElementById('{0}').style.visibility='hidden';", btnVerPlantilla.ClientID);

                pnlBtnConfigurar.Visible  = false;
                pnlDialgPlantilla.Visible = false;
                pnlDetalle.Visible        = false;
            }

            upnlDetalleConf.Update();
            upnlConfigurar.Update();
        }
        else
        {
            upnlDetalleConf.Update();
            upnlConfigurar.Update();
            upnlImportador.Update();

            Util.RegisterAsyncAlert(upnlBusqueda, "__Alerta__", System.Configuration.ConfigurationManager.AppSettings["MCP_NEP"] + " " + Convert.ToString(hidNom.Value));

            pnlBtnConfigurar.Visible  = true;
            pnlDialgPlantilla.Visible = false;
            pnlDetalle.Visible        = false;
        }

        lblCartelPrint.Text = hidNom.Value;

        Util.RegisterScript(upnlConfigurar, "__DesabilitaCtrol__", sbScript.ToString());
    }
Esempio n. 54
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.NewBigDays);

            Geneticist.Splice(this);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetActionBar(toolbar);
            ActionBar.Title = "Edit Big Days";

            _cameraHelpers = new CameraHelpers(this);
            MainActivity._BDDB.CheckRepeats();
            _Edit = Intent.GetBooleanExtra("Edit", false);

            _ImageArea = FindViewById <ImageView>(Resource.Id.imageArea);
            _ImageArea.SetScaleType(ImageView.ScaleType.CenterCrop);


            _UiTimeEdit        = FindViewById <EditText>(Resource.Id.timeEdit);
            _UiTimeEdit.Click += (o, e) => ShowDialog(TIME_DIALOG_ID);

            _UiDateEdit        = FindViewById <EditText>(Resource.Id.dateEdit);
            _UiDateEdit.Click += (o, e) => { ShowDialog(DATE_DIALOG_ID); };

            _UiEditRepeat        = FindViewById <EditText>(Resource.Id.editRepeat);
            _UiEditRepeat.Click += (sender, e) =>
            {
                var IntentRepeatSelect = new Intent(this, typeof(RepeatSelect));
                IntentRepeatSelect.PutExtra("Num", _RepeatNum);
                StartActivityForResult(IntentRepeatSelect, (int)RequestCode.Repeat);
            };

            _ImgPath         = "img17.jpg";
            _ImageStorageNum = LocationPicture.ResourcesImage;

            // Get the current time
            DateTime now = DateTime.Now;

            now     = now.AddHours(1);
            hour    = now.Hour;
            minute  = DateTime.Now.Minute;
            seconds = DateTime.Now.Second;

            // get the current date
            date = DateTime.Today;

            _UiName = FindViewById <EditText>(Resource.Id.BigDayName);

            if (_Edit)
            {
                _ID = Intent.GetIntExtra("ID", 0);
                if (_ID != 0)
                {
                    _Item = MainActivity._BDDB.SelectItem(_ID);

                    _UiName.Text = _Item._Name;

                    // Get the current time
                    hour   = _Item._EndDate.Hour;
                    minute = _Item._EndDate.Minute;

                    // get the current date
                    date = _Item._EndDate;

                    _RepeatNum         = _Item._Repeat;
                    _Notification      = _Item._Notification;
                    _UiEditRepeat.Text = _RepeatStrs[_RepeatNum].ToString();

                    _AlertStr = _AlertStrOld = _Item._Alerts;

                    _ImageStorageNum = (LocationPicture)_Item._ImageStorage;
                    _ImgPath         = _Item._Image;
                    _ImageBase64     = _Item.ImageBase64;

                    foreach (var i in MainActivity._BDitems)
                    {
                        if (i._ID == _ID)
                        {
                            _ImageArea.SetImageBitmap(i._BigImg);
                        }
                    }
                }
            }
            else
            {
                Resources res     = Resources;
                int       imageID = res.GetIdentifier(_ImgPath.Replace(".jpg", ""), "drawable", PackageName);
                Drawable  def     = new BitmapDrawable(BitmapHelpers.DecodeSampledBitmapFromResource(res, imageID, (int)MainActivity._DisplayWidth, (int)MainActivity._DisplayWidth, this));
                _ImageArea.SetImageDrawable(def);
            }

            _NM = (NotificationManager)GetSystemService(NotificationService);

            _UiAlerts        = FindViewById <Button>(Resource.Id.Alerts);
            _UiAlerts.Click += (sender, e) =>
            {
                string[] alerts = _AlertStr.Split('#');
                int      i      = 0;
                foreach (var a in alerts)
                {
                    string[] alertStr = a.Split(';');
                    garbage[i] = 0;
                    if (alertStr[1] == "1")
                    {
                        garbage[i] = Convert.ToInt32(alertStr[2]);
                    }
                    i++;
                }
                var IntentAlerts = new Intent(this, typeof(Alerts));
                IntentAlerts.PutExtra("Alert", _AlertStr);
                StartActivityForResult(IntentAlerts, (int)RequestCode.Alerts);
            };

            // Display the current date
            UpdateDisplayTime();

            // display the current date (this method is below)
            UpdateDisplayDate();

            _UiSeveOrEdit        = FindViewById <ImageButton>(Resource.Id.SeveOrEdit);
            _UiSeveOrEdit.Click += (sender, e) =>
            {
                if (_Edit)
                {
                    _Item._ID   = _ID;
                    _Item._Name = _UiName.Text.ToString();
                    DateTime d = Convert.ToDateTime(_UiDateEdit.Text.ToString());
                    DateTime t = Convert.ToDateTime(_UiTimeEdit.Text.ToString());
                    _Item._EndDate      = new DateTime(d.Year, d.Month, d.Day, t.Hour, t.Minute, t.Second);
                    _Item._Image        = _ImgPath;
                    _Item._ImageStorage = (int)_ImageStorageNum;
                    _Item._Repeat       = _RepeatNum;
                    _Item.ImageBase64   = _ImageBase64;
                    int garbageMain = _Notification;

                    _Item._Notification = new System.Random().Next(0, 999999);

                    AlarmHelpers.UpdateAlarm(this, _Item, garbageMain);

                    _Item._Alerts = _AlertStr;
                    string[]            alertOld = _AlertStrOld.Split('#');
                    NotificationManager NM       = (NotificationManager)GetSystemService(Context.NotificationService);
                    foreach (var ao in alertOld)
                    {
                        string[] ao2 = ao.Split(';');
                        if (ao2[1] == "1")
                        {
                            int ID = Convert.ToInt32(ao2[2]);
                            NM.Cancel(ID);
                        }
                    }
                    string[] alerts = _AlertStr.Split('#');
                    int      i      = 0;
                    foreach (var a in alerts)
                    {
                        string[] alertStr = a.Split(';');
                        if (alertStr[1] == "1")
                        {
                            int ID = Convert.ToInt32(alertStr[2]);
                            AlarmHelpers.UpdateAlertsAlarm(this, _Item, ID, alertStr, garbage[i]);
                        }

                        i++;
                    }
                    MainActivity._BDDB.Update(_Item);
                    Intent ParentIntent = new Intent(this, typeof(MainActivity));
                    SetResult(Result.Ok, ParentIntent);
                    Finish();
                }
                else
                {
                    _Item       = new BigDaysItemModel();
                    _Item._Name = _UiName.Text.ToString();
                    DateTime d = Convert.ToDateTime(_UiDateEdit.Text.ToString());
                    DateTime t = Convert.ToDateTime(_UiTimeEdit.Text.ToString());
                    _Item._EndDate      = new DateTime(d.Year, d.Month, d.Day, t.Hour, t.Minute, t.Second);
                    _Item._Image        = _ImgPath;
                    _Item._ImageStorage = (int)_ImageStorageNum;
                    _Item._Repeat       = _RepeatNum;
                    _Item.ImageBase64   = _ImageBase64;


                    _Item._Notification = new System.Random().Next(0, 999999);
                    _Item._ID           = MainActivity._BDDB.GetLastID() + 1;

                    AlarmHelpers.SetAlarm(this, _Item);

                    _Item._Alerts = _AlertStr;
                    string[] alerts = _AlertStr.Split('#');
                    foreach (var a in alerts)
                    {
                        string[] alertStr = a.Split(';');
                        if (alertStr[1] == "1")
                        {
                            int ID = Convert.ToInt32(alertStr[2]);
                            _Item._ID = MainActivity._BDDB.GetLastID() + 1;

                            AlarmHelpers.SetAlertsAlarm(this, _Item, ID, alertStr);
                        }
                    }

                    MainActivity._BDDB.Insert(_Item);

                    List <BigDaysItemModel> items = MainActivity._BDDB.SelectBDItems();
                    if (items.Count == 1)
                    {
                        MainActivity._BDDB.SetActive(items[0]._ID);
                    }

                    Intent ParentIntent = new Intent(this, typeof(ListActivity));
                    SetResult(Result.Ok, ParentIntent);
                    Finish();
                }
            };
            _UiCancelOrDelete = FindViewById <ImageButton>(Resource.Id.CancelOrDelete);
            if (_Edit)
            {
                _UiCancelOrDelete.SetImageResource(Resource.Drawable.ic_action_discard);
            }

            _UiCancelOrDelete.Click += (sender, e) =>
            {
                if (_Edit)
                {
                    AlarmHelpers.RemoveAlarm(this, _Notification);

                    foreach (var g in garbage)
                    {
                        if (g != 0)
                        {
                            Intent        IntentNot          = new Intent(this, typeof(NotificationView));
                            PendingIntent mAlarmSenderCansel = PendingIntent.GetBroadcast(this, g, IntentNot, PendingIntentFlags.UpdateCurrent);
                            AlarmManager  am = (AlarmManager)GetSystemService(Context.AlarmService);
                            am.Cancel(mAlarmSenderCansel);
                        }
                    }

                    if (_ID != 0)
                    {
                        MainActivity._BDDB.Delete(_ID);
                    }

                    for (int i = 0; i < MainActivity._BDitems.Count; i++)
                    {
                        if (MainActivity._BDitems[i]._ID == _ID)
                        {
                            MainActivity._BDitems.RemoveAt(i);
                        }
                    }


                    List <BigDaysItemModel> items = MainActivity._BDDB.SelectBDItems();
                    if (items.Count > 0)
                    {
                        MainActivity._BDDB.SetActive(items[0]._ID);
                    }

                    Intent ParentIntent = new Intent(this, typeof(ListActivity));
                    SetResult(Result.Ok, ParentIntent);
                    Finish();
                }
                else
                {
                    Intent ParentIntent = new Intent(this, typeof(ListActivity));
                    SetResult(Result.Canceled, ParentIntent);
                    Finish();
                }
            };
        }
Esempio n. 55
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            AllDataListIrrVerbsSystem.Clear();

            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "be", sysFORM2 = "was / were", sysFORM3 = "been", sysTRANSL = "быть"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "become", sysFORM2 = "became", sysFORM3 = "become", sysTRANSL = "становиться"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "begin", sysFORM2 = "began", sysFORM3 = "begun", sysTRANSL = "начинать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "blow", sysFORM2 = "blew", sysFORM3 = "blown", sysTRANSL = "дуть"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "break", sysFORM2 = "broke", sysFORM3 = "broken", sysTRANSL = "ломать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "bring", sysFORM2 = "brought", sysFORM3 = "brought", sysTRANSL = "приносить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "build", sysFORM2 = "built", sysFORM3 = "built", sysTRANSL = "строить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "buy", sysFORM2 = "bought", sysFORM3 = "bought", sysTRANSL = "покупать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "catch", sysFORM2 = "caught", sysFORM3 = "caught", sysTRANSL = "ловить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "choose", sysFORM2 = "chose", sysFORM3 = "chosen", sysTRANSL = "выбирать"
            });
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "come", sysFORM2 = "came", sysFORM3 = "come", sysTRANSL = "приходить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "cost", sysFORM2 = "cost", sysFORM3 = "cost", sysTRANSL = "стоить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "cut", sysFORM2 = "cut", sysFORM3 = "cut", sysTRANSL = "резать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "do", sysFORM2 = "did", sysFORM3 = "done", sysTRANSL = "делать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "draw", sysFORM2 = "drew", sysFORM3 = "drawn", sysTRANSL = "чертить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "dream", sysFORM2 = "dreamt", sysFORM3 = "dreamt", sysTRANSL = "мечтать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "drink", sysFORM2 = "drank", sysFORM3 = "drunk", sysTRANSL = "пить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "drive", sysFORM2 = "drove", sysFORM3 = "driven", sysTRANSL = "водить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "eat", sysFORM2 = "ate", sysFORM3 = "eaten", sysTRANSL = "есть"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "fall", sysFORM2 = "fell", sysFORM3 = "fallen", sysTRANSL = "падать"
            });
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "feel", sysFORM2 = "felt", sysFORM3 = "felt", sysTRANSL = "чувствовать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "find", sysFORM2 = "found", sysFORM3 = "found", sysTRANSL = "находить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "fly", sysFORM2 = "flew", sysFORM3 = "flown", sysTRANSL = "летать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "forget", sysFORM2 = "forgot", sysFORM3 = "forgotten", sysTRANSL = "забывать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "get", sysFORM2 = "got", sysFORM3 = "got", sysTRANSL = "получать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "give", sysFORM2 = "gave", sysFORM3 = "given", sysTRANSL = "давать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "go", sysFORM2 = "went", sysFORM3 = "gone", sysTRANSL = "идти"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "grow", sysFORM2 = "grew", sysFORM3 = "grown", sysTRANSL = "расти"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "have", sysFORM2 = "had", sysFORM3 = "had", sysTRANSL = "иметь"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "hear", sysFORM2 = "heard", sysFORM3 = "heard", sysTRANSL = "слышать"
            });
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "hit", sysFORM2 = "hit", sysFORM3 = "hit", sysTRANSL = "ударить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "hold", sysFORM2 = "held", sysFORM3 = "held", sysTRANSL = "держать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "hurt", sysFORM2 = "hurt", sysFORM3 = "hurt", sysTRANSL = "ранить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "keep", sysFORM2 = "kept", sysFORM3 = "kept", sysTRANSL = "удерживать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "know", sysFORM2 = "knew", sysFORM3 = "known", sysTRANSL = "знать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "learn", sysFORM2 = "learnt", sysFORM3 = "learnt", sysTRANSL = "учить что-нибудь"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "leave", sysFORM2 = "left", sysFORM3 = "left", sysTRANSL = "покидать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "let", sysFORM2 = "let", sysFORM3 = "let", sysTRANSL = "позволять"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "light", sysFORM2 = "lit", sysFORM3 = "lit", sysTRANSL = "освещать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "lose", sysFORM2 = "lost", sysFORM3 = "lost", sysTRANSL = "терять"
            });
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "make", sysFORM2 = "made", sysFORM3 = "made", sysTRANSL = "изготавливать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "mean", sysFORM2 = "meant", sysFORM3 = "meant", sysTRANSL = "значить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "meet", sysFORM2 = "met", sysFORM3 = "met", sysTRANSL = "встречать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "pay", sysFORM2 = "paid", sysFORM3 = "paid", sysTRANSL = "платить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "put", sysFORM2 = "put", sysFORM3 = "put", sysTRANSL = "класть"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "read", sysFORM2 = "read", sysFORM3 = "read", sysTRANSL = "читать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "ride", sysFORM2 = "rode", sysFORM3 = "ridden", sysTRANSL = "ехать верхом"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "ring", sysFORM2 = "rang", sysFORM3 = "rung", sysTRANSL = "звонить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "rise", sysFORM2 = "rose", sysFORM3 = "risen", sysTRANSL = "подниматься"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "run", sysFORM2 = "ran", sysFORM3 = "run", sysTRANSL = "бежать"
            });
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "say", sysFORM2 = "said", sysFORM3 = "said", sysTRANSL = "сказать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "see", sysFORM2 = "saw", sysFORM3 = "seen", sysTRANSL = "видеть"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "sell", sysFORM2 = "sold", sysFORM3 = "sold", sysTRANSL = "продавать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "send", sysFORM2 = "sent", sysFORM3 = "sent", sysTRANSL = "посылать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "shake", sysFORM2 = "shook", sysFORM3 = "shaken", sysTRANSL = "трясти"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "shut", sysFORM2 = "shut", sysFORM3 = "shut", sysTRANSL = "закрывать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "sing", sysFORM2 = "sang", sysFORM3 = "sung", sysTRANSL = "петь"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "sit", sysFORM2 = "sat", sysFORM3 = "sat", sysTRANSL = "сидеть"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "sleep", sysFORM2 = "slept", sysFORM3 = "slept", sysTRANSL = "спать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "speak", sysFORM2 = "spoke", sysFORM3 = "spoken", sysTRANSL = "говорить"
            });
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "spend", sysFORM2 = "spent", sysFORM3 = "spent", sysTRANSL = "тратить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "stand", sysFORM2 = "stood", sysFORM3 = "stood", sysTRANSL = "стоять"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "steal", sysFORM2 = "stole", sysFORM3 = "stolen", sysTRANSL = "украсть"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "swim", sysFORM2 = "swam", sysFORM3 = "swum", sysTRANSL = "плавать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "take", sysFORM2 = "took", sysFORM3 = "taken", sysTRANSL = "брать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "teach", sysFORM2 = "taught", sysFORM3 = "taught", sysTRANSL = "учить кого-нибудь"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "tell", sysFORM2 = "told", sysFORM3 = "told", sysTRANSL = "рассказать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "think", sysFORM2 = "thought", sysFORM3 = "thought", sysTRANSL = "думать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "throw", sysFORM2 = "threw", sysFORM3 = "thrown", sysTRANSL = "бросать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "understand", sysFORM2 = "understood", sysFORM3 = "understood", sysTRANSL = "понимать"
            });
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "wake", sysFORM2 = "woke", sysFORM3 = "woken", sysTRANSL = "просыпаться"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "wear", sysFORM2 = "wore", sysFORM3 = "worn", sysTRANSL = "носить"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "win", sysFORM2 = "won", sysFORM3 = "won", sysTRANSL = "побеждать"
            });
            AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem {
                sysFORM1 = "write", sysFORM2 = "wrote", sysFORM3 = "written", sysTRANSL = "писать"
            });
            //AllDataListIrrVerbsSystem.Add(new FillingListIrrVerbsSystem { sysFORM1 = "", sysFORM2 = "", sysFORM3 = "", sysTRANSL = "" });

            //clearing
            form1AL.Clear();
            form2AL.Clear();
            form3AL.Clear();
            translationAL.Clear();

            foreach (var i in AllDataListIrrVerbsSystem)
            {
                form1AL.Add(i.sysFORM1);
                form2AL.Add(i.sysFORM2);
                form3AL.Add(i.sysFORM3);
                translationAL.Add(i.sysTRANSL);
            }

            //Making SearchIndicator false:
            SearchFragmentShow.textToSearch = null;

            //Create the database..
            ORM.DBRepository dbr = new ORM.DBRepository();
            var result           = dbr.CreateDB();

            //To Create the Table
            ORM.DBRepository dbr1 = new ORM.DBRepository();
            var result1           = dbr.CreateTable();

            //Creating irrVerbsArchive table:
            new ORM.DBCards().CreateTableIrrVerbsARCHIVE();

            //Creating irrVerbsUSER table:
            new ORM.DBCards().CreateTableIrrVerbsUSERS();

            ImageButton slovari = FindViewById <ImageButton>(Resource.Id.slovari);

            slovari.Click += delegate
            {
                slovari.SetBackgroundResource(Resource.Drawable.slovariPODSV);
                StartActivity(new Intent(this, typeof(dicListActivity)));
            };

            ImageButton nepravelnieglagoli = FindViewById <ImageButton>(Resource.Id.nepravelnieglagoli);

            nepravelnieglagoli.Click += delegate
            {
                nepravelnieglagoli.SetBackgroundResource(Resource.Drawable.nepravelnieGlagoliPODSV);
                StartActivity(new Intent(this, typeof(NGActivity)));
            };

            ImageButton arhiv = FindViewById <ImageButton>(Resource.Id.arhiv);

            arhiv.Click += delegate
            {
                arhiv.SetBackgroundResource(Resource.Drawable.arhivPODSV);
                StartActivity(new Intent(this, typeof(ARCHIVEActivity)));
            };
        }
Esempio n. 56
0
        void dlRedirects_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            ImageButton btnDelete = e.Item.FindControl("btnDelete") as ImageButton;

            UIHelper.AddConfirmationDialog(btnDelete, Resource.RedirectDeleteWarning);
        }
Esempio n. 57
0
        /// <summary>
        /// </summary>
        public MultiplayerMap(MultiplayerScreen screen, MultiplayerGame game) : base(new ScalableVector2(682, 86), new ScalableVector2(682, 86))
        {
            Screen = screen;
            Game   = game;
            Size   = new ScalableVector2(650, 86);
            Image  = UserInterface.MapPanel;

            DownloadButton = new ImageButton(UserInterface.BlankBox, OnDownloadButtonClicked)
            {
                Parent    = this,
                Alignment = Alignment.MidCenter,
                Size      = new ScalableVector2(Width - 4, Height - 4),
                Alpha     = 0
            };

            Background = new Sprite
            {
                Parent    = this,
                Size      = new ScalableVector2(Height * 1.70f, Height - 4),
                Alignment = Alignment.MidLeft,
                X         = 2,
                Image     = MapManager.Selected.Value == BackgroundHelper.Map && MapManager.Selected.Value.Md5Checksum == Game.MapMd5 ? BackgroundHelper.RawTexture: UserInterface.MenuBackground,
                Alpha     = MapManager.Selected.Value == BackgroundHelper.Map && MapManager.Selected.Value.Md5Checksum == Game.MapMd5 ? 1 : 0
            };

            AddContainedDrawable(Background);

            var diffName = GetDifficultyName();

            ArtistTitle = new SpriteTextBitmap(FontsBitmap.GothamRegular, game.Map.Replace($"[{diffName}]", ""))
            {
                Parent   = this,
                X        = Background.X + Background.Width + 16,
                Y        = 12,
                FontSize = 16
            };

            AddContainedDrawable(ArtistTitle);

            Mode = new SpriteTextBitmap(FontsBitmap.GothamRegular, "[" + ModeHelper.ToShortHand((GameMode)game.GameMode) + "]")
            {
                Parent   = this,
                X        = ArtistTitle.X,
                Y        = ArtistTitle.Y + ArtistTitle.Height + 8,
                FontSize = 14
            };

            AddContainedDrawable(Mode);

            DifficultyRating = new SpriteTextBitmap(FontsBitmap.GothamRegular, $"{game.DifficultyRating:0.00}")
            {
                Parent   = this,
                X        = Mode.X + Mode.Width + 8,
                Y        = Mode.Y,
                FontSize = 14,
                Tint     = ColorHelper.DifficultyToColor((float)game.DifficultyRating)
            };

            AddContainedDrawable(DifficultyRating);

            DifficultyName = new SpriteTextBitmap(FontsBitmap.GothamRegular, " - \"" + diffName + "\"")
            {
                Parent   = this,
                X        = DifficultyRating.X + DifficultyRating.Width + 2,
                Y        = Mode.Y,
                FontSize = 14,
            };

            AddContainedDrawable(DifficultyName);

            Creator = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Mods: None")
            {
                Parent   = this,
                X        = Mode.X,
                Y        = DifficultyRating.Y + DifficultyRating.Height + 8,
                FontSize = DifficultyRating.FontSize
            };

            AddContainedDrawable(Creator);

            BackgroundHelper.Loaded += OnBackgroundLoaded;
            OnlineManager.Client.OnGameMapChanged       += OnGameMapChanged;
            OnlineManager.Client.OnChangedModifiers     += OnChangedModifiers;
            OnlineManager.Client.OnGameHostSelectingMap += OnGameHostSelectingMap;
            ModManager.ModsChanged += OnModsChanged;

            BackgroundHelper.Load(MapManager.Selected.Value);
            UpdateContent();
        }
Esempio n. 58
0
 private bool IsCellEmpty(ImageButton CellAt)
 {
     return(CellAt.ImageUrl == "../Images/tranBg.png");
 }
Esempio n. 59
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            this.AlertNone(lblMsg);
            ProductProvider productProvider = new ProductProvider();

            AjaxControlToolkit.ComboBox ddlProductValidation = (AjaxControlToolkit.ComboBox)UC_ProductSearch1.FindControl("ddlProduct");
            string measurementUnit = productProvider.GetMeasurementUnit(ddlProductValidation.SelectedValue.Toint());

            if (ddlProductValidation.SelectedValue == "")
            {
                MessageHelper.ShowAlertMessage("Select Product!");
                lblMsg.Focus();
                return;
            }
            List <RequisitionDetailProvider> purchaseLedgerDetailsProviderList = new List <RequisitionDetailProvider>();

            foreach (GridViewRow row in gvRequisition.Rows)
            {
                RequisitionDetailProvider obj = new RequisitionDetailProvider();

                HiddenField hfRowProductID    = (HiddenField)row.FindControl("hfProductID");
                Label       lblProductName    = (Label)row.FindControl("lblProduct");
                TextBox     txtRequirement    = (TextBox)row.FindControl("txtRequirement");
                TextBox     txtUnit           = (TextBox)row.FindControl("txtUnit");
                TextBox     txtMonthlyConsume = (TextBox)row.FindControl("txtMonthlyConsume");
                TextBox     txtPresentStock   = (TextBox)row.FindControl("txtPresentStock");
                TextBox     txtRemarks        = (TextBox)row.FindControl("txtRemarks");
                Label       lblTotalAmount    = (Label)row.FindControl("lblTotalAmount");
                ImageButton btnAddOrDelete    = (ImageButton)row.FindControl("btnDeleteSelectedRowLSE");

                if (hfRowProductID.Value == ddlProductValidation.SelectedValue)
                {
                    MessageHelper.ShowAlertMessage("This product already exists!");
                    return;
                }
                if (txtRequirement.Text.ToDecimal() <= 0)
                {
                    MessageHelper.ShowAlertMessage("Enter Quantity!");
                    return;
                }
                obj.ProductID           = hfRowProductID.Value.Toint();
                obj.ProductName         = lblProductName.Text.ToString();
                obj.RequiredQuantity    = txtRequirement.Text.ToDecimal();
                obj.MeasurementUnitName = txtUnit.Text.ToString();
                obj.MonthlyConsumeQty   = txtMonthlyConsume.Text.ToDecimal();
                obj.PresentStock        = txtPresentStock.Text.ToDecimal();
                obj.Remarks             = txtRemarks.Text.ToString();

                purchaseLedgerDetailsProviderList.Add(obj);
            }
            AjaxControlToolkit.ComboBox ddlProduct = (AjaxControlToolkit.ComboBox)UC_ProductSearch1.FindControl("ddlProduct");
            string productName = ddlProduct.SelectedItem.Text;
            int    productID   = ddlProduct.SelectedValue.Toint();

            RequisitionDetailProvider obj2 = new RequisitionDetailProvider();

            obj2.ProductID           = productID;
            obj2.ProductName         = productName;
            obj2.MeasurementUnitName = measurementUnit;
            obj2.PresentStock        = productProvider.GetPresentStock(obj2.ProductID);
            purchaseLedgerDetailsProviderList.Add(obj2);

            if (!divGridForLSE.Visible)
            {
                divGridForLSE.Visible = true;
            }
            gvRequisition.DataSource = purchaseLedgerDetailsProviderList;
            gvRequisition.DataBind();
            ddlRequisitionDivision.Enabled = false;
            RadioButtonList rbProductType = (RadioButtonList)UC_ProductSearch1.FindControl("rbProductType");

            rbProductType.Enabled = false;
        }
Esempio n. 60
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            View view = inflater.Inflate(Resource.Layout.audio_player_layout, container, false);

            // SetStyle(Convert.ToInt32(Android.App.DialogFragmentStyle.Normal), Resource.Style.FullScreenDialogStyle);
            LinearLayout linear_Layout = view.FindViewById <LinearLayout>(Resource.Id.linearLayout1);

            play          = view.FindViewById <ImageView>(Resource.Id.play2btn);
            stop          = view.FindViewById <ImageView>(Resource.Id.pause1btn);
            download      = view.FindViewById <ImageView>(Resource.Id.downbtn);
            seekbar       = view.FindViewById <SeekBar>(Resource.Id.seekBar);
            path          = Arguments.GetString("Path") ?? string.Empty;
            cancel_Button = view.FindViewById <ImageButton>(Resource.Id.imageButton1);

            // audioManager = (AudioManager)Activity.GetSystemService(AudioService);

            stop.Visibility = ViewStates.Invisible;
            play.Visibility = ViewStates.Invisible;

            cancel_Button.Click += delegate
            {
                Activity.OnBackPressed();
                player.Stop();
            };

            //play.Click += OnPlayClick;
            //pause.Click += OnPauseClick;
            //stop.Click += OnStopClick;

            play.Click += delegate
            {
                //  play.SetImageResource(Resource.Drawable.stop2);



                // StartPlayerAsync(path);

                player = new MediaPlayer();
                player.SetDataSource(path);
                player.Prepare();
                player.Start();
                run();
            };



            stop.Click += Stop_Click;

            download.Click += delegate
            {
                play.Visibility = ViewStates.Visible;
                stop.Visibility = ViewStates.Visible;

                Download_Click();

                //player.Pause();



                //seekbar.Max = player.Duration;

                //player.SeekTo(seekbar.);
            };

            return(view);
        }