Esempio n. 1
0
        void txtBookingNo_TextChanged(object sender, EventArgs e)
        {
            int Status;

            if (!string.IsNullOrEmpty(txtBookingNo.Text))
            {
                if (ExportBLBLL.CheckBookingLocation(txtBookingNo.Text, _userLocation) == true)
                {
                    Status = ExportBLBLL.CheckExpBLExistance(txtBookingNo.Text);
                    if (Status != 0)
                    {
                        LoadExportBLHeaderForAdd(txtBookingNo.Text, Status);
                        lblErr.Text = "";
                    }
                    else
                    {
                        lblErr.Text = "Error!!! Container(s) Missing or B/L Exists against Booking";
                        return;
                    }
                }
                else
                {
                    rfvBookingNo.Visible = true;
                }
            }
        }
Esempio n. 2
0
        private void LoadExportBL()
        {
            if (!ReferenceEquals(Session[Constants.SESSION_USER_INFO], null))
            {
                IUser user = (IUser)Session[Constants.SESSION_USER_INFO];

                if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null))
                {
                    SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA];

                    if (!ReferenceEquals(searchCriteria, null))
                    {
                        BuildSearchCriteria(searchCriteria);

                        gvExportBL.PageIndex = searchCriteria.PageIndex;

                        if (searchCriteria.PageSize > 0)
                        {
                            gvExportBL.PageSize = searchCriteria.PageSize;
                        }

                        gvExportBL.DataSource = ExportBLBLL.GetExportBLForListing(searchCriteria);
                        gvExportBL.DataBind();
                    }
                }
            }
        }
Esempio n. 3
0
        protected void btnClose_Click(object sender, EventArgs e)
        {
            long exportBLId = 0;

            exportBLId = Convert.ToInt64(ViewState["BLID"]);

            ExportBLBLL.CloseOpenBL(exportBLId, _userId, btnClose.Text);
            Response.Redirect("~/Export/ExportBL.aspx");
        }
Esempio n. 4
0
        protected void gvExportBL_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("Sort"))
            {
                if (ViewState[Constants.SORT_EXPRESSION] == null)
                {
                    ViewState[Constants.SORT_EXPRESSION] = e.CommandArgument.ToString();
                    ViewState[Constants.SORT_DIRECTION]  = "ASC";
                }
                else
                {
                    if (ViewState[Constants.SORT_EXPRESSION].ToString() == e.CommandArgument.ToString())
                    {
                        if (ViewState[Constants.SORT_DIRECTION].ToString() == "ASC")
                        {
                            ViewState[Constants.SORT_DIRECTION] = "DESC";
                        }
                        else
                        {
                            ViewState[Constants.SORT_DIRECTION] = "ASC";
                        }
                    }
                    else
                    {
                        ViewState[Constants.SORT_DIRECTION]  = "ASC";
                        ViewState[Constants.SORT_EXPRESSION] = e.CommandArgument.ToString();
                    }
                }

                LoadExportBL();
            }
            else if (e.CommandName == "Edit")
            {
                RedirecToAddEditPage(Convert.ToString(e.CommandArgument));
            }
            else if (e.CommandName == "Dashboard")
            {
                string encryptedId = GeneralFunctions.EncryptQueryString(Convert.ToString(e.CommandArgument));
                Response.Redirect("~/Export/Export-bl-query.aspx?BLNumber=" + encryptedId);
            }
            else if (e.CommandName == "RemoveData")
            {
                bool IsActive = false;

                //if (((System.Web.UI.WebControls.LinkButton)(e.CommandSource)).Text == "Active")
                //    IsActive = false;
                //else
                //    IsActive = true;

                //Active/InActive
                ExportBLBLL.ChangeBLStatus(Convert.ToString(e.CommandArgument), IsActive);

                LoadExportBL();
            }
        }
