Ejemplo n.º 1
0
        protected void gvwImportHaulage_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwImportHaulage.PageSize * gvwImportHaulage.PageIndex) + e.Row.RowIndex + 1).ToString();
                //e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Abbreviation"));

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocationFrom")); // +"<br/><font style='font-size:x-small;font-weight:bold;'>CODE : (" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LFCode")) + ")</font>";

                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocationTo"));   // +"<br/><font style='font-size:x-small;font-weight:bold;'>CODE : (" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LTCode")) + ")</font>";

                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LinerName"));

                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerSize"));

                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WeightFrom"));
                //e.Row.Cells[4].Text = Convert.ToString(Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "WeightFrom")));

                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WeightTo"));

                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "HaulageRate"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "HaulageChgID"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "HaulageChgID"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                }
            }
        }
Ejemplo n.º 2
0
        protected void gvwInvoice_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 5);

                ScriptManager sManager = ScriptManager.GetCurrent(this);
                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InvoiceNo"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InvoiceDate")).Split(' ')[0];
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DocType"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DocNo"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DocDate")).Split(' ')[0];
                //e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DocDate"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InvAmount"));
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "OnAcAmount"));
                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MRAmount"));
                e.Row.Cells[8].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CRNAmount"));
                e.Row.Cells[9].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SetAmount"));
                //e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PorR"));
                //e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SettlementAmount"));

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

                //btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_SettlementID"));
            }
        }
Ejemplo n.º 3
0
        protected void gvwContainerTran_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);
                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocName"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Line"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SettlementNo"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLNo"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SettlementDate")).Split(' ')[0];
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PorR"));
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SettlementAmount"));

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

                btnRemove.OnClientClick   = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_SettlementID"));
                btnEdit.CommandArgument   = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_SettlementID"));
                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }
            }
        }
Ejemplo n.º 4
0
        protected void gvwData_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 9);

                //ScriptManager sManager = ScriptManager.GetCurrent(this);

                //e.Row.Cells[0].Text = ((gvwData.PageSize * gvwData.PageIndex) + e.Row.RowIndex + 1).ToString();
                CheckBox chkSel = (CheckBox)e.Row.FindControl("chkSel");

                if (!ReferenceEquals(chkSel, null))
                {
                    if (rblTag.SelectedValue == "1")
                    {
                        chkSel.Checked = true;
                    }
                    else
                    {
                        chkSel.Checked = false;
                    }
                }

                ((HiddenField)e.Row.FindControl("hdnId")).Value = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TranId"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocationName"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ProspectName"));
                //e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingNo"));
                //e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLANumber"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VesselVoyage"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ShipperName"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PortName"));
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TEU"));
                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "FEU"));

                //if (DataBinder.Eval(e.Row.DataItem, "SOBDate") != DBNull.Value && DataBinder.Eval(e.Row.DataItem, "SOBDate") != null)
                //    e.Row.Cells[10].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "SOBDate"), _culture).ToString(Convert.ToString(ConfigurationManager.AppSettings["DateFormat"]));

                e.Row.Cells[8].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CustomerName"));

                //// Edit link
                //ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                //btnEdit.ToolTip = ResourceManager.GetStringWithoutName("ERR00008");
                //btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TranId"));

                ////Delete link
                //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                //btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TranId"));

                //if (_hasEditAccess)
                //{
                //    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";
                //}
                //else
                //{
                //    btnEdit.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                //    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                //}
            }
        }
Ejemplo n.º 5
0
        protected void gvwUser_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 9);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwUser.PageSize * gvwUser.PageIndex) + e.Row.RowIndex + 1).ToString();
                //e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));

                if (Convert.ToChar(DataBinder.Eval(e.Row.DataItem, "IsActive")) == 'Y')
                {
                    ((Label)e.Row.FindControl("lblName")).Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));
                    ((Label)e.Row.FindControl("lblInActive")).Style["display"] = "none";
                }
                else
                {
                    ((Label)e.Row.FindControl("lblName")).Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));
                    ((Label)e.Row.FindControl("lblInActive")).Style["display"] = "";
                }

                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "UserRole.Name"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "FirstName"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LastName"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "UserLocation.Name"));

                //Pwd Button
                LinkButton lnkPwd = (LinkButton)e.Row.FindControl("lnkPwd");
                lnkPwd.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));
                lnkPwd.OnClientClick   = "javascript:return confirm('Are you sure you want to reset password?');";

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00008");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id")) == "1")
                {
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00053") + "');return false;";
                }
                else
                {
                    if (_hasEditAccess)
                    {
                        btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";
                    }
                    else
                    {
                        btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                        btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                    }
                }
            }
        }
