예제 #1
0
    protected void gvLane_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        //   TextBox txtLaneFooter = gvLane.FooterRow.FindControl("txtLanefooter") as TextBox;
        TextBox txtLane = (TextBox)gvLane.Rows[e.RowIndex].FindControl("txtLanes");

        //TextBox txtquantity = (TextBox)gvLane.Rows[e.RowIndex].FindControl("txtLaneQuantity");
        lblErrorLane.Text     = "Space Name Updated successfully!";
        lblErrorLane.Visible  = true;
        lblErrorLane.CssClass = "alert-success custom-absolute-alert";
        ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true);



        HiddenField lanehiddenfeild = (HiddenField)gvLane.Rows[e.RowIndex].FindControl("hdnspaceid");


        String lanename = txtLane.Text.Trim();
        int    spaceid  = Convert.ToInt32(ViewState["spaceid"]);

        LaneId = Convert.ToInt32(lanehiddenfeild.Value);
        //int quantity = Convert.ToInt32(txtquantity.Text.Trim());
        //Space.UpdateLaneInfo(LaneId, spaceid, lanename,quantity);
        LotSpace.updateLaneInfo(LaneId, spaceid, lanename);

        gvLane.EditIndex = -1;
        LoadSpaces(1, spaceid);
    }
예제 #2
0
    /// <summary>
    /// Next Button For Spaces
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>



    protected void lbkNextLane_Click(object sender, EventArgs e)
    {
        lblErrorLane.Text  = string.Empty;
        lblErrorLot.Text   = string.Empty;
        lblErrorSpace.Text = string.Empty;

        String lanename = txtLaneheader.Text.Trim();
        //int quantity = Convert.ToInt32(txtLaneQuantity.Text.Trim());

        int spaceid = Convert.ToInt32(ViewState["spaceid"]);
        int id      = LotSpace.insertLane(lanename, spaceid);

        LoadSpaces(1, spaceid);
        if (id > 0)
        {
            lblErrorLane.Text     = "Space added successfully!";
            lblErrorLane.Visible  = true;
            lblErrorLane.CssClass = "alert-success custom-absolute-alert";
            ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true);

            txtLaneheader.Text = string.Empty;
            //txtLaneQuantity.Text = string.Empty;
            LoadRows(1);
            LoadLots(1);
        }
    }
예제 #3
0
    /// <summary>
    /// Load Space Info Function
    /// </summary>
    /// <param name="spaceid"></param>

    public void LoadSpaces(int pageNo, int spaceid)
    {
        try
        {
            int pageSize = 5;
            gvLane.PageSize = pageSize;
            CurrentPageR2   = pageNo;
            int count = 0;
            gvLane.DataSource = LotSpace.getLane(pageNo, pageSize, out count, spaceid);
            gvLane.DataBind();
            this.TotalItemsR2 = count;
            this.pgrSpaces.DrawPager(pageNo, this.TotalItemsR2, pageSize, MaxPagesToShow);
        }
        catch (Exception ex)
        {
            new SqlLog().InsertSqlLog(0, "AddLot.aspx loadLaneText", ex);
        }
    }
예제 #4
0
 public void loadLaneText(int spaceid)
 {
     try
     {
         int count = 0;
         hdnrowIds.Value   = spaceid.ToString();
         pnlLane.Visible   = true;
         gvLane.DataSource = LotSpace.getLane(1, 0, out count, spaceid);
         gvLane.DataBind();
     }
     catch (Exception ex)
     {
         new SqlLog().InsertSqlLog(0, "Facility/Controls/LotSpace.ascx.cs loadLaneText", ex);
     }
     //if (gvLane.Rows.Count == 0)
     //{
     //    PanelLaneValue.Visible = true;
     //}
     //else
     //{
     //    PanelLaneValue.Visible = false;
     //}
 }
예제 #5
0
    protected void gvLane_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Insert")
        {
            TextBox txtLaneFooter = gvLane.FooterRow.FindControl("txtLanefooter") as TextBox;

            //HiddenField hiddenfieldspaceid = this.FindControl("hdnspaceid") as HiddenField;



            //int index = Convert.ToInt32(e.CommandArgument);
            //GridViewRow row = gvSetting.Rows[index];
            //HiddenField hiddenfieldspaceid = (HiddenField)row.FindControl("hdnspaceid");


            string Lanename = txtLaneFooter.Text.Trim();
            //int quantity = Convert.ToInt32(txtLaneQuantity.Text.Trim());

            int spaceid = Convert.ToInt32(ViewState["spaceid"]);

            LotSpace.insertLane(Lanename, spaceid);

            LoadSpaces(1, spaceid);
        }
        else if (e.CommandName == "AddMore")
        {
            LinkButton lnkbtnAddMoreSetting = gvLane.FooterRow.FindControl("lnkbtnAddMore") as LinkButton;
            LinkButton lnkbtnAddSetting     = gvLane.FooterRow.FindControl("lnkbtnAddSetting") as LinkButton;
            LinkButton lnkbtnCancelSetting  = gvLane.FooterRow.FindControl("lnkbtnCancelSetting") as LinkButton;


            lnkbtnAddSetting.Visible     = true;
            lnkbtnAddMoreSetting.Visible = false;
            lnkbtnCancelSetting.Visible  = true;

            TextBox txtLaneFooter = gvLane.FooterRow.FindControl("txtLanefooter") as TextBox;
            //TextBox txtSpace = gvSetting.FooterRow.FindControl("txtSpaces") as TextBox;
            txtLaneFooter.Visible = true;
        }


        else if (e.CommandName == "CancelLane")
        {
            gvLane.EditIndex = -1;
            //loadGridAndHeaderText();
            int spaceid = Convert.ToInt32(ViewState["spaceid"]);
            LoadSpaces(1, spaceid);
        }

        else if (e.CommandName == "Edit")
        {
            LaneId           = Convert.ToInt32(e.CommandArgument);
            lblErrorLot.Text = string.Empty;
        }

        else if (e.CommandName == "Delete")
        {
            int laneId = Convert.ToInt32(e.CommandArgument);
            if (!lanehaveTire(laneId))
            {
                LotSpace.deleteLane(laneId);
                int spaceid = Convert.ToInt32(ViewState["spaceid"]);
                LoadSpaces(1, spaceid);
                lblErrorLane.Text  = string.Empty;
                lblErrorLot.Text   = string.Empty;
                lblErrorSpace.Text = string.Empty;
            }
        }
        else if (e.CommandName == "LaneInfoPopUp")
        {
            ucSpaceTires.Visible        = true;
            dvpopupfacilityinfo.Visible = true;
            GridViewRow gvr          = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
            int         RemoveAt     = gvr.RowIndex;
            Lots        objlots      = new Lots(Conversion.ParseInt(hidLotId.Value));
            LotSpace    objLotSpaces = new LotSpace(Conversion.ParseInt(e.CommandArgument));
            HiddenField lbl          = (HiddenField)gvLane.Rows[RemoveAt].FindControl("hdnspacename");

            ucSpaceTires.LoadTires(Conversion.ParseInt(e.CommandArgument));
            ucSpaceTires.LoadFacilityLotRowSpaceName(objlots.FacilityName, hidLotId.Value, objlots.LotNumber, objLotSpaces.SpaceId.ToString(), objLotSpaces.SpaceName, lbl.Value);
        }
    }