Esempio n. 5
0
        private void SaveExportBLContainers(long exportBLId)
        {
            List <IExportBLContainer> lstData = new List <IExportBLContainer>();

            int totalRows = gvwContainers.Rows.Count;

            for (int r = 0; r < totalRows; r++)
            {
                GridViewRow thisGridViewRow = gvwContainers.Rows[r];
                HiddenField hdnContainerId  = (HiddenField)thisGridViewRow.FindControl("hdnContainerId");

                DropDownList ddlPart               = (DropDownList)thisGridViewRow.FindControl("ddlPart");
                DropDownList ddlUnit               = (DropDownList)thisGridViewRow.FindControl("ddlUnit");
                TextBox      txtSealNo             = (TextBox)thisGridViewRow.FindControl("txtSealNo");
                TextBox      txtPackage            = (TextBox)thisGridViewRow.FindControl("txtPackage");
                TextBox      txtGrossWeight        = (TextBox)thisGridViewRow.FindControl("txtGrossWeight");
                TextBox      txtShippingBillNumber = (TextBox)thisGridViewRow.FindControl("txtShippingBillNumber");
                TextBox      txtShippingBillDate   = (TextBox)thisGridViewRow.FindControl("txtShippingBillDate");

                lstData = ViewState["DataSource"] as List <IExportBLContainer>;

                lstData.Where(d => d.ContainerId == Convert.ToInt64(hdnContainerId.Value))
                .Select(d =>
                {
                    d.BLId               = exportBLId;
                    d.BookingId          = Convert.ToInt64(ViewState["BOOKINGID"]);
                    d.Part               = Convert.ToBoolean(ddlPart.SelectedValue);
                    d.Unit               = ddlUnit.SelectedValue;
                    d.SealNumber         = txtSealNo.Text.Trim();
                    d.Package            = Convert.ToInt32(txtPackage.Text);
                    d.GrossWeight        = Convert.ToDecimal(txtGrossWeight.Text);
                    d.ShippingBillNumber = txtShippingBillNumber.Text.Trim();
                    if (txtShippingBillDate.Text != string.Empty)
                    {
                        d.ShippingBillDate = Convert.ToDateTime(txtShippingBillDate.Text.Trim());
                    }
                    else
                    {
                        d.ShippingBillDate = null;
                    }
                    return(d);
                }).ToList();
            }

            if (!Convert.ToBoolean(ViewState["ISEDIT"]))
            {
                ExportBLBLL.InsertBLContainers(lstData);
            }
            else
            {
                ExportBLBLL.UpdateBLContainers(lstData);
            }

            ViewState["DataSource"] = lstData;
        }
Esempio n. 6
0
        private void LoadShipmentModeDDL()
        {
            DataTable dt = ExportBLBLL.GetShipmentModes();

            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow dr = dt.NewRow();
                dr["ModeId"]   = "0";
                dr["ModeName"] = "--Select--";
                dt.Rows.InsertAt(dr, 0);

                ddlShipmentMode.DataValueField = "ModeId";
                ddlShipmentMode.DataTextField  = "ModeName";
                ddlShipmentMode.DataSource     = dt;
                ddlShipmentMode.DataBind();
            }
        }
Esempio n. 7
0
        private void LoadDeliveryAgentDDL(int FPOD)
        {
            DataTable dt = ExportBLBLL.GetDeliveryAgents(FPOD);

            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow dr = dt.NewRow();
                dr["AgentId"]   = "0";
                dr["AgentName"] = "--Select--";
                dt.Rows.InsertAt(dr, 0);

                ddlAgent.DataValueField = "AgentId";
                ddlAgent.DataTextField  = "AgentName";
                ddlAgent.DataSource     = dt;
                ddlAgent.DataBind();
            }
        }