Ejemplo n.º 6
0
        protected void gvwCharge_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwCharge.PageSize * gvwCharge.PageIndex) + e.Row.RowIndex + 1).ToString();

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SlotOperator"));

                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "POL"));

                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "POD"));

                string Line = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Line"));
                if (Line != "0")
                {
                    e.Row.Cells[4].Text = ddlLine.Items.FindByValue(Line).Text;
                }

                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Terms"));

                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "EffectDate"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                //btnEdit.ToolTip = ResourceManager.GetStringWithoutName("ERR00008");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SlotId"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                //btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SlotId"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                }
            }
        }
Ejemplo n.º 7
0
        protected void gvInvoice_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 6);
                ScriptManager sManager = ScriptManager.GetCurrent(this);

                //e.Row.Cells[0].Text = ((gvImportBL.PageSize * gvImportBL.PageIndex) + e.Row.RowIndex + 1).ToString();

                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InvoiceNo"));
                e.Row.Cells[1].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "InvoiceDate")).ToShortDateString();
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ExportImport"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingID"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLNo"));
                e.Row.Cells[5].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "BLDate")).ToShortDateString();
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BillAmount"));

                //Edit Link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00070");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InvoiceID"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InvoiceID"));
            }
        }
Ejemplo n.º 8
0
        protected void gvwExch_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 5);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                DateTime dt            = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "ExchangeDate"), _culture);
                bool     isEarlierDate = (DateTime.Compare(dt, System.DateTime.Now.Date) < 0) ? true : false;

                e.Row.Cells[0].Text = ((gvwExch.PageSize * gvwExch.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = dt.ToString(Convert.ToString(ConfigurationManager.AppSettings["DateFormat"]));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "USDExchangeRate"));
                //e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "FreeDays"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ExchangeRateID"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ExchangeRateID"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (_canDelete)
                {
                    if (isEarlierDate) //No delete of exchange rate less than today’s date
                    {
                        btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00075") + "');return false;";
                    }
                    else
                    {
                        btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                    }
                }
                else
                {
                    //btnEdit.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                }
            }
        }
Ejemplo n.º 9
0
        protected void gvwCharge_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwCharge.PageSize * gvwCharge.PageIndex) + e.Row.RowIndex + 1).ToString();

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ChargeName"));

                //if (!string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ChargeType"))))
                //    e.Row.Cells[2].Text = ((Enums.ExportChargeType)Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "ChargeType"))).ToString();

                //string Loc = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Location"));
                //if (Loc != "0")
                //    e.Row.Cells[3].Text = ddlLocation.Items.FindByValue(Loc).Text;

                //e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Line"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ChargeAbbr"));

                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "EffectDate"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "STaxApplicable"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CurrencyCode"));
                //e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Service"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ChargeId"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ChargeId"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                }
                else
                {
                    btnRemove.Visible = false;
                }

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                }
            }
        }
Ejemplo n.º 10
0
        protected void gvVoyage_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 6);
                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvVoyage.PageSize * gvVoyage.PageIndex) + e.Row.RowIndex + 1).ToString();
                //need to be changed
                //e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TerminalID"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VesselName"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VoyageNo"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LoadPort"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "NextPort"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TerminalName"));

                //Edit Link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00070");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VoyageID"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VoyageID"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (DataBinder.Eval(e.Row.DataItem, "CloseVoyage").ToInt() == 1)
                {
                    if (_roleId != 2)
                    {
                        btnRemove.Visible = false;
                        btnEdit.Visible   = false;
                    }
                    e.Row.ForeColor = System.Drawing.Color.Red;
                    //e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
                }

                if (DataBinder.Eval(e.Row.DataItem, "DisplayDelete").ToInt() == 1)
                {
                    btnRemove.Visible = false;
                }
            }
        }
