Ejemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View view = inflater.Inflate(Resource.Layout.fragment_layout, null);

            var callsViewModel = new CallsViewModel(AnalysisActivity.AllCalls, "DateTime");

            itemList = new ListViewItemsBuilder().GetItems(callsViewModel);

            //listview and updates
            multiLevelRecyclerView = (MultiLevelRecyclerView)view.FindViewById(Resource.Id.MultiLevelView);
            multiLevelRecyclerView.SetLayoutManager(new LinearLayoutManager(Activity));

            //itemList = recursivePopulateFakeData(0, 24);

            myAdapter = new MyAdapter(Activity, itemList, multiLevelRecyclerView);

            multiLevelRecyclerView.SetAdapter(myAdapter);
            multiLevelRecyclerView.ToggleItemOnClick = false;
            multiLevelRecyclerView.Accordion         = true;
            multiLevelRecyclerView.OpenTill(0);

            FloatingActionButton fab = view.FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += (se, ev) =>
            {
                //Toast.MakeText(Activity,"clicked!",ToastLength.Long).Show();
                RawSortDialog dialog = new RawSortDialog();
                dialog.SortMethodSelected += UpdateItems;
                dialog.Show(Activity.SupportFragmentManager, "SortBy dialog");
            };

            return(view);
        }
Ejemplo n.º 2
0
        public async Task <CallsViewModel> GetAssingedCalls(FilterModel filterModel)
        {
            var          mainModel = new CallsViewModel();
            SqlParameter client    = new SqlParameter("@ClientId", DBNull.Value);

            using (var connection = _context.Database.Connection)
            {
                connection.Open();
                var command = connection.CreateCommand();
                command.CommandText = "GETAssignedCalls";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(client);
                command.Parameters.Add(new SqlParameter("@IsExport", ToDBNull(false)));
                command.Parameters.Add(new SqlParameter("@Type", ToDBNull('A')));
                command.Parameters.Add(new SqlParameter("@CompId", ToDBNull(filterModel.CompId)));
                using (var reader = await command.ExecuteReaderAsync())
                {
                    mainModel.OpenCalls =
                        ((IObjectContextAdapter)_context)
                        .ObjectContext
                        .Translate <UploadedExcelModel>(reader)
                        .ToList();
                    reader.NextResult();

                    mainModel.CloseCalls =
                        ((IObjectContextAdapter)_context)
                        .ObjectContext
                        .Translate <UploadedExcelModel>(reader)
                        .ToList();
                }
            }
            return(mainModel);
        }
Ejemplo n.º 3
0
        private void UpdateItems(string sortBy)
        {
            var callsViewModel = new CallsViewModel(AnalysisActivity.AllCalls, sortBy);

            myAdapter.ListItems = new ListViewItemsBuilder().GetItems(callsViewModel);
            myAdapter.NotifyDataSetChanged();
            multiLevelRecyclerView.OpenTill(0);
        }
Ejemplo n.º 4
0
        // GET: OpenCalls/Details/5
        public async Task <ActionResult> Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VUMM_HH_OPEN_CALLS dto = await _conntext.VUMM_HH_OPEN_CALLS.FindAsync(id);

            if (dto == null)
            {
                return(HttpNotFound());
            }
            CallsViewModel vm = _callsMapper.Map <CallsViewModel>(dto);

            return(View(vm));
        }
Ejemplo n.º 5
0
        public async Task <ActionResult> ChangeStatus([Bind(Include = "doc_nbr,stat_rmrk, CALL_STAT_CODE, line_nbr")] CallsViewModel iVm)
        {
            if (ModelState.IsValid)
            {
                if (iVm.CALL_STAT_CODE < 301 || iVm.CALL_STAT_CODE > 340)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }
                else
                {
                    await _conntext.ExecuteStoreProcedureAsync("mm_hh.mm_hh_close", iVm.doc_nbr, iVm.line_nbr, iVm.CALL_STAT_CODE, User.Identity.Name, iVm.stat_rmrk);

                    return(RedirectToAction("Index"));
                }
            }
            return(View(iVm));
        }
