示例#1
0
        private void LoadGRNInformation(Guid GRN)
        {
            LoadGRNType();
            GRNBLL obj = new GRNBLL();

            obj = obj.GetbyGRN_Number(GRN);
            if (obj != null)
            {
                if (obj.GRN_Number != "")
                {
                    this.hfGRNID.Value            = obj.Id.ToString();
                    this.lblGRN.Text              = obj.GRN_Number;
                    this.lblTrackingNo.Text       = obj.TrackingNo;
                    this.lblProductionYear.Text   = obj.ProductionYear.ToString();
                    this.lblCode.Text             = obj.GradingCode;
                    this.lblDateDeposited.Text    = obj.DateDeposited.ToShortDateString();
                    this.lblBags.Text             = obj.TotalNumberOfBags.ToString();
                    this.lblGrossWeight.Text      = obj.GrossWeight.ToString();
                    this.lblNetWeight.Text        = obj.NetWeight.ToString();
                    this.lblOriginalQuantity.Text = obj.OriginalQuantity.ToString();
                    this.lblCurrentQuantity.Text  = obj.CurrentQuantity.ToString();
                    lblGRNCreatedDate.Text        = obj.GRNCreatedDate.ToShortDateString();
                    cmpSampGen.ValueToCompare     = obj.CreatedTimestamp.ToShortDateString();
                    this.lblCommodityGrade.Text   = CommodityGradeBLL.GetCommodityGradeNameById(obj.CommodityGradeId);
                    ClientBLL objClient = new ClientBLL();
                    //objClient = ClientBLL.GetClinet(obj.ClientId);
                    //this.lblClinet.Text = objClient.ClientName;
                    LoadSampling(obj.GradingId);
                    LoadGrading(obj.GradingId);
                    LoadDepositeRequest(obj.CommodityRecivingId);
                    this.cboGRNType.SelectedValue = obj.GRNTypeId.ToString();
                    BagTypeBLL objBag = new BagTypeBLL();
                    objBag.GetBagTypeById(obj.BagTypeId);
                    this.lblBagType.Text         = objBag.BagTypeName;
                    this.cboStatus.SelectedValue = obj.Status.ToString();
                    if (obj.ClientAccepted == true)
                    {
                        this.cboClientAccpted.SelectedValue = "1";
                    }
                    else
                    {
                        this.cboClientAccpted.SelectedValue = "2";
                    }
                    this.txtClientAcceptedTimeStamp.Text = obj.ClientAcceptedTimeStamp.ToString();
                    this.hfStatus.Value = obj.Status.ToString();
                    if (this.cboStatus.SelectedValue == "4" && this.cboStatus.SelectedValue == "5" && this.cboStatus.SelectedValue == "6")
                    {
                        this.cboStatus.Enabled                  = false;
                        this.cboClientAccpted.Enabled           = false;
                        this.btnAdd.Enabled                     = false;
                        this.txtClientAcceptedTimeStamp.Enabled = false;
                        this.txtClientAcceptedTimeStamp.Visible = false;
                        this.cboClientAccpted.Visible           = false;
                        this.btnAdd.Visible                     = false;
                        this.lblmsg.Text = "The Client can not accpet or reject this GRN as the status of the GRN is not new or approved.";
                    }
                }
            }
        }
示例#2
0
        private void LoadGRNInformation(Guid GRNId)
        {
            LoadGRNType();
            GRNBLL obj = new GRNBLL();

            obj = obj.GetbyGRN_Number(GRNId);
            if (obj != null)
            {
                if (obj.GRN_Number != "")
                {
                    this.hfGRNId.Value      = obj.Id.ToString();
                    this.lblGRN.Text        = obj.GRN_Number;
                    this.lblTrackingNo.Text = obj.TrackingNo;
                    //this.lblProductionYear.Text = obj.ProductionYear.ToString();
                    this.lblCode.Text             = obj.GradingCode;
                    this.lblDateDeposited.Text    = obj.DateDeposited.ToShortDateString();
                    this.lblBags.Text             = obj.TotalNumberOfBags.ToString();
                    this.lblGrossWeight.Text      = obj.GrossWeight.ToString();
                    this.lblNetWeight.Text        = obj.NetWeight.ToString();
                    this.lblOriginalQuantity.Text = obj.OriginalQuantity.ToString();
                    this.lblCurrentQuantity.Text  = obj.CurrentQuantity.ToString();
                    this.lblCommodityGrade.Text   = CommodityGradeBLL.GetCommodityGradeNameById(obj.CommodityGradeId);
                    ClientBLL objClient = new ClientBLL();
                    LoadSampling(obj.GradingId);
                    LoadGrading(obj.GradingId);
                    LoadDepositeRequest(obj.CommodityRecivingId);
                    GetGRNServices(GRNId);
                    this.cboGRNType.SelectedValue = obj.GRNTypeId.ToString();
                    BagTypeBLL objBag = new BagTypeBLL();
                    objBag.GetBagTypeById(obj.BagTypeId);
                    this.lblBagType.Text = objBag.BagTypeName;
                    this.hfStatus.Value  = obj.Status.ToString();
                    if (obj.ClientAcceptedTimeStamp != null)
                    {
                        this.txtClientAcceptedTimeStamp.Text = obj.ClientAcceptedTimeStamp.ToShortDateString();
                    }
                    this.chkClientAccepted.Checked = obj.ClientAccepted;
                    if (this.chkClientAccepted.Checked != true)
                    {
                        //TOdo- GRN Statas.
                    }
                    if (this.cboStatus.SelectedValue == "6" || this.cboStatus.SelectedValue == "3")
                    {
                        this.cboStatus.Enabled = false;
                        this.btnAdd.Enabled    = false;
                    }
                }
            }
        }
示例#3
0
        private void LoadUnloading(Guid GradingId)
        {
            UnloadingBLL objUnloading = new UnloadingBLL();

            objUnloading = objUnloading.GetApprovedUnloadingByGradingId(GradingId);
            if (objUnloading != null)
            {
                this.lblBags.Text          = objUnloading.TotalNumberOfBags.ToString();
                this.lblDateDeposited.Text = objUnloading.DateDeposited.ToShortDateString();
                this.hfBagTypeId.Value     = objUnloading.BagTypeId.ToString();
                this.hfUnloadingId.Value   = objUnloading.Id.ToString();
                //Get Bag Info
                BagTypeBLL objBagType = new BagTypeBLL();
                if (string.IsNullOrEmpty(objUnloading.BagTypeId.ToString()) != true)
                {
                    objBagType.GetBagTypeById(objUnloading.BagTypeId);
                    if (objBagType != null)
                    {
                        if (objBagType.BagTypeName != "")
                        {
                            this.lblBagType.Text = objBagType.BagTypeName.ToString();
                        }
                        else
                        {
                            this.lblmsg.Text = "Unable To get Bag Type";
                            return;
                        }
                    }
                    else
                    {
                        this.lblmsg.Text = "Unable To get Bag Type";
                        return;
                    }
                }
            }
        }
示例#4
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;
        }