Ejemplo n.º 11
0
        protected void gvwLoc_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 3);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwLoc.PageSize * gvwLoc.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_RepairID"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerNo"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Line"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Location"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TransactionDate")).Split(' ')[0];
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MaterialEst"));
                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LabourEst"));
                e.Row.Cells[8].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "onHold"));
                e.Row.Cells[9].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Damaged"));



                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_RepairID"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_RepairID"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                }
            }
        }
Ejemplo n.º 12
0
        protected void gvwList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 10);
                e.Row.Cells[0].Text = ((gvwList.PageSize * gvwList.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocationName"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "NVOCCName"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingNumber"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingRef"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DeliveryOrderNumber"));
                e.Row.Cells[6].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "DeliveryOrderDate"), _culture).ToString(Convert.ToString(ConfigurationManager.AppSettings["DateFormat"]));
                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Containers"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DeliveryOrderId"));

                // Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");

                if (_canDelete)
                {
                    btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                    btnRemove.OnClientClick   = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                    btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DeliveryOrderId"));
                }
                else
                {
                    btnRemove.Style["display"] = "none";
                }
                if (DataBinder.Eval(e.Row.DataItem, "CloseVoyage").ToInt() == 1 && _roleId != 2)
                {
                    //btnCharge.Visible = false;
                    btnEdit.Visible   = false;
                    btnRemove.Visible = false;
                    e.Row.ForeColor   = System.Drawing.Color.Red;
                    //e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
                }

                // Print link

                ImageButton   btnPrint = (ImageButton)e.Row.FindControl("btnPrint");
                ScriptManager sManager = ScriptManager.GetCurrent(this);
                if (!ReferenceEquals(sManager, null))
                {
                    sManager.RegisterPostBackControl(btnPrint);
                }

                btnPrint.ToolTip         = ResourceManager.GetStringWithoutName("ERR00083");
                btnPrint.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "DeliveryOrderId"));
            }
        }
Ejemplo n.º 13
0
        protected void gvwVendor_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwVendor.PageSize * gvwVendor.PageIndex) + e.Row.RowIndex + 1).ToString();
                //e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Abbreviation"));

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VendorType"));

                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocationName"));

                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VendorName"));

                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VendorAddress"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VendorId"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VendorId"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                }
            }
        }
Ejemplo n.º 14
0
        private void PopulateControlsForGridView(GridView gvw, GridViewRow row)
        {
            GeneralFunctions.ApplyGridViewAlternateItemStyle(row, 6);

            //ScriptManager sManager = ScriptManager.GetCurrent(this);

            ((Label)row.FindControl("lblSlNo")).Text            = ((gvw.PageSize * gvw.PageIndex) + row.RowIndex + 1).ToString();
            ((HiddenField)row.FindControl("hdnAccessId")).Value = Convert.ToString(DataBinder.Eval(row.DataItem, "MenuAccessID"));
            ((HiddenField)row.FindControl("hdnMenuId")).Value   = Convert.ToString(DataBinder.Eval(row.DataItem, "MenuID"));

            row.Cells[1].Text = Convert.ToString(DataBinder.Eval(row.DataItem, "MenuName"));

            //Add
            if (Convert.ToBoolean(DataBinder.Eval(row.DataItem, "CanAdd")))
            {
                ((CheckBox)row.FindControl("chkAdd")).Checked = true;
            }
            else
            {
                ((CheckBox)row.FindControl("chkAdd")).Checked = false;
            }

            //Edit
            if (Convert.ToBoolean(DataBinder.Eval(row.DataItem, "CanEdit")))
            {
                ((CheckBox)row.FindControl("chkEdit")).Checked = true;
            }
            else
            {
                ((CheckBox)row.FindControl("chkEdit")).Checked = false;
            }

            //Delete
            if (Convert.ToBoolean(DataBinder.Eval(row.DataItem, "CanDelete")))
            {
                ((CheckBox)row.FindControl("chkDel")).Checked = true;
            }
            else
            {
                ((CheckBox)row.FindControl("chkDel")).Checked = false;
            }

            //View
            if (Convert.ToBoolean(DataBinder.Eval(row.DataItem, "CanView")))
            {
                ((CheckBox)row.FindControl("chkView")).Checked = true;
            }
            else
            {
                ((CheckBox)row.FindControl("chkView")).Checked = false;
            }
        }
