Esempio n. 1
0
        private void PopulateStaticDataFields(Entities.User user)
        {
            // Populate the User Statuses
            Facade.IUser facUser      = new Facade.User();
            DataSet      dsUserStatus = facUser.GetAllUserStatus();

            cboUserStatus.DataSource     = dsUserStatus;
            cboUserStatus.DataTextField  = "Description";
            cboUserStatus.DataValueField = "UserStatusId";
            cboUserStatus.DataBind();

            // Populate the Teams
            Facade.ReferenceData facRefData = new Facade.ReferenceData();
            DataSet dsTeam = facRefData.GetAllTeams();

            cboTeam.DataSource     = dsTeam;
            cboTeam.DataTextField  = "Description";
            cboTeam.DataValueField = "IdentityId";
            cboTeam.DataBind();

            string[]         userRoleString = (((Entities.CustomPrincipal)Page.User).UserRole.Split(new char[] { ',' }));
            List <eUserRole> userRole       = new List <eUserRole>();

            for (int i = 0; i < userRoleString.Length; i++)
            {
                userRole.Add((eUserRole)int.Parse(userRoleString[i]));
            }

            if (!userRole.Contains(eUserRole.SystemAdministrator))
            {
                chkCanAccessFromAnywhere.Enabled = false;
                chkScannedLicense.Enabled        = false;
            }
        }
Esempio n. 2
0
        private void PopulateUserGroups()
        {
            Facade.IReferenceData refData = new Facade.ReferenceData();
            DataSet  dsRoles      = refData.GetAllRoles();
            ListItem liClientRole = null;

            foreach (DataRow dr in dsRoles.Tables[0].Rows)
            {
                ListItem li = new ListItem();
                li.Value = dr["RoleId"].ToString();
                li.Text  = dr["Description"].ToString();
                if (m_isClient && li.Text == "Clients")
                {
                    liClientRole = li;
                }
                if (!m_isClient || (m_isClient && li.Text != "Clients"))
                {
                    lbAvailableRoles.Items.Add(li);
                }
            }

            if (liClientRole != null && m_isClient)
            {
                lbSelectedRoles.Items.Add(liClientRole);
                txtSelectedRoles.Value += "," + liClientRole.Value;
            }
        }
        void cboOrganisation_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

            RadComboBox cboOrganisation = (RadComboBox)o;

            cboOrganisation.Items.Clear();

            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            DataSet dsOrganisationNames            = facReferenceData.GetAllOrganisationsFiltered(e.Text, eOrganisationType.ClientCustomer);

            if (dsOrganisationNames.Tables[0].Rows.Count > 0)
            {
                int itemsToRequest = 20;
                if (dsOrganisationNames.Tables[0].Rows.Count < itemsToRequest)
                {
                    itemsToRequest = dsOrganisationNames.Tables[0].Rows.Count;
                }

                Telerik.Web.UI.RadComboBoxItem rcItem = null;
                for (int rowIndex = 0; rowIndex < itemsToRequest; rowIndex++)
                {
                    DataRow dr = dsOrganisationNames.Tables[0].Rows[rowIndex];
                    rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                    rcItem.Text  = dr["OrganisationName"].ToString();
                    rcItem.Value = dr["IdentityID"].ToString();
                    cboOrganisation.Items.Add(rcItem);
                }
            }
        }
Esempio n. 4
0
        void cboClient_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            cboClient.Items.Clear();

            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            DataSet   ds           = facReferenceData.GetAllClientsFiltered(e.Text);
            DataTable dt           = ds.Tables[0];
            DataTable boundResults = dt.Clone();

            int itemsPerRequest = 20;
            int itemOffset      = e.NumberOfItems;
            int endOffset       = itemOffset + itemsPerRequest;

            if (endOffset > dt.Rows.Count)
            {
                endOffset = dt.Rows.Count;
            }

            for (int i = itemOffset; i < endOffset; i++)
            {
                boundResults.ImportRow(dt.Rows[i]);
            }

            cboClient.DataSource = boundResults;
            cboClient.DataBind();

            if (dt.Rows.Count > 0)
            {
                e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString());
            }
        }