Esempio n. 8
0
        private long SaveExportBLHeaderDetails()
        {
            IExportBL objBL = new ExportBLEntity();

            long exportBLId = 0;

            if (ddlBLClause.SelectedValue == "R" && txtBLReleaseDate.Text == string.Empty)
            {
                lblErr.Text = "RFS date is compulsory";
                return(0);
            }

            if (!Convert.ToBoolean(ViewState["ISEDIT"]))
            {
                objBL.BLId = 0;
            }
            else
            {
                objBL.BLId = Convert.ToInt64(ViewState["BLID"]);
            }

            objBL.LocationId     = Convert.ToInt32(ViewState["LOCATIONID"]);
            objBL.NvoccId        = Convert.ToInt32(ViewState["NVOCCID"]);
            objBL.BookingId      = Convert.ToInt64(ViewState["BOOKINGID"]);
            objBL.BLIssuePlaceId = Convert.ToInt32(ViewState["BLISSUEID"]);

            if (hdnBLThruEdge.Value == "1")
            {
                objBL.BLNumber   = string.Empty;
                objBL.BLthruEdge = true;
            }
            else
            {
                objBL.BLNumber   = txtBLNo.Text;
                objBL.BLthruEdge = false;
            }
            objBL.BLDate          = Convert.ToDateTime(txtBLDate.Text.Trim());
            objBL.PORDesc         = txtPorDesc.Text.Trim();
            objBL.POLDesc         = txtPolDesc.Text.Trim();
            objBL.PODDesc         = txtPodDesc.Text.Trim();
            objBL.FPODDesc        = txtFPodDesc.Text.Trim();
            objBL.BLIssuePlace    = ((TextBox)txtIssuePlace.FindControl("txtPort")).Text.Trim();
            objBL.ShipperName     = txtShipperName.Text.Trim();
            objBL.Shipper         = txtShipper.Text.Trim();
            objBL.ConsigneeName   = txtConsigneeName.Text.Trim();
            objBL.Consignee       = txtConsignee.Text.Trim();
            objBL.NotifyPartyName = txtNotifyName.Text.Trim();
            objBL.NotifyParty     = txtNotify.Text.Trim();
            objBL.GoodDesc        = txtGoodsDescription.Text.Trim();
            objBL.MarksNumnbers   = txtMarks.Text.Trim();
            objBL.ShipmentMode    = Convert.ToInt32(ddlShipmentMode.SelectedValue);
            objBL.AgentId         = Convert.ToInt32(ddlAgent.SelectedValue);
            objBL.CreatedBy       = _userId;
            objBL.CreatedOn       = DateTime.Now;
            objBL.ModifiedBy      = _userId;
            objBL.ModifiedOn      = DateTime.Now;
            objBL.BLClause        = ddlBLClause.SelectedValue;
            objBL.BLType          = rdoBLType.SelectedValue;
            objBL.NoOfBL          = Convert.ToInt32(rdoOriginal.SelectedValue);
            objBL.NetWeight       = Convert.ToDecimal(TxtNtWt.Text.Trim());
            objBL.GrossWeight     = Convert.ToDecimal(txtNetWt.Text.Trim());

            //objBL.NetWeight = Convert.ToDecimal(txtNetWt.Text.Trim());
            if (ddlBLClause.SelectedValue == "R")
            {
                objBL.BLReleaseDate = Convert.ToDateTime(txtBLReleaseDate.Text.Trim());
            }
            else
            {
                objBL.BLReleaseDate = null;
            }

            exportBLId = ExportBLBLL.SaveExportBLHeader(objBL);

            return(exportBLId);
        }
Esempio n. 9
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;
            }
        }
Esempio n. 10
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;
            }
        }
