void BtnDetails_Click(object sender, EventArgs e)
        {
            _spl = _lsObjs[(int)((Button)sender).Tag];
            showData mshowData = new showData(_spl);

            common_functions.npcc_show_fragment(_currentContext, mFragmentContainer, mshowData, _fragment);
        }
Esempio n. 2
0
 /// <summary>
 /// Relinks the elements.
 /// </summary>
 protected void RelinkElements()
 {
     Vendors.EstablishLink(this);
     Filaments.EstablishLink(this);
     Spools.EstablishLink(this);
     Inventory.EstablishLink(this);
     RelinkItems(PrintJobs);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 private void Initialize()
 {
     if (!PrePopulated && PrePopulating)
     {
         Filaments.Initialize();
         Vendors.Initialize();
         Spools.Initialize();
         PrePopulated = true;
     }
 }
Esempio n. 4
0
 public showData(Spools spl)
 {
     _spl = spl;
 }
Esempio n. 5
0
 public FillWeldLog(Spools spl)
 {
     _spl = spl;
 }
        //BIND DATA TO VIEWS
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            _spl = _lsObjs[position];
            MyViewHolder h = holder as MyViewHolder;

            h.lblcSpoolNo.Text       = "Spool: " + _spl.cSpoolNo;
            h.lblcSpoolSize.Text     = "Size: " + _spl.cSpoolSize;
            h.lblcSpoolMaterial.Text = "Material: " + _spl.cSpoolMaterial;
            h.lbliProjNo.Text        = "Project: " + _spl.iProjNo.ToString();
            h.lblcISO.Text           = "ISO: " + _spl.cISO;
            h.btnDetails.Tag         = position;
            h.btnDetails.Click      += BtnDetails_Click;
            h.btnAssignment.Tag      = position;

            ImageService.Instance
            .LoadUrl(_spl.icon)
            .LoadingPlaceholder("loadingimg", FFImageLoading.Work.ImageSource.CompiledResource)
            .ErrorPlaceholder("notfound", FFImageLoading.Work.ImageSource.CompiledResource)
            .Transform(new CircleTransformation())
            .IntoAsync(h.imageView);
            h.textViewOptions.SetOnClickListener(new ExtraMenuActions(_currentContext, _fragment, mFragmentContainer, _spl.iProjectId, _spl.cTransmittal, _spl.iDrwgSrl));

            DBRepository dBRepository = new DBRepository();
            UserInfo     user         = dBRepository.GetUserInfo();

            switch (user.group)
            {
            case "Foreman":
                switch (_assignment_Type)
                {
                case inf_assignment_type.Pending:
                    h.btnAssignment.Text   = "Assign";
                    h.btnAssignment.Click += BtnAssign_Click;
                    break;

                case inf_assignment_type.UnderFabrication:
                    h.btnAssignment.Text   = "Re-Assign";
                    h.btnAssignment.Click += BtnAssign_Click;
                    break;

                case inf_assignment_type.UnderWelding:
                    h.btnAssignment.Visibility = ViewStates.Gone;
                    break;

                case inf_assignment_type.Completed:
                    h.btnAssignment.Visibility = ViewStates.Gone;
                    break;
                }
                break;

            case "Fabricator":
                h.btnAssignment.Text   = "Complete";
                h.btnAssignment.Click += BtnAssign_Click;
                break;

            case "Welder":
                h.btnAssignment.Text   = "Fill Weld Log";
                h.btnAssignment.Click += BtnAssign_Click;
                break;
            }
        }
        void BtnAssign_Click(object sender, EventArgs e)
        {
            DBRepository dBRepository = new DBRepository();
            UserInfo     user         = dBRepository.GetUserInfo();

            switch (user.group)
            {
            case "Foreman":
                _spl = _lsObjs[(int)((Button)sender).Tag];
                var dialog = new Assign(_spl, _ins, (int)((Button)sender).Tag);
                dialog.Show(_currentContext.FragmentManager, "Assign");

                break;

            case "Fabricator":
                _spl = _lsObjs[(int)((Button)sender).Tag];
                //set alert for executing the task
                Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(_currentContext);
                alert.SetTitle("Confirm Complete");
                alert.SetMessage("Are you sure you want to complete this task.");
                alert.SetPositiveButton("Yes", (senderAlert, args) => {
                    string url = "https://webapps.npcc.ae/ApplicationWebServices/api/paperless/FabricatorComplete";

                    inf_assignment objAssignment = new inf_assignment();
                    objAssignment.iAssignmentId  = _spl.iAssignmentId;

                    Task.Run(async() => {
                        assignRes = await npcc_services.inf_CallWebServiceAsync <int, inf_assignment>(inf_method.Post, url, objAssignment);
                    }).ContinueWith(fn => {
                        if (assignRes == 1)
                        {
                            _spl.cStatus = "W";
                            dBRepository.UpdateSpool(_spl);
                            _currentContext.RunOnUiThread(() =>
                            {
                                _ins._lsObjs.RemoveAt((int)((Button)sender).Tag);
                                _ins.NotifyItemRemoved((int)((Button)sender).Tag);
                                _ins.NotifyItemRangeChanged((int)((Button)sender).Tag, _ins._lsObjs.Count);
                            });
                            common_functions.DisplayToast("Task assigned successfully!!", _currentContext);
                        }
                        else
                        {
                            common_functions.DisplayToast("Error occurred while assigning the task, contact system admin!!", _currentContext);
                        }
                    });
                });

                alert.SetNegativeButton("No", (senderAlert, args) => {
                });

                Dialog d = alert.Create();
                d.Show();

                break;

            case "Welder":
                _spl = _lsObjs[(int)((Button)sender).Tag];
                FillWeldLog mFillWeldLog = new FillWeldLog(_spl);
                common_functions.npcc_show_fragment(_currentContext, mFragmentContainer, mFillWeldLog, _fragment);
                break;
            }
        }
Esempio n. 8
0
 public Assign(Spools spl, SpoolsCardViewAdapter ins, int position)
 {
     _spl      = spl;
     _ins      = ins;
     _position = position;
 }