/// <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); } }
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); } }