Esempio n. 5
0
        private void ConfigureDocketTerminology()
        {
            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            string docketNumberText = facReferenceData.GetDocketNumberTextForIdentityId(m_job.IdentityId);

            if (docketNumberText == String.Empty)
            {
                docketNumberText = "Docket Number";
            }

            // Details of added Dockets
            lblDocketNumber.Text = docketNumberText;
            if (m_instruction.CollectDrops != null)
            {
                if (m_instruction.CollectDrops.Count != 0)
                {
                    lblAddedDockets.Text    = "Added " + docketNumberText + "s";
                    lblAddedDockets.Visible = true;
                }
                else
                {
                    lblAddedDockets.Visible = false;
                }
            }

            rfvDocket.ErrorMessage = "Please select a " + docketNumberText + ".";
            rfvDocket.Text         = rfvDocket.Text.Replace("Docket Number.", docketNumberText + ".");

            lblSelectDocket.Text    = "Select " + docketNumberText;
            rfvDockets.InitialValue = "-- Please select a " + docketNumberText + " --";
            rfvDockets.ErrorMessage = "Please enter a " + docketNumberText + ".";
            rfvDockets.Text         = rfvDockets.Text.Replace("Docket Number.", docketNumberText + ".");

            chkAddAnotherDocket.Text = chkAddAnotherDocket.Text.Replace("docket number", docketNumberText.ToLower());
        }
        void cboClient_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            cboClient.Items.Clear();

            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            DataSet ds = facReferenceData.GetAllClientsFiltered(e.Text);

            int itemsPerRequest = 20;
            int itemOffset      = e.NumberOfItems;
            int endOffset       = itemOffset + itemsPerRequest;

            if (endOffset > ds.Tables[0].Rows.Count)
            {
                endOffset = ds.Tables[0].Rows.Count;
            }

            DataTable dt = ds.Tables[0];

            Telerik.Web.UI.RadComboBoxItem rcItem;
            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["OrganisationName"].ToString();
                rcItem.Value = dt.Rows[i]["IdentityID"].ToString();
                cboClient.Items.Add(rcItem);
            }

            if (dt.Rows.Count > 0)
            {
                e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, dt.Rows.Count);
            }
        }
Esempio n. 7
0
        private void BindGrid()
        {
            Facade.UserAdmin      facUserAdmin = new Facade.UserAdmin();
            Facade.IReferenceData refData      = new Facade.ReferenceData();
            DataSet dsUserGroups = refData.GetAllRoles();

            dgUserGroups.DataSource = dsUserGroups;
            dgUserGroups.DataBind();
        }
Esempio n. 8
0
        private void DisplayCounty(int townId)
        {
            Facade.IReferenceData facRefData = new Facade.ReferenceData();
            DataSet dsCounty = facRefData.GetCountyForTownId(townId);

            txtCounty.Text = dsCounty.Tables[0].Rows[0]["Description"].ToString();
            lblTownId.Text = townId.ToString();
            m_townId       = townId;
            m_countyName   = txtCounty.Text;
        }
Esempio n. 9
0
        void btnRefresh_Click(object sender, EventArgs e)
        {
            Facade.IReferenceData facRefData = new Facade.ReferenceData();
            int identityID = 0;

            int.TryParse(cboClient.SelectedValue, out identityID);

            TotalRevenue          = facRefData.GetTotalRevenueReport(NominalCodeIDs, rblState.Items[0].Selected, identityID, dteStartDate.SelectedDate.Value, dteEndDate.SelectedDate.Value);
            grdSummary.DataSource = TotalRevenue;
            grdSummary.Rebind();
        }
Esempio n. 10
0
        private void LoadDrivers(Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            cboDriver.Items.Clear();

            Facade.IReferenceData facDriver = new Facade.ReferenceData();

            DataSet ds = facDriver.GetAllDriversFiltered(e.Text, false);

            cboDriver.DataSource = ds;
            cboDriver.DataBind();
        }