Ejemplo n.º 15
0
        protected void gvwContainerTran_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                //e.Row.Cells[0].Text = ((gvBooking.PageSize * gvBooking.PageIndex) + e.Row.RowIndex + 1).ToString();
                //e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Abbreviation"));

                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LOCATION")); // +"<br/><font style='font-size:x-small;font-weight:bold;'>CODE : (" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LFCode")) + ")</font>";

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LINE"));     // +"<br/><font style='font-size:x-small;font-weight:bold;'>CODE : (" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LTCode")) + ")</font>";

                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ExpBLNo"));

                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ExpBLDate")).Split(' ')[0];
                //e.Row.Cells[4].Text = Convert.ToString(Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "WeightFrom")));

                //e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WeightTo"));

                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CONTAINERNO"));

                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PortName"));

                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActualArrival")).Split(' ')[0];

                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActualDeperture")).Split(' ')[0];

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

                btnRemove.OnClientClick   = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_ActualTrasShipID"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }
            }
        }
Ejemplo n.º 16
0
        protected void gvwRole_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 4);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwRole.PageSize * gvwRole.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));

                LinkButton lnkStatus = (LinkButton)e.Row.FindControl("lnkStatus");
                lnkStatus.CommandName   = "Status";
                lnkStatus.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00074") + "');";

                if (Convert.ToBoolean(DataBinder.Eval(e.Row.DataItem, "Active")))
                {
                    lnkStatus.Text            = "Active";
                    lnkStatus.ToolTip         = "Click to deactivate";
                    lnkStatus.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id")) + "|0";
                }
                else
                {
                    lnkStatus.Text            = "Inactive";
                    lnkStatus.ToolTip         = "Click to activate";
                    lnkStatus.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id")) + "|1";
                }

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                ////Delete link
                //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                //btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00012");
                //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                //if (_hasEditAccess)
                //{
                //btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                //}
                //else
                //{
                //    btnEdit.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                //btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                //}
            }
        }
Ejemplo n.º 17
0
        protected void gvImportBL_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 6);
                ScriptManager sManager = ScriptManager.GetCurrent(this);

                //e.Row.Cells[0].Text = ((gvImportBL.PageSize * gvImportBL.PageIndex) + e.Row.RowIndex + 1).ToString();

                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ImpLineBLNo"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "IGMBLNumber"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VesselName"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VoyageNo"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PortOfLoading"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PortOfDischarge"));

                //Edit Link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00070");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));


                //Delete link
                if (_canDelete == true)
                {
                    ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible         = true;
                    btnRemove.OnClientClick   = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                    btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                    btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (DataBinder.Eval(e.Row.DataItem, "blClosed").ToInt() == 1)
                {
                    ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    //btnDashboard.Visible = false;
                    //btnEdit.Visible = false;
                    btnRemove.Visible = false;
                    e.Row.ForeColor   = System.Drawing.Color.Red;
                    //e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
                }
            }
        }
        protected void gvwDSC_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 8);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwDSC.PageSize * gvwDSC.PageIndex) + e.Row.RowIndex + 1).ToString();

                if (DataBinder.Eval(e.Row.DataItem, "CallDate") != DBNull.Value)
                {
                    e.Row.Cells[1].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "CallDate"), _culture).ToString(Convert.ToString(ConfigurationManager.AppSettings["DateFormat"]));
                }

                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CustomerName"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CallTypes"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Prospect"));

                if (DataBinder.Eval(e.Row.DataItem, "NextCallDate") != DBNull.Value && DataBinder.Eval(e.Row.DataItem, "NextCallDate") != null)
                {
                    e.Row.Cells[5].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "NextCallDate"), _culture).ToString(Convert.ToString(ConfigurationManager.AppSettings["DateFormat"]));
                }

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00008");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CallId"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CallId"));

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                }
            }
        }
Ejemplo n.º 19
0
        protected void gvwMoneyReceipt_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 8);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwMoneyReceipts.PageSize * gvwMoneyReceipts.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MRNo"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MRDate"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocationName"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLNo"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MRAmount"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MRNo"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MRNo"));

                if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MRNo")) == "1")
                {
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00059") + "');return false;";
                }
                else
                {
                    if (_canDelete)
                    {
                        btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                    }
                    else
                    {
                        //btnEdit.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                        btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                    }
                }
            }
        }
