コード例 #1
0
        private void ScalingInformation(Guid GradingId)
        {
            float weight;

            try
            {
                weight = ScalingBLL.GetApprovedWeightByCommoditydeposite(GradingId);
                this.lblGrossWeight.Text = weight.ToString();
            }
            catch
            {
                this.lblmsg.Text = "An error has occured please try again";
                return;
            }
            Guid       ScalingId  = Guid.Empty;
            ScalingBLL objScaling = new ScalingBLL();

            try
            {
                ScalingId = objScaling.GetScalingIdByGradingId(GradingId);
                this.hfScalingId.Value  = ScalingId.ToString();
                this.lblDateScaled.Text = objScaling.GetById(ScalingId).DateWeighed.ToShortDateString();
            }
            catch
            {
                this.lblmsg.Text = "An error has occured please try again";
                return;
            }
        }
コード例 #2
0
        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.";
                }
            }
        }
コード例 #3
0
        private void rptGRN_ReportStart(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session["GRNIDPrint"] == null)
            {
                throw new Exception("Session expired");
            }
            Guid GRNId = Guid.Empty;

            GRNId = new Guid(HttpContext.Current.Session["GRNIDPrint"].ToString());
            Guid   GradingId = Guid.Empty;
            GRNBLL objGRN    = new GRNBLL();

            objGRN              = objGRN.GetbyGRN_Number(GRNId);
            GradingId           = objGRN.GradingId;
            this.lblGRN_No.Text = objGRN.GRN_Number;
            this.lblClient.Text = ClientBLL.GetClinetNameById(objGRN.ClientId);

            this.lblCommodityGrade.Text   = CommodityGradeBLL.GetCommodityGradeNameById(objGRN.CommodityGradeId);
            this.lblWarehouse.Text        = WarehouseBLL.GetWarehouseNameById(objGRN.WarehouseId);
            this.lblOriginalQuantity.Text = objGRN.OriginalQuantity.ToString();
            this.lblNetWeight.Text        = objGRN.NetWeight.ToString();
            this.lblDateDeposited.Text    = objGRN.DateDeposited.ToShortDateString();
            this.lblTimeDeposited.Text    = objGRN.DateDeposited.ToShortTimeString();
            this.lblNoBags.Text           = objGRN.TotalNumberOfBags.ToString();
            //Bag Type
            BagTypeBLL objBt = new BagTypeBLL();

            objBt.GetBagTypeById(objGRN.BagTypeId);
            lblBagType.Text = objBt.BagTypeName;

            //Driver Information

            List <DriverInformationBLL> list  = null;
            DriverInformationBLL        objDI = new DriverInformationBLL();

            list = objDI.GetActiveDriverInformationByReceivigRequestId(objGRN.CommodityRecivingId);
            if (list != null)
            {
                string driverName          = "";
                string plateNo             = "";
                string driverLicense       = "";
                string licensceIssuedPlace = "";
                foreach (DriverInformationBLL o in list)
                {
                    if (driverName == "")
                    {
                        driverName = o.DriverName;
                    }
                    else
                    {
                        driverName += "," + o.DriverName;
                    }
                    if (plateNo == "")
                    {
                        if (String.IsNullOrEmpty(o.TrailerPlateNumber) != true)
                        {
                            plateNo = o.PlateNumber + "-" + o.TrailerPlateNumber;
                        }
                        else
                        {
                            plateNo = o.PlateNumber;
                        }
                    }
                    else
                    {
                        if (String.IsNullOrEmpty(o.TrailerPlateNumber) != true)
                        {
                            plateNo += " , " + o.PlateNumber + "-" + o.TrailerPlateNumber;
                        }
                        else
                        {
                            plateNo += " , " + o.PlateNumber;
                        }
                    }
                    if (driverLicense == "")
                    {
                        driverLicense = o.LicenseNumber;
                    }
                    else
                    {
                        driverLicense += " , " + o.LicenseNumber;
                    }
                    if (licensceIssuedPlace == "")
                    {
                        licensceIssuedPlace = o.LicenseIssuedPlace;
                    }
                    else
                    {
                        licensceIssuedPlace += " , " + o.LicenseIssuedPlace;
                    }
                }
                this.lblDriverName.Text    = driverName;
                this.lblPlateNo.Text       = plateNo;
                this.lblDriverLicense.Text = driverLicense;
                this.lblPlaceIssued.Text   = licensceIssuedPlace;
            }
            // Scaling
            ScalingBLL objScaling = new ScalingBLL();

            objScaling = objScaling.GetById(objGRN.ScalingId);
            if (objScaling != null)
            {
                if (objScaling.WeigherId != null)
                {
                    try
                    {
                        this.lblWeigherName.Text = UserRightBLL.GetUserNameByUserId(objScaling.WeigherId);
                    }
                    catch
                    {
                    }
                }
            }
            // Sampler
            SamplerBLL objSampler = new SamplerBLL();

            objSampler = objSampler.GetActiveSamplingSupBySamplingId(objGRN.SamplingTicketId);
            if (objSampler != null)
            {
                this.lblSampler.Text = UserRightBLL.GetUserNameByUserId(objSampler.SamplerId);
            }
            //Graders
            GradingByBLL objGrader = new GradingByBLL();

            this.lblGrader.Text = objGrader.GetSupGraderNameByGradingId(objGRN.GradingId);

            if (objGRN.ApprovedBy != null)
            {
                try
                {
                    this.lblApprovedBy.Text = UserRightBLL.GetUserNameByUserId(objGRN.ApprovedBy);
                }
                catch
                {
                }
            }
            if (objGRN.ApprovedTimeStamp != null)
            {
                this.lblDateAproved.Text = objGRN.ApprovedTimeStamp.ToShortDateString();
            }
            rpt   = new rptGrading(GradingId);
            rptGS = new rptGRNService(GRNId);
            this.txtDateGenerated.Text = DateTime.Now.ToString();
            ScalingBLL objSacling = new ScalingBLL();

            objSacling = objSacling.GetById(objGRN.ScalingId);
            if (objSacling != null)
            {
                this.lblScaleTicketNo.Text = objSacling.ScaleTicketNumber;
            }

            this.subReport1.Report = rpt;
            this.subReport2.Report = this.rptGS;
        }