Esempio n. 11
0
        void btnDisplayReport_Click(object sender, EventArgs e)
        {
            int      clientID  = 0;
            DateTime startDate = new DateTime();
            DateTime endDate   = new DateTime();
            DataSet  ds        = null;

            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();

            int.TryParse(cboClient.SelectedValue, out clientID);
            startDate = rdiStartDate.SelectedDate.Value;
            endDate   = rdiEndDate.SelectedDate.Value;

            ds = facReferenceData.GetExtrasRevenueReport(clientID, startDate, endDate);

            if (ds.Tables[1].Rows.Count == 0)
            {
                if (clientID > 0)
                {
                    lblError.Text = "No extras for client " + cboClient.Text + " for period " + startDate.ToString("dd/MM/yy") + " to " + endDate.ToString("dd/MM/yy");
                }
                else
                {
                    lblError.Text = "No extras for period " + startDate.ToString("dd/MM/yy") + " to " + endDate.ToString("dd/MM/yy");
                }

                lblError.Visible     = true;
                reportViewer.Visible = false;
            }
            else
            {
                lblError.Visible = false;

                NameValueCollection reportParams = new NameValueCollection();

                reportParams.Add("IdentityID", clientID.ToString());
                reportParams.Add("StartDate", startDate.ToString("dd/MM/yy"));
                reportParams.Add("EndDate", endDate.ToString("dd/MM/yy"));

                // Configure the Session variables used to pass data to the report
                Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable]       = eReportType.ExtrasRevenue;
                Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable]  = ds;
                Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable]   = String.Empty;
                Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table1";
                Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable]     = reportParams;

                if (cboClient.SelectedValue != "")
                {
                    reportViewer.IdentityId = int.Parse(cboClient.SelectedValue);
                }
                // Show the user control
                reportViewer.Visible = true;
            }
        }
Esempio n. 12
0
        public void PopulateStaticControls()
        {
            Facade.IReferenceData facRef = new Facade.ReferenceData();
            DataSet dsControlAreas       = facRef.GetAllControlAreas();

            cboTrafficeArea.DataSource     = dsControlAreas;
            cboTrafficeArea.DataValueField = "ControlAreaId";
            cboTrafficeArea.DataTextField  = "Description";

            cboTrafficeArea.DataBind();
        }
Esempio n. 13
0
        protected void PopulateStaticControls()
        {
            Facade.IReferenceData facRef = new Facade.ReferenceData();
            DataSet ds = facRef.GetAllTrafficAreas();

            cboTrafficArea.DataTextField  = "Description";
            cboTrafficArea.DataValueField = "TrafficAreaId";
            cboTrafficArea.DataSource     = ds;
            cboTrafficArea.DataBind();
            cboTrafficArea.Items.Insert(0, new ListItem("Derive from postcode", "0"));
        }
        void repClientCustomers_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            int identityID;

            int.TryParse(cboOrganisation.SelectedValue, out identityID);

            if (identityID != 0)
            {
                Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
                repClientCustomers.DataSource = facReferenceData.GetAllOrganisationsFiltered(txtClientCustomerFiler.Text, eOrganisationType.ClientCustomer);
            }
        }
Esempio n. 15
0
        private void ConfigureLoadTerminology()
        {
            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();

            string loadNumberText = facReferenceData.GetLoadNumberTextForIdentityId(m_job.IdentityId);

            if (loadNumberText != String.Empty)
            {
                lblLoadNumber.Text         = loadNumberText;
                rfvLoadNumber.ErrorMessage = "Please enter the " + loadNumberText + ".";
                rfvLoadNumber.Text         = rfvLoadNumber.Text.Replace("Load Number.", loadNumberText + ".");
            }
        }