Esempio n. 11
0
        private void LoadExportBLContainers(long BookingId, long BLId, int Status)
        {
            try
            {
                bool isEdit = Convert.ToBoolean(ViewState["ISEDIT"]);

                List <IExportBLContainer> objData = new List <IExportBLContainer>();

                if (!ReferenceEquals(ViewState["DataSource"], null) && ((List <IExportBLContainer>)(ViewState["DataSource"])).Count > 0)
                {
                    objData = ViewState["DataSource"] as List <IExportBLContainer>;
                }
                else
                {
                    if (!isEdit)
                    {
                        objData = ExportBLBLL.GetExportBLContainersForAdd(BookingId, Status);
                        if (ExportBLBLL.CheckBookingBLContainer(BookingId, Status) == false && objData.Count() > 0)
                        {
                            btnSave.Visible = false;
                        }
                        else
                        if (_canEdit == true)
                        {
                            btnSave.Visible = true;
                        }
                        else
                        {
                            btnSave.Visible = false;
                        }
                    }
                    else
                    {
                        objData = ExportBLBLL.GetExportBLContainersForEdit(BLId);
                    }
                }

                //objData = objData.Where(d => d.IsDeleted == false).ToList();
                ViewState["DataSource"] = objData;

                gvwContainers.DataSource = objData;
                gvwContainers.DataBind();

                List <Unit> lstUnit = new List <Unit>();
                DataTable   dtUnits = ExportBLBLL.GetUnitsForExportBlContainer();

                foreach (DataRow dr in dtUnits.Rows)
                {
                    lstUnit.Add(new Unit {
                        Value = dr[0].ToString(), Text = dr[1].ToString()
                    });
                }
                if (hdnShipmentType.Value.ToString() == "0")
                {
                    txtNetWt.Text = objData.Where(o => o.IsDeleted == false).Sum(o => o.GrossWeight).ToString(); // + " " + lstUnit.Where(u => u.Value == objData[0].Unit).ToList()[0].Text;
                }
                txtContainers.Text = objData.Where(o => o.IsDeleted == false).Where(o => o.ContainerSize == "20").Count().ToString() + " x 20 - " + objData.Where(o => o.IsDeleted == false).Where(o => o.ContainerSize == "40").Count().ToString() + " x 40";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        protected void gvwContainers_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //Part
                List <Part> lstPart = new List <Part>();
                lstPart.Add(new Part {
                    Text = "Yes", Value = "True"
                });
                lstPart.Add(new Part {
                    Text = "No", Value = "False"
                });

                // Bind drop down to Part
                DropDownList ddlPart = (DropDownList)e.Row.FindControl("ddlPart");
                ddlPart.DataTextField  = "Text";
                ddlPart.DataValueField = "Value";
                ddlPart.DataSource     = lstPart;
                ddlPart.DataBind();

                IExportBLContainer cntr = e.Row.DataItem as IExportBLContainer;
                ddlPart.SelectedValue = cntr.Part.ToString();

                if (cntr.Part)
                {
                    ddlPart.Enabled = false;
                }
                else
                {
                    ddlPart.Enabled = true;
                }

                //Unit
                List <Unit> lstUnit = new List <Unit>();
                DataTable   dtUnits = ExportBLBLL.GetUnitsForExportBlContainer();

                foreach (DataRow dr in dtUnits.Rows)
                {
                    lstUnit.Add(new Unit {
                        Value = dr[0].ToString(), Text = dr[1].ToString()
                    });
                }

                DropDownList ddlUnit = (DropDownList)e.Row.FindControl("ddlUnit");
                ddlUnit.DataTextField  = "Text";
                ddlUnit.DataValueField = "Value";
                ddlUnit.DataSource     = lstUnit;
                ddlUnit.DataBind();
                if (cntr.Unit.ToString() != null)
                {
                    ddlUnit.SelectedValue = cntr.Unit.ToString();
                }

                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");

                if ((e.Row.DataItem as IExportBLContainer).IsDeleted)
                {
                    btnRemove.ImageUrl = "~/Images/undelete.png";
                    btnRemove.Attributes.Add("onclick", "javascript:return confirm('Are you sure about undelete?');");
                    btnRemove.CommandName = "UnDelete";
                    btnRemove.ToolTip     = "Undelete";
                }
                else
                {
                    btnRemove.ImageUrl = "~/Images/remove.png";
                    btnRemove.Attributes.Add("onclick", "javascript:return confirm('Are you sure about delete?');");
                    btnRemove.CommandName = "Delete";
                    btnRemove.ToolTip     = "Delete";
                }
            }
        }