Ejemplo n.º 6
0
        public async Task <ActionResult> Edit([Bind(Include = "doc_nbr,line_nbr,STRM_CODE")] CallsViewModel model)
        {
            if (ModelState.IsValid)
            {
                var strm = _conntext.ExecuteFunction <string>("mm_hh.mm_hh_get_strm", model.doc_nbr, model.line_nbr);
                if (strm == model.STRM_CODE)
                {
                    return(RedirectToAction("Index"));
                }
                await _conntext.ExecuteStoreProcedureAsync("mm_hh.mm_hh_update_strm_lft", model.doc_nbr, model.line_nbr, model.STRM_CODE);

                await _conntext.ExecuteStoreProcedureAsync("mm_hh.mm_hh_strmchng_wo_user", model.doc_nbr, model.line_nbr, strm, model.STRM_CODE, User.Identity.Name);

                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Ejemplo n.º 7
0
        // GET: OpenCalls/Edit/5
        //public async Task<ActionResult> Close(long? id, int stat, string? rk)
        public async Task <ActionResult> Close([Bind(Include = "doc_nbr,stat_rmrk, status, line_nbr")] CallsViewModel iVm)
        {
            if (ModelState.IsValid)
            {
                //VUMM_HH_OPEN_CALLS call = _conntext.VUMM_HH_OPEN_CALLS.Find(iVm.doc_nbr);
                //if (call == null)
                //{
                //    return new HttpStatusCodeResult(HttpStatusCode.NotFound);
                //}
                //else
                //{
                await _conntext.ExecuteStoreProcedureAsync("mm_hh.mm_hh_close", iVm.doc_nbr, iVm.line_nbr, 300, User.Identity.Name, iVm.stat_rmrk);

                return(RedirectToAction("Index"));
                //}
            }
            return(View(iVm));
        }
Ejemplo n.º 8
0
        // GET: OpenCalls/ChangeStatus/5
        public async Task <ActionResult> ChangeStatus(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VUMM_HH_HNDL_CALLS call = _conntext.VUMM_HH_HNDL_CALLS.Find(id);

            if (call == null)
            {
                return(HttpNotFound());
            }
            CallsViewModel vm = _mapper.Map <CallsViewModel>(call);

            vm.StatusList = createStatusList(vm.CALL_STAT_CODE);

            return(View(vm));
        }
Ejemplo n.º 9
0
        // GET: HandelCalls/Edit/5
        public async Task <ActionResult> Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VUMM_HH_HNDL_CALLS call = _conntext.VUMM_HH_HNDL_CALLS.Find(id);

            if (call == null)
            {
                return(HttpNotFound());
            }
            CallsViewModel vm = _mapper.Map <CallsViewModel>(call);

            vm.StrmList = getStrmsList(vm.STRM_CODE);

            return(View(vm));
        }
Ejemplo n.º 10
0
        public async Task <CallsViewModel> GetCalls(FilterModel filter)
        {
            var calls = new CallsViewModel();

            var prms  = new List <SqlParameter>();
            var param = new SqlParameter("@ProviderId", ToDBNull(filter.ProviderId));

            prms.Add(param);
            param = new SqlParameter("@CenterId", ToDBNull(filter.CenterId));
            prms.Add(param);
            param = new SqlParameter("@ClientId", ToDBNull(filter.ClientId));
            prms.Add(param);
            param = new SqlParameter("@CompanyId", ToDBNull(filter.CompId));
            prms.Add(param);
            using (var connection = _context.Database.Connection)
            {
                connection.Open();
                var command = connection.CreateCommand();
                command.CommandText = "GetCalls";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddRange(prms.ToArray());
                using (var reader = await command.ExecuteReaderAsync())
                {
                    calls.OpenCalls =
                        ((IObjectContextAdapter)_context)
                        .ObjectContext
                        .Translate <UploadedExcelModel>(reader)
                        .ToList();
                    reader.NextResult();
                    calls.CloseCalls =
                        ((IObjectContextAdapter)_context)
                        .ObjectContext
                        .Translate <UploadedExcelModel>(reader)
                        .ToList();
                }
            }
            return(calls);
        }
Ejemplo n.º 11
0
 public CallsView()
 {
     InitializeComponent();
     BindingContext = viewModel = new CallsViewModel();
 }