Esempio n. 16
0
        private void PopulateUserGroups(Entities.User user)
        {
            Facade.IReferenceData refData = new Facade.ReferenceData();
            DataSet dsRoles = refData.GetAllRoles();
            bool    Selected;

            cboTeam.ClearSelection();
            ListItem teamMember = cboTeam.Items.FindByValue(user.TeamId.ToString());

            if (teamMember != null)
            {
                teamMember.Selected = true;
            }

            foreach (DataRow dr in dsRoles.Tables[0].Rows)
            {
                ListItem li = new ListItem(dr["Description"].ToString(), dr["RoleId"].ToString());
                Selected = false;

                string[] Roles = user.Roles.Split(',');
                foreach (string role in Roles)
                {
                    if (role == dr["RoleId"].ToString())
                    {
                        Selected = true;
                    }
                }
                if (Selected)
                {
                    lbSelectedRoles.Items.Add(li);
                }
                else
                {
                    lbAvailableRoles.Items.Add(li);
                }
            }

            string _Roles = "";

            lblMessage.Text = "";

            foreach (ListItem li in lbSelectedRoles.Items)
            {
                _Roles += "," + li.Value;
                if (int.Parse(li.Value) == (int)eUserRole.Planner)
                {
                    lblMessage.Text = "CAUTION: This user is a Planner. If you remove the Planner role, or remove this user, then all drivers assigned to this user will be unassigned.";
                }
            }
            txtSelectedRoles.Value = _Roles;
        }
Esempio n. 17
0
        private DataSet GetData()
        {
            DateTime start = dteStartDate.SelectedDate.Value;

            start = start.Subtract(start.TimeOfDay);

            DateTime end = dteEndDate.SelectedDate.Value;

            end = end.Subtract(end.TimeOfDay);
            end = end.Add(new TimeSpan(23, 59, 59));

            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            return(facReferenceData.GetUnvoicedValueForDateRange(start, end));
        }
Esempio n. 18
0
        private DataSet GetData()
        {
            DateTime start = dteStartDate.SelectedDate.Value;

            start = start.Subtract(start.TimeOfDay);

            DateTime end = dteEndDate.SelectedDate.Value;

            end = end.Subtract(end.TimeOfDay);
            end = end.Add(new TimeSpan(23, 59, 59));

            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            return(facReferenceData.GetJobDetailForImpressSpreadsheet(start, end));
        }
Esempio n. 19
0
        void cboClient_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();
            DataSet         ds;
            DataTable       dt;
            RadComboBoxItem rcItem;
            int             itemsPerRequest = 20;
            int             itemOffset;
            int             endOffset;

            this.cboClient.Items.Clear();

            if (this.IsCalledFromHotKey)
            {
                ds = facReferenceData.GetClientAndSubcontractorLookup(e.Text);
            }
            else if (this.IsClient)
            {
                ds = facReferenceData.GetAllClientsFiltered(e.Text);
            }
            else
            {
                ds = facReferenceData.GetAllSubContractorsFiltered(e.Text);
            }

            itemOffset = e.NumberOfItems;
            endOffset  = itemOffset + itemsPerRequest;

            dt = ds.Tables[0];
            dt.DefaultView.Sort             = "OrganisationName";
            dt.DefaultView.ApplyDefaultSort = true;

            if (endOffset > dt.Rows.Count)
            {
                endOffset = dt.Rows.Count;
            }

            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["OrganisationName"].ToString();
                rcItem.Value = dt.Rows[i]["IdentityID"].ToString();
                cboClient.Items.Add(rcItem);
            }

            if (dt.Rows.Count > 0)
            {
                e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, dt.Rows.Count);
            }
        }
        private void PopulateStaticControls()
        {
            Facade.IReferenceData facRefData = new Facade.ReferenceData();
            cboType.DataSource = facRefData.GetAllOrganisationLocationTypes();
            cboType.DataBind();

            this.PopulateCountryCombo();

            cboTitle.DataSource = Enum.GetNames(typeof(eTitle));
            cboTitle.DataBind();

            hidOrganisationName.Value = Request.QueryString["organisationName"];

            PopulateTrafficAreaControl();
        }
Esempio n. 21
0
        private void UploadReport(int LogId)
        {
            Facade.IReferenceData facRef = new Facade.ReferenceData();

            DataSet ds = facRef.GetLogDetails(LogId);

            // Apply the details to the report and html fields and load it
            cboClient.Text          = ds.Tables[0].Rows[0]["OrganisationName"].ToString();
            cboClient.SelectedValue = ds.Tables[0].Rows[0]["IdentityId"].ToString();

            dteStartDate.SelectedDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["DateTimeFrom"].ToString());
            dteEndDate.SelectedDate   = Convert.ToDateTime(ds.Tables[0].Rows[0]["DateTimeTo"].ToString());

            LoadReport();
        }