Ejemplo n.º 20
0
        protected void gvwList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 5);
                ((Label)e.Row.Cells[0].FindControl("lblSlNo")).Text = ((gvwList.PageSize * gvwList.PageIndex) + e.Row.RowIndex + 1).ToString();
                ((HiddenField)e.Row.Cells[0].FindControl("hdnBookingCntrId")).Value = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingContainerId"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnTypeId")).Value        = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerTypeId"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnSize")).Value          = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerSize"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnAvlUnit")).Value       = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "AvailableUnit"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnBookingUnit")).Value   = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingUnit"));

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerType"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerSize"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "AvailableUnit"));

                CustomTextBox txtReqUnit = (CustomTextBox)e.Row.Cells[4].FindControl("txtReqUnit");
                txtReqUnit.Text     = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "RequiredUnit"));
                txtReqUnit.ReadOnly = !_isEditable;
            }
        }
Ejemplo n.º 21
0
        protected void gvwSalesCall_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 6);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                //e.Row.Cells[0].Text = ((gvwSalesCall.PageSize * gvwUser.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WeekNo"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PortCode"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TEU"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "FEU"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00008");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CommitmentId"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CommitmentId"));


                btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";

                //if (_hasEditAccess)
                //{
                //    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";
                //}
                //else
                //{
                //    btnEdit.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                //    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                //}
            }
        }
Ejemplo n.º 22
0
        protected void gvwLoc_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 3);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwLoc.PageSize * gvwLoc.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_STaxID"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "StartDate")).Split(' ')[0];
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TaxPer"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TaxCess"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "TaxAddCess"));
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "[Status]"));

                //if (_canDelete == true)
                //{
                //    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                //    btn .Visible = true;
                //    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                //    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));

                //}
                //else
                //{
                //    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                //    btnRemove.Visible = false;
                //}

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_STaxID"));
                //btnEdit.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
            }
        }
Ejemplo n.º 23
0
        protected void gvwLoc_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 3);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwLoc.PageSize * gvwLoc.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_mainLineVoyageID"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MLVoyageNo"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VesselName"));
                //e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "lastport"));
                //e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActivityDate"));


                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_mainLineVoyageID"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "pk_mainLineVoyageID"));

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                }
            }
        }
Ejemplo n.º 24
0
        protected void gvwCust_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 6);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                string corporateOrLocal = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "CorporateOrLocal"));
                string custLocId        = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Location.Id"));
                //bool canEdit = true;

                //if (_roleId == (int)UserRole.Manager || _roleId == (int)UserRole.SalesExecutive)
                //{
                //    if (corporateOrLocal == "C" && _locId.ToString() != custLocId)
                //    {
                //        canEdit = false;
                //    }
                //}

                e.Row.Cells[0].Text = ((gvwCust.PageSize * gvwCust.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Location.Name"));
                //e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));

                //SA Modify -- Souvik
                string strCustName = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));

                if (strCustName.Length > 50)
                {
                    ((Label)e.Row.FindControl("lblName")).ToolTip = strCustName;
                    strCustName = strCustName.Substring(0, 50) + "..";
                }


                if (Convert.ToChar(DataBinder.Eval(e.Row.DataItem, "IsActive")) == 'Y')
                {
                    ((Label)e.Row.FindControl("lblName")).Text = strCustName;
                    ((Label)e.Row.FindControl("lblInActive")).Style["display"] = "none";
                }
                else
                {
                    ((Label)e.Row.FindControl("lblName")).Text = strCustName;
                    ((Label)e.Row.FindControl("lblInActive")).Style["display"] = "";
                }


                if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Group.Id")) != "1")
                {
                    string strGroupCompany = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Group.Name"));
                    if (strGroupCompany.Length > 17)
                    {
                        e.Row.Cells[3].ToolTip = strGroupCompany;
                        strGroupCompany        = strGroupCompany.Substring(0, 17) + "..";
                    }

                    e.Row.Cells[3].Text = strGroupCompany;
                }
                //EA Modify -- Souvik

                string strSalesPerson = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SalesExecutiveName"));
                if (strSalesPerson.Length > 17)
                {
                    e.Row.Cells[4].ToolTip = strSalesPerson;
                    strSalesPerson         = strSalesPerson.Substring(0, 17) + "..";
                }

                e.Row.Cells[4].Text = strSalesPerson;

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00070");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                ////Delete link
                //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                //btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                //if (_hasEditAccess && canEdit)
                //{
                //    if (_roleId == (int)UserRole.Admin || _roleId == (int)UserRole.Manager)
                //        btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";
                //    else
                //        btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                //}
                //else
                //{
                //    btnEdit.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                //    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                //}
            }
        }
