private void PopulateControls() { Facade.IJobRate facJobRate = new Facade.Job(); Entities.JobRate jobRate = facJobRate.GetRateForRateId(m_rateId); if (jobRate != null) { // Delivery point Facade.IPoint facPoint = new Facade.Point(); Entities.Point point = facPoint.GetPointForPointId(jobRate.DeliveryPointId); cboDeliveryPoint.Text = point.Description; cboDeliveryPoint.SelectedValue = jobRate.DeliveryPointId.ToString(); cboDelivery.Text = point.OrganisationName; cboDelivery.SelectedValue = point.IdentityId.ToString(); // Collection point point = facPoint.GetPointForPointId(jobRate.CollectionPointId); cboCollectionPoint.Text = point.Description; cboCollectionPoint.SelectedValue = jobRate.CollectionPointId.ToString(); cboCollection.Text = point.OrganisationName; cboCollection.SelectedValue = point.IdentityId.ToString(); txtFullLoadRate.Text = jobRate.FullLoadRate.ToString("C"); txtMultiDropRate.Text = jobRate.MultiDropRate.ToString("C"); dteStartDate.SelectedDate = jobRate.StartDate; dteStartDate.Text = jobRate.StartDate.ToString(); if (!(jobRate.EndDate.ToString() == "01/01/1753 00:00:00")) { dteEndDate.SelectedDate = jobRate.EndDate; dteEndDate.Text = jobRate.EndDate.ToString(); } } }
public static string MergePoint(int mergeToPoint, int mergeFrom, string userName) { string pointCompleted = String.Empty; try { Facade.IPoint facPoint = new Facade.Point(); List <Entities.Point> mergedPoints = new List <Entities.Point>(); mergedPoints = facPoint.MergePoints(mergeToPoint, mergeFrom.ToString(), userName); if (mergedPoints.Count > 0) { pointCompleted = mergedPoints[0].PointId + "," + mergedPoints[0].Description + " has been merged successfully."; } else { throw new Exception("Point " + mergeFrom + " could not be merged."); } } catch (Exception ex) { pointCompleted = mergeFrom + "," + ex.Message; } return(pointCompleted); }
private bool UpdatePoint() { Facade.IPoint facPoint = new Facade.Point(); string userName = ((Entities.CustomPrincipal)Page.User).UserName; Entities.FacadeResult retVal = facPoint.Update(_point, userName); return(retVal.Success); }
private void LoadPointAuditTrail() { pnlPoint.Visible = true; Facade.IPoint facPoint = new Facade.Point(); Entities.Point currentPoint = facPoint.GetPointForPointId(currentID); lblPalletBalanceType.Text = "Point Pallet Audit Trail : " + currentPoint.Description; Facade.IPalletBalance facPalletBalance = new Facade.Pallet(); lvPointAudit.DataSource = facPalletBalance.GetPointAuditTrail(currentID, int.Parse(rcbPalletType.SelectedValue), rdiStartDate.SelectedDate.Value, rdiEndDate.SelectedDate.Value); lvPointAudit.DataBind(); }
private bool AddPoint() { if (_point != null) { Facade.IPoint facPoint = new Facade.Point(); string userName = ((Entities.CustomPrincipal)Page.User).UserName; Entities.FacadeResult retVal = facPoint.Create(_point, userName); return(retVal.Success); } return(false); }
protected void btnMergePoints_Click(object sender, EventArgs e) { Facade.IPoint facPoint = new Facade.Point(); List <Entities.Point> mergedPoints = new List <Entities.Point>(); string userId = ((Entities.CustomPrincipal)Page.User).UserName; RadioButton rdoButton = null; CheckBox chkBox = null; string mergeToPoint = ""; StringBuilder mergeFromPoints = new StringBuilder(); foreach (Telerik.Web.UI.GridItem gi in repPoints.Items) { rdoButton = (RadioButton)gi.FindControl("btnRadioKeep"); chkBox = (CheckBox)gi.FindControl("chkRow"); if (rdoButton.Checked == true) { mergeToPoint = rdoButton.Attributes["PointID"]; } if (chkBox.Checked) { if (mergeFromPoints.Length == 0) { mergeFromPoints = mergeFromPoints.Append(chkBox.Attributes["PointID"]); } else { mergeFromPoints = mergeFromPoints.Append("," + chkBox.Attributes["PointID"]); } } } if (mergeFromPoints.Length > 0 && mergeToPoint.Length > 0) { mergedPoints = facPoint.MergePoints(Convert.ToInt32(mergeToPoint), mergeFromPoints.ToString(), userId); repPoints.Rebind(); } }