Esempio n. 22
0
        private void PopulateStaticControls()
        {
            if (Orchestrator.Globals.Configuration.FleetMetrikInstance)
            {
                OnlyEnableFleetMetrikFields();
            }

            Facade.IReferenceData facRefData = new Facade.ReferenceData();
            dsClients = facRefData.GetAllClients();



            int unitedKingdomCountryId = 1;

            this.SetAddressOnFocus(unitedKingdomCountryId);

            PopulateDeliveryMatrix();
        }
Esempio n. 23
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                int                   organisationReferenceId = int.Parse(cboReference.SelectedValue);
                string                userId = ((Entities.CustomPrincipal)Page.User).UserName;
                Facade.IOrder         facOrd = new Facade.Order();
                Facade.IReferenceData facRef = new Facade.ReferenceData();


                if (organisationReferenceId == 0)
                {
                    switch (cboReference.SelectedItem.Text)
                    {
                    case "Delivery Order Number":
                        updatedOrders = facOrd.UpdateMultiplOrderReferences(OrderIDs, txtValue.Text, false, userId);
                        break;

                    case "Customer Order Number":
                        updatedOrders = facOrd.UpdateMultiplOrderReferences(OrderIDs, txtValue.Text, true, userId);
                        break;
                    }
                }
                else
                {
                    if (OrderIDs.Length > 0)
                    {
                        updatedOrders = facRef.UpdateReferencesForOrderIDs(OrderIDs, txtValue.Text, organisationReferenceId, userId);
                    }

                    if (JobIDs.Length > 0)
                    {
                        updatedJobs = facRef.UpdateReferencesForJobIDs(JobIDs, txtValue.Text, organisationReferenceId, userId);
                    }
                }

                AllSelectedWorkForOrganisation = null;
                BindGrids();
                updatedOrders = updatedJobs = null;
            }
        }
Esempio n. 24
0
        void cboDepotCode_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            ((Telerik.Web.UI.RadComboBox)sender).Items.Clear();
            System.Data.DataTable reader = null;
            if (Cache["__depotCodes"] == null)
            {
                Facade.IReferenceData facResource = new Facade.ReferenceData();
                reader = facResource.GetAllDepotCodes();
                Cache.Add("__depotCodes", reader, null, System.Web.Caching.Cache.NoAbsoluteExpiration, new TimeSpan(0, 20, 0), System.Web.Caching.CacheItemPriority.Normal, null);
            }
            else
            {
                reader = (DataTable)Cache["__depotCodes"];
            }

            int itemsPerRequest = 20;
            int itemOffset      = e.NumberOfItems;
            int endOffset       = itemOffset + itemsPerRequest;

            if (endOffset > reader.Rows.Count)
            {
                endOffset = reader.Rows.Count;
            }

            DataTable dt = reader;

            Telerik.Web.UI.RadComboBoxItem rcItem = null;
            for (int i = itemOffset; i < endOffset; i++)
            {
                rcItem       = new Telerik.Web.UI.RadComboBoxItem();
                rcItem.Text  = dt.Rows[i]["DepotCode"].ToString();
                rcItem.Value = dt.Rows[i]["DepotCode"].ToString();
                ((Telerik.Web.UI.RadComboBox)sender).Items.Add(rcItem);
            }

            if (dt.Rows.Count > 0)
            {
                e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString());
            }
        }
Esempio n. 25
0
        private void DisplayTowns()
        {
            DataSet dsTowns;

            Facade.IReferenceData facRefData = new Facade.ReferenceData();
            dsTowns = facRefData.GetTownForTownName(m_townName);

            if (dsTowns.Tables[0].Rows.Count > 1)
            {
                lstTowns.DataSource = dsTowns.Tables[0];
                lstTowns.DataBind();
                lstTowns.Visible = true;
            }
            else
            {
                m_townId = Convert.ToInt32(dsTowns.Tables[0].Rows[0]["TownId"]);
                DisplayCounty(m_townId);
                txtTown.Text = dsTowns.Tables[0].Rows[0]["Description"].ToString();
                m_oneRow     = true;
                m_townName   = txtTown.Text;
            }
        }
        private void LoadGrid()
        {
            Facade.IReferenceData facRef = new Facade.ReferenceData();

            DataSet dsLogs = facRef.GetUnsentLogs();

            if (dsLogs != null)
            {
                if (dsLogs.Tables[0].Rows.Count == 0)
                {
                    lblError.Text = "No logs require to be sent.";

                    lblError.Visible = true;
                    pnlLogs.Visible  = false;
                }
                else
                {
                    DataView dv = new DataView(dsLogs.Tables[0]);

                    if (cboClient.SelectedValue != string.Empty)
                    {
                        if ((dteStartDate.SelectedDate != DateTime.MinValue) || (dteEndDate.SelectedDate != DateTime.MinValue))
                        {
                            dv.RowFilter = "IdentityId=" + Convert.ToInt32(cboClient.SelectedValue) + " AND DateTimeFrom >= '" + dteStartDate.SelectedDate.Value.ToString("dd/MMM/yyyy HH:mm") + "' AND DateTimeTo <= '" + dteEndDate.SelectedDate.Value.ToString("dd/MMM/yyyy HH:mm") + "'";

                            dgLogs.DataSource = dv;
                            dgLogs.DataBind();

                            if (dgLogs.Items.Count == 0)
                            {
                                lblError.Text = "No logs for client " + cboClient.Text + " for period " + dteStartDate.SelectedDate.Value.ToString("dd/MM/yy") + " to " + dteEndDate.SelectedDate.Value.ToString("dd/MM/yy");

                                lblError.Visible = true;
                                pnlLogs.Visible  = false;
                            }
                            else
                            {
                                lblError.Visible = false;
                                pnlLogs.Visible  = true;
                            }
                        }
                        else
                        {
                            dv.RowFilter = "IdentityId=" + Convert.ToInt32(cboClient.SelectedValue);

                            dgLogs.DataSource = dv;
                            dgLogs.DataBind();

                            if (dgLogs.Items.Count == 0)
                            {
                                lblError.Text = "No logs for client " + cboClient.Text + ".";

                                lblError.Visible = true;
                                pnlLogs.Visible  = false;
                            }
                            else
                            {
                                lblError.Visible = false;
                                pnlLogs.Visible  = true;
                            }
                        }
                    }
                    else
                    {
                        if ((dteStartDate.SelectedDate != DateTime.MinValue) || (dteEndDate.SelectedDate != DateTime.MinValue))
                        {
                            dv.RowFilter = "DateTimeFrom >= '" + dteStartDate.SelectedDate.Value.ToString("dd/MMM/yyyy HH:mm") + "' AND DateTimeTo <= '" + dteEndDate.SelectedDate.Value.ToString("dd/MMM/yyyy HH:mm") + "'";

                            dgLogs.DataSource = dv;
                            dgLogs.DataBind();

                            if (dgLogs.Items.Count == 0)
                            {
                                lblError.Text = "No logs for period " + dteStartDate.SelectedDate.Value.ToString("dd/MM/yy") + " to " + dteEndDate.SelectedDate.Value.ToString("dd/MM/yy");;

                                lblError.Visible = true;
                                pnlLogs.Visible  = false;
                            }
                            else
                            {
                                lblError.Visible = false;
                                pnlLogs.Visible  = true;
                            }
                        }
                        else
                        {
                            dgLogs.DataSource = dsLogs;
                            dgLogs.DataBind();

                            lblError.Visible = false;
                            pnlLogs.Visible  = true;
                        }
                    }
                }
            }
        }