Ejemplo n.º 25
0
        protected void gvExportBL_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 6);
                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Nvocc"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Location"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingNumber"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "EdgeBLNumber"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "RefBLNumber"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "POD"));
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "POL"));

                // Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");

                if (_canDelete)
                {
                    btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00012");
                    btnRemove.OnClientClick   = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                    btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLNumber"));
                }
                else
                {
                    btnRemove.Style["display"] = "none";
                }

                //LinkButton lnkStatus = (LinkButton)e.Row.FindControl("lnkStatus");
                //lnkStatus.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLNumber"));

                //if (Convert.ToBoolean(DataBinder.Eval(e.Row.DataItem, "BLStatus")))
                //{
                //    lnkStatus.ToolTip = "Active";
                //    lnkStatus.Text = "Active";
                //    lnkStatus.Attributes.Add("onclick", "javascript:return confirm('Are you sure about make it InActive?');");
                //}
                //else
                //{
                //    lnkStatus.ToolTip = "InActive";
                //    lnkStatus.Text = "InActive";
                //    lnkStatus.Attributes.Add("onclick", "javascript:return confirm('Are you sure about make it Active?');");
                //}

                //Edit Link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00070");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLNumber"));

                //Dashboard Link
                ImageButton btnDashboard = (ImageButton)e.Row.FindControl("btnDashboard");
                btnDashboard.ToolTip         = "Go to Dashboard";
                btnDashboard.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLNumber"));

                if (DataBinder.Eval(e.Row.DataItem, "CloseBL").ToInt() == 1)
                {
                    //btnDashboard.Visible = false;
                    //btnEdit.Visible = false;
                    btnRemove.Visible = false;
                    e.Row.ForeColor   = System.Drawing.Color.Red;
                    //e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
                }
            }
        }
Ejemplo n.º 26
0
        protected void gvwContainerTran_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwContainerTran.PageSize * gvwContainerTran.PageIndex) + e.Row.RowIndex + 1).ToString();

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerNo"));

                //e.Row.Cells[2].Text = ddlIEC.Items.FindByValue(Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Status"))).Text;
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingNo"));

                e.Row.Cells[3].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "LBDate")).ToShortDateString();

                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Location"));

                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Line"));

                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "RefBookingNo"));

                //string Ld = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LandingDate"));
                //e.Row.Cells[6].Text = string.IsNullOrEmpty(Ld) ? "" : Convert.ToDateTime(Ld).ToShortDateString();

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                //btnEdit.ToolTip = ResourceManager.GetStringWithoutName("ERR00008");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PK_LBID"));

                if (oUser.UserRole.Id == 6 || oUser.UserRole.Id == 2)
                {
                    btnEdit.Visible = true;
                }
                else
                {
                    btnEdit.Visible = Convert.ToBoolean(DataBinder.Eval(e.Row.DataItem, "Editable"));
                }

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                //btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "PK_LBID"));
                //btnRemove.Visible = Convert.ToBoolean(DataBinder.Eval(e.Row.DataItem, "Editable"));

                if (_canDelete == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = true;
                    btnRemove.ToolTip = ResourceManager.GetStringWithoutName("ERR00007");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00012") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                }
            }
        }
Ejemplo n.º 27
0
        protected void gvwList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 8);

                e.Row.Cells[0].Text = ((gvwList.PageSize * gvwList.PageIndex) + e.Row.RowIndex + 1).ToString();
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "NewUserName"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ExistingUserName"));

                if (Convert.ToChar(DataBinder.Eval(e.Row.DataItem, "AssignType")) == 'P')
                {
                    e.Row.Cells[3].Text = "Permanent";
                }
                else if (Convert.ToChar(DataBinder.Eval(e.Row.DataItem, "AssignType")) == 'T')
                {
                    e.Row.Cells[3].Text = "Temporary";
                }

                if (DataBinder.Eval(e.Row.DataItem, "StartDate") != DBNull.Value && DataBinder.Eval(e.Row.DataItem, "StartDate") != null)
                {
                    e.Row.Cells[4].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "StartDate"), _culture).ToString(Convert.ToString(ConfigurationManager.AppSettings["DateFormat"]));
                }

                if (DataBinder.Eval(e.Row.DataItem, "EndDate") != DBNull.Value && DataBinder.Eval(e.Row.DataItem, "EndDate") != null)
                {
                    e.Row.Cells[5].Text = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "EndDate"), _culture).ToString(Convert.ToString(ConfigurationManager.AppSettings["DateFormat"]));
                }

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00008");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                char     assignType = Convert.ToChar(DataBinder.Eval(e.Row.DataItem, "AssignType"));
                DateTime startDt    = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "StartDate"), _culture);

                if (assignType == 'P') // Permanent, cannot be deleted or edited
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00060") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00061") + "');return false;";
                }
                else
                {
                    if (DateTime.Compare(startDt, DateTime.Now.Date) == -1)
                    {
                        btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00062") + "');return false;";
                        btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00063") + "');return false;";
                    }
                    else
                    {
                        if (_hasEditAccess)
                        {
                            btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";
                        }
                        else
                        {
                            btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                            btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                        }
                    }
                }
            }
        }
Ejemplo n.º 28
0
        protected void gvBooking_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ImageButton btnCharge = (ImageButton)e.Row.FindControl("btnCharges");

                if (Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "ChgExist")) == 0)
                {
                    btnCharge.ImageUrl = "~/Images/BookingWithcharge.ico";
                }

                if (Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "DOExist")) == 1 || (Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "BLExist")) == 1))
                {
                    _canDelete = false;
                }
                else
                {
                    _canDelete = true;
                }

                //if (Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "BLExist")) == 1)
                //    _canDelete = false;
                //else
                //    _canDelete = true;
                //else
                //    btnCharge.ImageUrl = "~/Images/Status.jpg";
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingNo"));

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingDate")).Split(' ')[0];
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "refBookingNo"));
                e.Row.Cells[3].Text = Convert.ToBoolean(DataBinder.Eval(e.Row.DataItem, "BLExist"))?"Yes":"No";
                //e.Row.Cells[4].Text = Convert.ToString(Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "WeightFrom")));

                //e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "WeightTo"));

                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VesselName"));

                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "VoyageNo"));

                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "FPOD"));
                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "SMAN"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00013");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingID"));

                //Status link
                ImageButton btnStatus = (ImageButton)e.Row.FindControl("btnStatus");
                btnStatus.ToolTip         = ResourceManager.GetStringWithoutName("ERR00084");
                btnStatus.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingID"));

                //Status link
                ImageButton btnCharges = (ImageButton)e.Row.FindControl("btnCharges");
                btnCharges.ToolTip         = ResourceManager.GetStringWithoutName("ERR00082");
                btnCharges.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingID"));

                // Check close BL
                if (DataBinder.Eval(e.Row.DataItem, "CloseVoyage").ToInt() == 1)
                {
                    //btnDashboard.Visible = false;
                    //btnEdit.Visible = false;
                    btnStatus.Visible = false;
                    e.Row.ForeColor   = System.Drawing.Color.Red;
                    //e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
                }

                if (_canEdit == true)
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnStatus.Visible  = true;
                    btnStatus.ToolTip  = ResourceManager.GetStringWithoutName("ERR00084");
                    btnCharges.ToolTip = ResourceManager.GetStringWithoutName("ERR00082");
                    //btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BLID"));
                }
                else
                {
                    //ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnStatus.Visible  = false;
                    btnCharges.Visible = false;
                }

                if (_canDelete)
                {
                    btnStatus.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";
                }
                else
                {
                    btnStatus.Visible = false;
                    //btnStatus.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                }

                if (CalledFrom == 1)   // Sales Man
                {
                    btnCharge.Enabled = false;
                }

                if (DataBinder.Eval(e.Row.DataItem, "CloseVoyage").ToInt() == 1)
                {
                    //btnCharge.Visible = false;
                    //btnEdit.Visible = false;
                    e.Row.ForeColor = System.Drawing.Color.Red;
                    //e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
                }
                //btnStatus.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
                //btnCharges.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00008") + "');return false;";
            }
        }
