private void BindData(Guid Id) { ScalingBLL obj = new ScalingBLL(); obj = obj.GetById(Id); if (obj != null) { if (obj.Id != null) { this.hfId.Value = obj.Id.ToString(); } if (obj.ScaleTicketNumber != "") { this.txtScaleTicket.Text = obj.ScaleTicketNumber.ToString(); } if (obj.DateWeighed != null) { this.txtDateWeighed.Text = obj.DateWeighed.ToString(); } this.cboWeigher.SelectedValue = obj.WeigherId.ToString(); this.txtGrossTruckWeight.Text = obj.GrossWeightWithTruck.ToString(); this.txtGrossWeoght.Text = obj.GrossWeight.ToString(); this.txtTruckWeight.Text = obj.TruckWeight.ToString(); this.txtRemark.Text = obj.Remark; this.cboStatus.SelectedValue = ((int)obj.Status).ToString(); DriverInformationBLL objDriver = new DriverInformationBLL(); if (obj.DriverInformationId != null) { objDriver = objDriver.GetById(obj.DriverInformationId); if (objDriver != null) { this.lblPlateNo.Text = objDriver.PlateNumber; this.lblTrailerNo.Text = objDriver.TrailerPlateNumber; } } bool hasGRN = false; GRNBLL objGRN = new GRNBLL(); hasGRN = objGRN.HasGRN("tblScaling", obj.Id); if (hasGRN == true) { this.btnAdd.Enabled = false; this.lblMessage.Text = "You can't update this Data because a GRN has already been Created for it."; } } }