Esempio n. 27
0
        private void PopulateDockets()
        {
            cboDockets.Items.Clear();
            Facade.IReferenceData facReferenceData = new Facade.ReferenceData();

            string docketNumberText = facReferenceData.GetDocketNumberTextForIdentityId(m_job.IdentityId);

            if (docketNumberText != String.Empty)
            {
                cboDockets.Items.Add(new ListItem("-- Please select a " + docketNumberText + " --"));
            }
            else
            {
                cboDockets.Items.Add(new ListItem("-- Please select a Docket Number --"));
            }

            if (m_isUpdate)
            {
                #region Display the dockets that have not been been assigned to a drop

                foreach (Entities.Instruction instruction in m_job.Instructions)
                {
                    if (instruction.InstructionTypeId == (int)eInstructionType.Load)
                    {
                        foreach (Entities.CollectDrop collectDrop in instruction.CollectDrops)
                        {
                            bool collectDropHasBeenDropped = false;

                            foreach (Entities.Instruction dropInstruction in m_job.Instructions)
                            {
                                if (dropInstruction.InstructionTypeId == (int)eInstructionType.Drop)
                                {
                                    foreach (Entities.CollectDrop dropCollectDrop in dropInstruction.CollectDrops)
                                    {
                                        if (dropCollectDrop.Docket == collectDrop.Docket)
                                        {
                                            collectDropHasBeenDropped = true;
                                        }
                                    }
                                }
                            }

                            if (m_instruction.InstructionTypeId == (int)eInstructionType.Drop)
                            {
                                foreach (Entities.CollectDrop dropCollectDrop in m_instruction.CollectDrops)
                                {
                                    if (dropCollectDrop.Docket == collectDrop.Docket)
                                    {
                                        collectDropHasBeenDropped = true;
                                    }
                                }
                            }

                            if (!collectDropHasBeenDropped)
                            {
                                cboDockets.Items.Add(DocketItem(collectDrop));
                            }
                        }
                    }
                }

                #endregion

                if (m_isAmendment)
                {
                    cboDockets.ClearSelection();

                    cboDockets.Items.Insert(1, DocketItem(m_collectdrop));
                    cboDockets.Items[1].Selected = true;
                }
            }
            else
            {
                #region Display a list of dockets that have not been assigned to a drop

                // Check both within the m_job.Instructions collection, but also the new collection being built-up.
                Entities.InstructionCollection insCollection = new Entities.InstructionCollection();
                foreach (Entities.Instruction instruction in m_job.Instructions)
                {
                    insCollection.Add(instruction);
                }
                insCollection.Add(m_instruction);

                foreach (Entities.Instruction instruction in insCollection)
                {
                    if (instruction.InstructionTypeId == (int)eInstructionType.Load)
                    {
                        foreach (Entities.CollectDrop collectDrop in instruction.CollectDrops)
                        {
                            bool collectDropHasBeenDropped = false;

                            foreach (Entities.Instruction dropInstruction in insCollection)
                            {
                                if (dropInstruction.InstructionTypeId == (int)eInstructionType.Drop)
                                {
                                    foreach (Entities.CollectDrop dropCollectDrop in dropInstruction.CollectDrops)
                                    {
                                        if (collectDrop.Docket == dropCollectDrop.Docket)
                                        {
                                            collectDropHasBeenDropped = true;
                                        }
                                    }
                                }
                            }

                            if (!collectDropHasBeenDropped)
                            {
                                cboDockets.Items.Add(DocketItem(collectDrop));
                            }
                        }
                    }
                }

                #endregion

                if (m_isAmendment)
                {
                    cboDockets.ClearSelection();
                    // Add and select the docket
                    cboDockets.Items.Insert(1, DocketItem(m_collectdrop));
                    cboDockets.Items[1].Selected = true;
                }
            }

            if (m_instruction.InstructionTypeId == (int)eInstructionType.Drop && cboDockets.Items.Count == 2)
            {
                chkAddAnotherDocket.Enabled = false;
            }
        }
Esempio n. 28
0
 private void PopulateDataGrid()
 {
     Facade.ReferenceData facReferenceData = new Facade.ReferenceData();
     dgJobCollections.DataSource = facReferenceData.GetCollectionsForJobId(m_jobId);
     dgJobCollections.DataBind();
 }