Ejemplo n.º 29
0
        protected void gvwLoc_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 7);

                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = ((gvwLoc.PageSize * gvwLoc.PageIndex) + e.Row.RowIndex + 1).ToString();
                //e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Abbreviation"));

                if (Convert.ToChar(DataBinder.Eval(e.Row.DataItem, "IsActive")) == 'Y')
                {
                    ((Label)e.Row.FindControl("lblAbbr")).Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Abbreviation"));
                    ((Label)e.Row.FindControl("lblInActive")).Style["display"] = "none";
                }
                else
                {
                    ((Label)e.Row.FindControl("lblAbbr")).Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Abbreviation"));
                    ((Label)e.Row.FindControl("lblInActive")).Style["display"] = "";
                }

                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));

                if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocAddress.City")) == string.Empty)
                {
                    if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocAddress.Pin")) != string.Empty)
                    {
                        e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocAddress.Pin"));
                    }
                }
                else
                {
                    if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocAddress.Pin")) == string.Empty)
                    {
                        e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocAddress.City"));
                    }
                    else
                    {
                        e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocAddress.City")) + "-" + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocAddress.Pin"));
                    }
                }

                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ManagerName"));

                // Edit link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00008");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                //Delete link
                ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Id"));

                if (_hasEditAccess)
                {
                    btnRemove.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00010") + "');";
                }
                else
                {
                    btnEdit.OnClientClick   = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                    btnRemove.OnClientClick = "javascript:alert('" + ResourceManager.GetStringWithoutName("ERR00009") + "');return false;";
                }
            }
        }
Ejemplo n.º 30
0
        protected void gvImportBL_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 6);
                ScriptManager sManager = ScriptManager.GetCurrent(this);

                e.Row.Cells[0].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobNo"));
                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobDate")).Split(' ')[0];
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobType"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "LocName"));
                e.Row.Cells[4].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "POL"));
                e.Row.Cells[5].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "POD"));
                e.Row.Cells[6].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "EstPayable"));
                e.Row.Cells[7].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "EstReceivable"));
                e.Row.Cells[8].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "EstProfit"));

                ImageButton btnDashboard = (ImageButton)e.Row.FindControl("btnDashboard");
                btnDashboard.ToolTip         = "Dashboard";
                btnDashboard.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobId"));

                // display HBL button only Open Job
                if (ddlJobStatus.SelectedValue == "O")
                {
                    ImageButton btnHBLEntry = (ImageButton)e.Row.FindControl("btnHBLEntry");
                    btnHBLEntry.ToolTip = "HBL Entry";
                    if (Convert.ToBoolean(DataBinder.Eval(e.Row.DataItem, "PrintHBL")))
                    {
                        btnHBLEntry.Visible         = true;
                        btnHBLEntry.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobId"));
                    }
                    else
                    {
                        btnHBLEntry.Visible = false;
                    }
                }
                else
                {
                    ImageButton btnHBLEntry = (ImageButton)e.Row.FindControl("btnHBLEntry");
                    btnHBLEntry.Visible = false;
                }
                //Edit Link
                ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
                btnEdit.ToolTip         = ResourceManager.GetStringWithoutName("ERR00070");
                btnEdit.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobId"));

                //Delete link
                if (_canDelete == true)
                {
                    ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible         = true;
                    btnRemove.ToolTip         = ResourceManager.GetStringWithoutName("ERR00007");
                    btnRemove.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobId"));
                    btnRemove.Attributes.Add("onclick", "javascript:return confirm('Are you sure about delete?');");
                }
                else
                {
                    ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }

                if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "JobActive")) == "C")
                {
                    e.Row.ForeColor = System.Drawing.Color.Red;
                    ImageButton btnRemove = (ImageButton)e.Row.FindControl("btnRemove");
                    btnRemove.Visible = false;
                }
            }
        }