public SirovinaCena(IKategorijaZivotinjaSmesaPotrosnjaBL kategorijaZivotinjaSmesaPotrosnjaBL, IExportBL exportBL, string smesaNaziv, string kalkulacijaNaziv)
        {
            InitializeComponent();
            dgvSirovinaCena1.RowPrePaint += dgvSirovinaCena1_RowPrePaint;
            dgvSirovinaCena2.RowPrePaint += dgvSirovinaCena1_RowPrePaint;
            dgvSirovinaCena3.RowPrePaint += dgvSirovinaCena1_RowPrePaint;

            _kategorijaZivotinjaSmesaPotrosnjaBL = kategorijaZivotinjaSmesaPotrosnjaBL;
            _exportBL         = exportBL;
            _smesaNaziv       = smesaNaziv;
            _kalkulacijaNaziv = kalkulacijaNaziv;
        }
Example #2
0
 public Main(ISirovinaBL sirovinaBL, INutritivniElementVrednostBL nutritivniElementVrednostBL, ISmesaBL smesaBL, ITipSirovineBL tipSirovineBL, IJmBL jmBL, ISirovinaNutritivniElementVrednostBL sirovinaNutritivniElementVrednostBL, IKalkulacijaBL kalkulacijaBL, IKalkulacijaViewBL kalkulacijaViewBL, IKategorijaZivotinjaSmesaPotrosnjaBL kategorijaZivotinjaSmesaPotrosnjaBL, IExportBL exportBL, ISmesaNutritivniElementVrednostBL smesaNutritivniElementVrednostBL, IKategorijaZivotinjaBL kategorijaZivotinjaBL)
 {
     InitializeComponent();
     _sirovinaBL = sirovinaBL;
     _nutritivniElementVrednostBL = nutritivniElementVrednostBL;
     _smesaBL       = smesaBL;
     _tipSirovineBL = tipSirovineBL;
     _jmBL          = jmBL;
     _sirovinaNutritivniElementVrednostBL = sirovinaNutritivniElementVrednostBL;
     _kalkulacijaBL     = kalkulacijaBL;
     _kalkulacijaViewBL = kalkulacijaViewBL;
     _kategorijaZivotinjaSmesaPotrosnjaBL = kategorijaZivotinjaSmesaPotrosnjaBL;
     _exportBL = exportBL;
     _smesaNutritivniElementVrednostBL = smesaNutritivniElementVrednostBL;
     _kategorijaZivotinjaBL            = kategorijaZivotinjaBL;
 }
Example #3
0
        public static long SaveExportBLHeader(IExportBL objBL)
        {
            long   exportBLId   = 0;
            string strExecution = "[exp].[usp_ExportBLHeader_Save]";

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddBigIntegerParam("@BLId", objBL.BLId);
                oDq.AddIntegerParam("@LocationId", objBL.LocationId);
                oDq.AddBigIntegerParam("@NvoccId", objBL.NvoccId);
                oDq.AddBigIntegerParam("@BookingId", objBL.BookingId);
                oDq.AddIntegerParam("@BLIssuePlaceId", objBL.BLIssuePlaceId);
                oDq.AddVarcharParam("@BLNumber", 60, objBL.BLNumber);
                oDq.AddDateTimeParam("@BLDate", objBL.BLDate);
                oDq.AddVarcharParam("@PORDesc", 25, objBL.PORDesc);
                oDq.AddVarcharParam("@POLDesc", 25, objBL.POLDesc);
                oDq.AddVarcharParam("@PODDesc", 25, objBL.PODDesc);
                oDq.AddVarcharParam("@FPODDesc", 25, objBL.FPODDesc);
                oDq.AddVarcharParam("@ShipperName", 100, objBL.ShipperName);
                oDq.AddVarcharParam("@Shipper", 300, objBL.Shipper);
                oDq.AddVarcharParam("@ConsigneeName", 100, objBL.ConsigneeName);
                oDq.AddVarcharParam("@Consignee", 300, objBL.Consignee);
                oDq.AddVarcharParam("@NotifyPartyName", 100, objBL.NotifyPartyName);
                oDq.AddVarcharParam("@NotifyParty", 300, objBL.NotifyParty);
                oDq.AddVarcharParam("@GoodDesc", 2000, objBL.GoodDesc);
                oDq.AddVarcharParam("@MarksNumnbers", 300, objBL.MarksNumnbers);
                oDq.AddIntegerParam("@ShipmentMode", objBL.ShipmentMode);
                oDq.AddIntegerParam("@AgentId", objBL.AgentId);
                //oDq.AddVarcharParam("@RateType", 20, objBL.); // BL Status
                //oDq.AddVarcharParam("@RateType", 20, objBL.); // Export BL Status
                oDq.AddIntegerParam("@CreatedBy", objBL.CreatedBy);
                oDq.AddDateTimeParam("@CreatedOn", objBL.CreatedOn);
                oDq.AddIntegerParam("@ModifiedBy", objBL.ModifiedBy);
                oDq.AddDateTimeParam("@ModifiedOn", objBL.ModifiedOn);
                oDq.AddVarcharParam("@BLClause", 20, objBL.BLClause);
                oDq.AddVarcharParam("@BLType", 20, objBL.BLType);
                oDq.AddIntegerParam("@NoOfBL", objBL.NoOfBL);
                oDq.AddDecimalParam("@NetWeight", 12, 3, objBL.NetWeight);
                oDq.AddDecimalParam("@GrossWeight", 12, 3, objBL.GrossWeight);
                oDq.AddDateTimeParam("@BLReleaseDate", objBL.BLReleaseDate);
                oDq.AddBooleanParam("@BLThruEdge", objBL.BLthruEdge);

                exportBLId = Convert.ToInt64(oDq.GetScalar());
                return(exportBLId);
            }
        }
Example #4
0
 public static long SaveExportBLHeader(IExportBL objBL)
 {
     return(ExportBLDAL.SaveExportBLHeader(objBL));
 }
Example #5
0
        private void LoadExportBLHeaderForEdit(string BLNumber)
        {
            try
            {
                IExportBL exportBL = ExportBLBLL.GetExportBLHeaderInfoForEdit(BLNumber);
                LoadDeliveryAgentDDL(exportBL.fk_FPOD);
                if (!ReferenceEquals(exportBL, null))
                {
                    txtBookingNo.Text         = exportBL.BookingNumber;
                    ViewState["BOOKINGID"]    = exportBL.BookingId;
                    txtBookingDate.Text       = exportBL.BookingDate.ToString("dd-MM-yyyy");
                    txtBLDate.Enabled         = false;
                    txtBLNo.Text              = exportBL.BLNumber;
                    ViewState["BLID"]         = exportBL.BLId;
                    txtBLDate.Text            = exportBL.BLDate.ToString("dd-MM-yyyy");
                    txtBookingParty.Text      = exportBL.BookingParty;
                    txtRefBookingNo.Text      = exportBL.RefBookingNumber;
                    txtLocation.Text          = exportBL.Location;
                    ViewState["LOCATIONID"]   = exportBL.LocationId;
                    txtLine.Text              = exportBL.Nvocc;
                    ViewState["NVOCCID"]      = exportBL.NvoccId;
                    txtVessel.Text            = exportBL.Vessel;
                    ViewState["VESSELID"]     = exportBL.VesselId;
                    txtVoyage.Text            = exportBL.Voyage;
                    ViewState["VOYAGEID"]     = exportBL.VoyageId;
                    txtPOR.Text               = exportBL.POR;
                    txtPorDesc.Text           = exportBL.PORDesc;
                    txtPOL.Text               = exportBL.POL;
                    txtPolDesc.Text           = exportBL.POLDesc;
                    txtPOD.Text               = exportBL.POD;
                    txtPodDesc.Text           = exportBL.PODDesc;
                    txtFPOD.Text              = exportBL.FPOD;
                    txtFPodDesc.Text          = exportBL.FPODDesc;
                    txtCommodity.Text         = exportBL.Commodity;
                    txtContainers.Text        = exportBL.Containers;
                    rdoOriginal.SelectedValue = exportBL.NoOfBL.ToString();
                    hdnShipmentType.Value     = exportBL.ShipmentType.ToString();
                    ddlBLClause.SelectedValue = exportBL.BLClause;
                    if (exportBL.BLthruEdge == true)
                    {
                        hdnBLThruEdge.Value = "1";
                    }
                    else
                    {
                        hdnBLThruEdge.Value = "0";
                    }

                    if (exportBL.ShipmentType != 0)
                    {
                        txtNetWt.Enabled = true;
                        txtNetWt.Text    = exportBL.GrossWeight.ToString();
                    }
                    if (ddlBLClause.SelectedValue == "R")
                    {
                        if (!ReferenceEquals(Session[Constants.SESSION_USER_INFO], null))
                        {
                            IUser user = (IUser)Session[Constants.SESSION_USER_INFO];
                            if (user.UserRole.Id == (int)UserRole.Admin)
                            {
                                btnClose.Visible = true;
                                if (exportBL.CloseBL == true)
                                {
                                    btnClose.Text = "Open";
                                }
                                else
                                {
                                    btnClose.Text = "Close";
                                }
                            }
                            else
                            {
                                btnClose.Visible = false;
                            }
                        }
                        txtBLReleaseDate.Enabled = true;
                    }
                    else
                    {
                        txtBLReleaseDate.Enabled = false;
                        btnClose.Visible         = false;
                    }

                    rdoBLType.SelectedValue       = exportBL.BLType;
                    ddlShipmentMode.SelectedValue = exportBL.ShipmentMode.ToString();
                    ((TextBox)txtIssuePlace.FindControl("txtPort")).Text = exportBL.BLIssuePlace;
                    ViewState["BLISSUEID"] = exportBL.BLIssuePlaceId;
                    TxtNtWt.Text           = exportBL.NetWeight.ToString();
                    txtBLReleaseDate.Text  = exportBL.BLReleaseDate.ToString();
                    if (hdnBLThruEdge.Value == "" || hdnBLThruEdge.Value == "0")
                    {
                        txtBLNo.Enabled             = true;
                        rfvShipperName.Enabled      = false;
                        rfvConsigneeName.Enabled    = false;
                        rfvGoodsDescription.Enabled = false;
                        rfvMarks.Enabled            = false;
                        rfvNotify.Enabled           = false;
                        rfvAgent.Enabled            = false;
                    }
                    else
                    {
                        txtBLNo.Enabled             = false;
                        rfvShipperName.Enabled      = true;
                        rfvConsigneeName.Enabled    = true;
                        rfvGoodsDescription.Enabled = true;
                        rfvMarks.Enabled            = true;
                        rfvNotify.Enabled           = true;
                        rfvAgent.Enabled            = true;
                    }
                    txtShipperName.Text   = exportBL.ShipperName;
                    txtShipper.Text       = exportBL.Shipper;
                    txtConsignee.Text     = exportBL.Consignee;
                    txtConsigneeName.Text = exportBL.ConsigneeName;
                    txtNotify.Text        = exportBL.NotifyParty;
                    txtNotifyName.Text    = exportBL.NotifyPartyName;

                    txtGoodsDescription.Text = exportBL.GoodDesc;
                    txtMarks.Text            = exportBL.MarksNumnbers;
                    ddlAgent.SelectedValue   = exportBL.AgentId.ToString();

                    txtCBookingNo.Text   = exportBL.BookingNumber;
                    txtCBookingDate.Text = exportBL.BookingDate.ToString("dd-MM-yyyy");
                    txtCBLNo.Text        = exportBL.BLNumber;
                    txtCBLDate.Text      = exportBL.BLDate.ToString("dd-MM-yyyy");
                    txtTon.Text          = exportBL.TotalTon;
                    txtCbm.Text          = exportBL.TotalCBM;

                    if (exportBL.TotalTEU != null)
                    {
                        txtTeu.Text = exportBL.TotalTEU.ToString();
                    }
                    else
                    {
                        txtTeu.Text = "0";
                    }

                    if (exportBL.TotalFEU != null)
                    {
                        txtFeu.Text = exportBL.TotalFEU.ToString();
                    }
                    else
                    {
                        txtFeu.Text = "0";
                    }

                    if (exportBL.CloseVoyage == true)
                    {
                        btnSave.Visible = false;
                    }

                    if (exportBL.CloseBL == true)
                    {
                        btnSave.Visible = false;
                    }

                    LoadExportBLContainers(0, exportBL.BLId, 0);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #6
0
        private void LoadExportBLHeaderForAdd(string BookingNumber, int Status)
        {
            try
            {
                IExportBL exportBL = ExportBLBLL.GetExportBLHeaderInfoForAdd(BookingNumber);

                if (!ReferenceEquals(exportBL, null))
                {
                    if (exportBL.BookingId != 0)
                    {
                        ViewState["BOOKINGID"] = exportBL.BookingId;
                        txtBookingDate.Text    = exportBL.BookingDate.ToString("dd-MM-yyyy");
                        txtBLDate.Text         = exportBL.BLDate.ToString("dd-MM-yyyy");
                        //txtBLDate.Text = DateTime.Now.ToString("dd-MM-yyyy");
                        txtBLDate.Enabled       = false;
                        txtBookingParty.Text    = exportBL.BookingParty;
                        txtRefBookingNo.Text    = exportBL.RefBookingNumber;
                        txtLocation.Text        = exportBL.Location;
                        ViewState["LOCATIONID"] = exportBL.LocationId;
                        txtLine.Text            = exportBL.Nvocc;
                        ViewState["NVOCCID"]    = exportBL.NvoccId;
                        txtVessel.Text          = exportBL.Vessel;
                        ViewState["VESSELID"]   = exportBL.VesselId;
                        txtVoyage.Text          = exportBL.Voyage;
                        ViewState["VOYAGEID"]   = exportBL.VoyageId;
                        txtPOR.Text             = exportBL.POR;
                        txtPorDesc.Text         = exportBL.PORDesc;
                        txtPOL.Text             = exportBL.POL;
                        txtPolDesc.Text         = exportBL.POLDesc;
                        txtPOD.Text             = exportBL.POD;
                        txtPodDesc.Text         = exportBL.PODDesc;
                        txtFPOD.Text            = exportBL.FPOD;
                        txtFPodDesc.Text        = exportBL.FPODDesc;
                        txtCommodity.Text       = exportBL.Commodity;
                        hdnShipmentType.Value   = exportBL.ShipmentType.ToString();
                        LoadDeliveryAgentDDL(exportBL.fk_FPOD);
                        txtBLReleaseDate.Enabled = false;

                        if (exportBL.BLthruEdge == false)
                        {
                            hdnBLThruEdge.Value = "0";
                            txtBLNo.Enabled     = true;
                            //rfvShipper.Enabled = false;
                            rfvShipperName.Enabled = false;
                            //rfvConsignee.Enabled = false;
                            rfvConsigneeName.Enabled    = false;
                            rfvGoodsDescription.Enabled = false;
                            rfvMarks.Enabled            = false;
                            rfvNotify.Enabled           = false;
                            //rfvNotifyName.Enabled = false;
                            rfvAgent.Enabled = false;
                        }
                        else
                        {
                            txtBLNo.Enabled     = false;
                            hdnBLThruEdge.Value = "1";
                            //rfvShipper.Enabled = true;
                            rfvShipperName.Enabled = true;
                            //rfvConsignee.Enabled = true;
                            rfvConsigneeName.Enabled    = true;
                            rfvGoodsDescription.Enabled = true;
                            rfvMarks.Enabled            = true;
                            rfvNotify.Enabled           = true;
                            //rfvNotifyName.Enabled = true;
                            rfvAgent.Enabled = true;
                        }
                        txtCBookingNo.Text   = exportBL.BookingNumber;
                        txtCBookingDate.Text = exportBL.BookingDate.ToString("dd-MM-yyyy");
                        txtCBLDate.Text      = txtBLDate.Text;
                        if (exportBL.ShipmentType != 0)
                        {
                            txtNetWt.Enabled = true;
                            txtNetWt.Text    = exportBL.GrossWeight.ToString();
                        }
                        if (exportBL.TotalTon != null)
                        {
                            txtTon.Text = exportBL.TotalTon;
                        }
                        else
                        {
                            txtTon.Text = "0";
                        }

                        if (exportBL.TotalCBM != null)
                        {
                            txtCbm.Text = exportBL.TotalCBM;
                        }
                        else
                        {
                            txtCbm.Text = "0";
                        }

                        if (exportBL.TotalTEU != null)
                        {
                            txtTeu.Text = exportBL.TotalTEU.ToString();
                        }
                        else
                        {
                            txtTeu.Text = "0";
                        }

                        if (exportBL.TotalFEU != null)
                        {
                            txtFeu.Text = exportBL.TotalFEU.ToString();
                        }
                        else
                        {
                            txtFeu.Text = "0";
                        }

                        LoadExportBLContainers(exportBL.BookingId, 0, Status);
                    }
                    else
                    {
                        rfvBookingNo.Visible = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }