private void MyRefresh() { txtPDFPath = string.Empty; txtPDFPath = PDFPath; using (SqlExcuteCommand get = new SqlExcuteCommand() { DBCnnStr = DBEndososCnnStr }) { _MyLotsTable = get.MyGetLot(StatusReydi, "3", WhatIsModo); cbLots.Clear(); LogBox.Clear(); LblTotal = string.Empty; _run = false; if (_MyLotsTable.Rows.Count == 0) { MessageBox.Show("No hay lotes ", "No Hay", MessageBoxButton.OK, MessageBoxImage.Information); } foreach (DataRow row in _MyLotsTable.Rows) { Lots myLots = new Lots(); myLots.Partido = row["Partido"].ToString(); myLots.Lot = row["Lot"].ToString(); myLots.Amount = row["Amount"].ToString(); myLots.Usercode = row["Usercode"].ToString(); myLots.AuthDate = row["AuthDate"].ToString(); myLots.Status = row["Status"].ToString(); myLots.VerDate = row["VerDate"].ToString(); myLots.VerUser = row["VerUser"].ToString(); myLots.FinUser = row["FinUser"].ToString(); myLots.FinDate = row["FinDate"].ToString(); myLots.RevDate = row["RevDate"].ToString(); myLots.RevUser = row["RevUser"].ToString(); myLots.conditions = row["conditions"].ToString(); myLots.ImportDate = row["ImportDate"].ToString(); myLots.Modo = int.Parse(row["Modo"].ToString()); if (WhatIsModo == 1) { if (myLots.Modo == 1) { cbLots.Add(myLots.Lot); } } else { if (myLots.Modo == 2) { cbLots.Add(myLots.Lot); } } } cbLots_Item_Id = -1; } }
/// <returns> /// <list type="bullet"> /// <item> /// <description>A default lot if one is free, otherwise;</description> /// </item> /// <item> /// <description>null</description> /// </item> /// </list> /// </returns> public ParkingLot FindFreeRegularParkingLot() { // All regular non-business lots var freeLots = Lots.Where((lot) => !IsLotBusiness(lot) && lot.HasFreeSpace()); // if there isn't any free spaces at all, it returns null return(freeLots.OrderBy((lot) => lot.CurrentParking).FirstOrDefault()); }
public ActionResult DeleteConfirmed(int id) { Lots lots = db.Lots.Find(id); db.Lots.Remove(lots); db.SaveChanges(); return(RedirectToAction("Index")); }
public bool SavePurchaseLot(Lots lot) { bool status = true; PurchaseRepository repo = new PurchaseRepository(); status = repo.PurchaseLotSaveEdit(ParserAddPurchaseLot(lot)); return(status); }
public bool SaveExpenseLot(Lots lot) { bool status = true; ExpensesRepository repo = new ExpensesRepository(); status = repo.expenseLotSaveEdit(ParserAddExpenseLot(lot)); return(status); }
//public dynamic GetAllSalesReportByDate(DateTime fromDate, DateTime toDate) //{ // SaleRepository repo = new SaleRepository(); // var listSales = repo.GetAllSalesReportByDate(fromDate, toDate); // return listSales; //} public bool SaveSlesLot(Lots lot) { bool status = true; SaleRepository repo = new SaleRepository(); status = repo.SalesLotSaveEdit(ParserAddSalesLot(lot)); return(status); }
protected override bool Allow() { if (!Lots.GetValue <Option, bool> ()) { return(false); } return(base.Allow()); }
protected bool TestMoveInLot() { bool nonRoomie = false; bool hasAdult = false; foreach (SimDescription sim in mMovers) { if (!Households.Allow(this, sim, GetValue <ManagerHousehold.MinTimeBetweenMovesOption, int>())) { IncStat("User Denied"); return(false); } else if ((TestDead) && (SimTypes.IsDead(sim))) { IncStat("Dead"); return(false); } else if (!sim.Marryable) { IncStat("Not Marryable"); return(false); } else if (SimTypes.InServicePool(sim, ServiceType.GrimReaper)) { IncStat("Reaper Denied"); return(false); } if (!Household.RoommateManager.IsNPCRoommate(sim)) { nonRoomie = true; } if (Households.AllowGuardian(sim)) { hasAdult = true; } Lots.PackupVehicles(sim.CreatedSim, true); } if (!nonRoomie) { IncStat("All Roomies"); return(false); } if (!hasAdult) { IncStat("No adult"); return(false); } return(true); }
protected override bool Allow(Household house) { if (Lots.FindLot(this, HouseholdsEx.All(house), 0, ManagerLot.FindLotFlags.Inspect, OnLotPriceCheck) == null) { IncStat("No Homes"); return(false); } return(base.Allow(house)); }
public void BoughtLot(ServerBuyerDTO serverBuyerDTO, ServerLotDTO serverLotDTO) { tempBuyersOnline.FirstOrDefault(x => x.Name == serverBuyerDTO.Name && x.Password == serverBuyerDTO.Password). BuyerBoughtLots.Add(serverLotDTO); Lots tempLotF = mapperLot.Map <ServerLotDTO, Lots>(serverLotDTO); Buyers tempBuyerF = mapperBuyer.Map <ServerBuyerDTO, Buyers>(serverBuyerDTO); buyerWrapper.BoughtLot(tempLotF, tempBuyerF); }
protected override ManagerLot.CheckResult OnLotPriceCheck(Common.IStatGenerator stats, Lot lot, int currentLotCost, int availableFunds) { if (availableFunds < Lots.GetLotCost(lot)) { stats.IncStat("Find Lot: Too expensive"); return(ManagerLot.CheckResult.Failure); } return(ManagerLot.CheckResult.Success); }
public Notification() { notice = new Notice(); documents = new List <Documents>(); oneDocument = new Documents(); lots = new List <Lots>(); oneLot = new Lots(); products = new List <Products>(); oneProduct = new Products(); }
protected override GatherResult TargetGather(List <Scenario> list, ref bool random) { GatherResult result = base.TargetGather(list, ref random); if ((Target == null) && (result == GatherResult.Failure)) { Lots.IncreaseImmigrationPressure(Pregnancies, GetValue <ImmigrantRequirementScenario.PressureOption, int>()); } return(result); }
public Lots GetLots(int id) { Lots lots = new Lots(); ExpensesRepository repo = new ExpensesRepository(); if (lots != null) { lots = ParserGetExpenseLot(repo.GetLot(id)); } return(lots); }
/// <summary> /// Scan Routine will add new lots to lots list from the result of ScanTerraRetLotVertex() /// </summary> /// <param name="inPolyDiv">how many div ex 5x5 a real poly will have</param> /// <param name="polyX">real polys in X will cover in each scan pass</param> /// <param name="polyZ">real polys in Z will cover in each scan pass</param> private void ScanProcedure(int inPolyDiv, int polyX, int polyZ) { //return; List <Vector3> newLotVertex = new List <Vector3>(); newLotVertex = ScanTerraRetLotVertex(inPolyDiv, polyX, polyZ); Lots.Add(new Lot(newLotVertex, Lots.Count, lotStart, lotEnd)); //print("LotsScanned:" + Lots.Count); AllVertexs = UList.AddOneListToList(AllVertexs, newLotVertex); }
public Lots GetLots(int id) { Lots lots = new Lots(); SaleRepository repo = new SaleRepository(); if (lots != null) { lots = ParserGetSalesLot(repo.GetLot(id)); } return(lots); }
public ActionResult Edit([Bind(Include = "id,id_Propriete,surface,etage,nature_lot,carrez,balcon,surface_balcon,terrasse,surface_terrasse,jardin,surface_jardin,commentaire")] Lots lots) { if (ModelState.IsValid) { db.Entry(lots).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_Propriete = new SelectList(db.Propriete, "id", "nom_Commune", lots.id_Propriete); return(View(lots)); }
public Lots GetLots(int id) { Lots lots = new Lots(); PurchaseRepository repo = new PurchaseRepository(); if (lots != null) { lots = ParserGetPurchaseLot(repo.GetLot(id)); } return(lots); }
/// <returns> /// <list type="bullet"> /// <item> /// <description>A business lot if one is free, otherwise;</description> /// </item> /// <item> /// <description>A default lot if one is free, otherwise;</description> /// </item> /// <item> /// <description>null</description> /// </item> /// </list> /// </returns> public ParkingLot FindFreeBusinessParkingLot() { var freeBusinessLots = Lots.Where((lot) => IsLotBusiness(lot) && lot.HasFreeSpace()); // free business lots? if (freeBusinessLots.Any()) { return(freeBusinessLots.OrderBy((lot) => lot.CurrentParking).First()); } // no, default to free parking lot return(FindFreeRegularParkingLot()); }
protected override bool PrivateUpdate(ScenarioFrame frame) { bool bFound = false; foreach (Book book in GetInventory(Sim)) { Lots.PutAwayBook(this, book, Sim.LotHome); bFound = true; } return(bFound); }
void ReinitalizeAllMeshVars() { AllVertexs.Clear(); Lots.Clear(); Malla.Lots.Clear(); if (subMesh != null) { subMesh.AllSubMeshedLots.Clear(); subMesh.amountOfSubVertices = 0; } }
protected override bool PrivateUpdate(ScenarioFrame frame) { Lots.IncreaseImmigrationPressure(Flirts, ImmigrationPressure); if (Flirts.PreviousLoveLoss == null) { Flirts.PreviousLoveLoss = new SimID(Sim); return(true); } return(false); }
protected override GatherResult TargetGather(List <Scenario> list, ref bool random) { if (Target == null) { if (Lot == null) { if (RandomUtil.RandomChance(ChanceOfHomeLot)) { Lot = Sim.LotHome; } if (Lot == null) { Lot = Lots.GetCommunityLot(Sim.CreatedSim, null, false); if (Lot == null) { return(GatherResult.Failure); } } } } GatherResult result = base.TargetGather(list, ref random); if (result == GatherResult.Success) { RandomUtil.RandomizeListOfObjects(list); int count = 0; foreach (Scenario choice in list) { GatheringScenario guest = choice as GatheringScenario; if (guest == null) { continue; } count++; mGuests.Add(guest.Target); if (count >= TargetMaximum) { break; } } list.Clear(); return(GatherResult.Update); } return(result); }
protected override bool Push() { Lot lot = Lots.GetCommunityLot(Sim.CreatedSim, null, true); if (lot == null) { return(false); } Sim.CreatedSim.InteractionQueue.CancelAutonomousInteractions(); return(Situations.PushVisit(this, Sim, lot)); }
public JsonResult VerifyLotCode(Lots LotsData) { string success = ""; try { success = lotsDAL_obj.VerifyLotCode(LotsData); } catch (Exception ex) { throw ex; } return(Json(success, JsonRequestBehavior.AllowGet)); }
public void ProcessAbandonHouse(Household oldHouse, Household newHouse) { if (HouseholdsEx.NumHumans(oldHouse) != 1) { return; } Lots.ProcessAbandonLot(oldHouse.LotHome); foreach (PropertyData data in oldHouse.RealEstateManager.AllProperties) { ManagerMoney.TransferProperty(oldHouse, newHouse, data); } }
public bool HasBingo() { for (int i = 0; i < Size; i++) { bool row = Lots.FindAll(n => n.Row == i).All(l => l.Marked == true); bool column = Lots.FindAll(n => n.Column == i).All(l => l.Marked == true); if (row || column) { return(true); } } return(false); }
// GET: Lots/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Lots lots = db.Lots.Find(id); if (lots == null) { return(HttpNotFound()); } return(View(lots)); }
/// <summary> /// Use to get all transporter companies within same stewardship /// </summary> private void LoadTransporterCompaniesGrid() { try { DataSet ds = Lots.GetAllTransporterCompanieswithAddressWithinSameStewardship(UserOrganizationId); grvOrganizations.DataSource = ds; grvOrganizations.DataBind(); grvTanspoterOrganizations.DataSource = ds; grvTanspoterOrganizations.DataBind(); } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "lotInfo .LoadTransporterCompaniesGrid", ex); } }
// GET: Lots/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Lots lots = db.Lots.Find(id); if (lots == null) { return(HttpNotFound()); } ViewBag.id_Propriete = new SelectList(db.Propriete, "id", "nom_Commune", lots.id_Propriete); return(View(lots)); }
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); } }
/// <summary> /// End GridView Space Info Funcations /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /////star of Stroage lots Info Grids Funcations//////////////// protected void gvLot_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "AddMore") { LinkButton lnkbtnAddMoreSetting = gvLot.FooterRow.FindControl("lnkbtnAddMore") as LinkButton; LinkButton lnkbtnAddSetting = gvLot.FooterRow.FindControl("lnkbtnAddSetting") as LinkButton; LinkButton lnkbtnCancelSetting = gvLot.FooterRow.FindControl("lnkbtnCancelSetting") as LinkButton; lnkbtnAddSetting.Visible = true; lnkbtnAddMoreSetting.Visible = false; lnkbtnCancelSetting.Visible = true; TextBox txtLotFooter = gvLot.FooterRow.FindControl("txtLotfooter") as TextBox; //TextBox txtSpace = gvSetting.FooterRow.FindControl("txtSpaces") as TextBox; txtLotFooter.Visible = true; } if (e.CommandName == "AddLotSpace") { lblErrorLane.Text = String.Empty; lblErrorLot.Text = String.Empty; lblErrorSpace.Text = String.Empty; pnlLot.Visible = false; pnlSpace.Visible = true; hidLotId.Value = Convert.ToString(e.CommandArgument); GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int RemoveAt = gvr.RowIndex; Label lbl = (Label)gvLot.Rows[RemoveAt].FindControl("lbllotnumber"); lblLotNumberSpace.Text = lbl.Text; lblFacilityForSpace.Text = lblfacilityname.Text; LoadRows(1); } if (e.CommandName == "Insert") { try { TextBox txtParkingLot = (TextBox)((GridView)sender).FooterRow.FindControl("txtLotfooter"); int id = 0; Lots lot = new Lots(); lot.LotNumber = txtParkingLot.Text.Trim(); //Guid.NewGuid().ToString().Substring(0, 6); lot.Quantity = 0; lot.OrganizationId = UserOrganizationId;// Convert.ToInt32(ddlStakeholder.SelectedValue); lot.DateCreated = DateTime.Now; lot.IsActive = true; lot.SpaceId = 0; lot.UserID = LoginMemberId;// currentUserInfo.UserId; lot.RoleID = UserOrganizationRoleId;// currentUserInfo.RoleId; lot.IsCompleted = true; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); Guid g = Guid.NewGuid(); string str = g.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; //imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); //imgLotBarcode.Visible = true; } if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lot.BarCodeId = BarCode.Insert(br); lot.SubLot = false; lot.Permanent = true; string serialNumber = Lots.insertLot(lot, out id, str); hidLotId.Value = id.ToString(); //lbkSaveLot.Visible = false; dvLotRecord.Visible = true; LoadLots(1); //dvSpaceRecord.Visible = true; } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "addInventory.lnkLotSave_Click", ex); } } else if (e.CommandName == "Edit") { hidLotId.Value = Convert.ToString(e.CommandArgument); lblErrorLot.Text = string.Empty; } else if (e.CommandName == "Delete") { int lotId = Convert.ToInt32(e.CommandArgument); if (!lothaveTire(lotId)) { Lots.deleteLot(lotId); lblErrorLot.Text = string.Empty; LoadLots(1); lblErrorLane.Text = string.Empty; lblErrorLot.Text = string.Empty; lblErrorSpace.Text = string.Empty; } } else if (e.CommandName == "RowInfoPopUp") { LotRowControl.Visible = true; lblErrorLot.Text = String.Empty; //lblErrorSpace.Text = String.Empty; dvpopupfacilityinfo.Visible = true; //pnlLot.Visible = false; hidLotId.Value = Convert.ToString(e.CommandArgument); Lots objLots = new Lots(Conversion.ParseInt(hidLotId.Value)); GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int RemoveAt = gvr.RowIndex; HiddenField lbl = (HiddenField)gvLot.Rows[RemoveAt].FindControl("hdGVLotNumber"); hdnlotname.Value = lbl.Value; LotRowControl.loadFacilityandLotName(objLots.FacilityName, lbl.Value, hndfacilityId.Value); LotRowControl.loadLotRows(Convert.ToInt32(e.CommandArgument)); } else if (e.CommandName == "Cancel") { gvLot.EditIndex = -1; LoadLots(1); } }
private void AddNewLOT() { try { // if (string.IsNullOrEmpty(txtLotNmber.Text)) if (string.IsNullOrEmpty(hidLotId.Value)) { if (txtLotNmber.Text == "Create New Lot") { txtLotNmber.Text = string.Empty; } int id = 0; Lots lot = new Lots(); string lotNum = Guid.NewGuid().ToString().Substring(0, 6); lblLotNumber.Text = "Lot# " + lotNum; lot.LotNumber = lotNum;//txtLotNmber.Text; lot.Quantity = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToInt32(txtQuantity.Text); lot.OrganizationId = UserOrganizationId;// Convert.ToInt32(ddlStakeholder.SelectedValue); lot.DateCreated = DateTime.Now;//DateTime.Parse(txtdate.Text.ToString()); lot.IsActive = true; lot.SpaceId = 1; lot.UserID = LoginMemberId;// currentUserInfo.UserId; lot.RoleID = UserOrganizationRoleId;// currentUserInfo.RoleId; lot.IsCompleted = false; lot.ProductCategoryId = CatId; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToShortDateString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); // Guid g = Guid.NewGuid(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; imgLotBarcode.ImageUrl = String.Format("/Images/temp/{0}.Gif", str); imgLotBarcode.Visible = true; imgProductLot.ImageUrl = String.Format("/Images/temp/{0}.Gif", str); imgProductLot.Visible = true; } if (System.IO.File.Exists(Server.MapPath(String.Format("/Images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/Images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lot.BarCodeId = BarCode.Insert(br); if (chkSublot.Checked) lot.SubLot = true; else lot.SubLot = false; string serialNumber = Lots.insertLot(lot, out id, str); hidLotId.Value = id.ToString(); imgLotBarcode.Visible = true; imgLotBarcode.ImageUrl = "/Handlers/GetBarcodeImage.ashx?LotID=" + id; imgProductLot.Visible = true; imgProductLot.ImageUrl = "/Handlers/GetBarcodeImage.ashx?LotID=" + id; // lblLotNumber.Text += " " + txtLotNmber.Text; lblLotNumber.Text = "Lot# " + lotNum; lblProductLot.Text = "Lot# " + lotNum; lnkSingle.Visible = false; //ScriptManager.RegisterStartupScript(this, this.GetType(), "", "HideLotSaveLnk();", true); if (chkSublot.Checked) { Lots.updateSubLotTires(Convert.ToInt32(hidSelectedLot.Value), id, Session["SubLotTireIds"].ToString()); Session["SubLotTireIds"] = ""; Response.Redirect("lotinfo"); } else { lnkContinue.Visible = true; } } else { if (!string.IsNullOrEmpty(hidSelectedLot.Value)) hidLotId.Value = hidSelectedLot.Value; lblLotNumber.Text = "Lot# " + Lots.getLotNumberByLotId(Convert.ToInt32(hidLotId.Value)); imgLotBarcode.Visible = true; imgLotBarcode.ImageUrl = "/Handlers/GetBarcodeImage.ashx?LotID=" + hidLotId.Value; } //dvLot.Visible = false; //dvInventoryAdd.Visible = true; gvAllTire.DataSource = Tire.getCompleteTireInfo_ByLotID(Convert.ToInt32(hidLotId.Value)); gvAllTire.DataBind(); } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "addInventory.lnkLotSave_Click", ex); } }
/// <summary> /// Start of Rows Grid in Rows /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvSetting_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit") { SpaceId = Convert.ToInt32(e.CommandArgument); } else if (e.CommandName == "Delete") { int spaceId = Convert.ToInt32(e.CommandArgument); if (!rowhaveTire(spaceId)) { SpaceId = Convert.ToInt32(spaceId); lblErrorLot.Text = string.Empty; LotRows.deleteSpaces(SpaceId); LoadRows(1); lblErrorLane.Text = string.Empty; lblErrorLot.Text = string.Empty; lblErrorSpace.Text = string.Empty; } } else if (e.CommandName == "AddMore") { LinkButton lnkbtnAddMoreSetting = gvSetting.FooterRow.FindControl("lnkbtnAddMore") as LinkButton; LinkButton lnkbtnAddSetting = gvSetting.FooterRow.FindControl("lnkbtnAddSetting") as LinkButton; LinkButton lnkbtnCancelSetting = gvSetting.FooterRow.FindControl("lnkbtnCancelSetting") as LinkButton; lnkbtnAddSetting.Visible = true; lnkbtnAddMoreSetting.Visible = false; lnkbtnCancelSetting.Visible = true; TextBox txtSpaceFooter = gvSetting.FooterRow.FindControl("txtSpacesfooter") as TextBox; //TextBox txtSpace = gvSetting.FooterRow.FindControl("txtSpaces") as TextBox; txtSpaceFooter.Visible = true; //txtSpace.Visible = true; } else if (e.CommandName == "CancelSetting") { gvSetting.EditIndex = -1; LoadRows(1); } else if (e.CommandName == "Insert") { TextBox txtSpaceFooter = gvSetting.FooterRow.FindControl("txtSpacesfooter") 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"); LotRows spc = new LotRows(); spc.SpaceName = txtSpaceFooter.Text.Trim(); spc.IsActive = true; spc.DateCreated = DateTime.Now; spc.Description = string.Empty; int temp = LotRows.insertUpdate(spc, Convert.ToInt32(hidLotId.Value)); ViewState["spaceid"] = temp; //ViewState["spaceid"] = temp; LoadRows(1); } else if (e.CommandName == "SpaceInfoPopUp") { ucFacilitySpaces.Visible=true; ViewState["spaceid"] = e.CommandArgument; lblErrorSpace.Text = String.Empty; dvpopupfacilityinfo.Visible = true; //pnlLot.Visible = false; //pnlSpace.Visible = false; //pnlLane.Visible = true; //PanelLaneValue.Visible = true; //addmoreLane.Visible = false; //gvLane.Visible = true; //lblfacilityForLane.Text = lblfacilityname.Text; //lblLotNumberLane.Text = lblLotNumberSpace.Text; Lots objLots = new Lots(Conversion.ParseInt(hidLotId.Value)); GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int RemoveAt = gvr.RowIndex; Label lbl = (Label)gvSetting.Rows[RemoveAt].FindControl("lblspacename"); ucFacilitySpaces.loadFacilityLotAndRowName(objLots.FacilityName, objLots.LotNumber, lbl.Text, Convert.ToInt32(hidLotId.Value), Conversion.ParseInt(hdnidfaclityid.Value)); ucFacilitySpaces.loadLaneText(Convert.ToInt32(e.CommandArgument)); } else if (e.CommandName == "AddSpaceLane") { ViewState["spaceid"] = e.CommandArgument; lblErrorLane.Text = String.Empty; lblErrorLot.Text = String.Empty; lblErrorSpace.Text = String.Empty; pnlLot.Visible = false; pnlSpace.Visible = false; pnlLane.Visible = true; //PanelLaneValue.Visible = true; //addmoreLane.Visible = false; //gvLane.Visible = true; lblfacilityForLane.Text = lblfacilityname.Text; lblLotNumberLane.Text = lblLotNumberSpace.Text; GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int RemoveAt = gvr.RowIndex; Label lbl = (Label)gvSetting.Rows[RemoveAt].FindControl("lblspacename"); lblSpaceName.Text = lbl.Text; // DataSet ds = Space.GetParkingLotNumberByLotId(Convert.ToInt32(hidLotId.Value)); // Label lbl = (Label)gvSetting.Rows[RemoveAt].FindControl("lblspacename"); LoadSpaces(1,Convert.ToInt32(e.CommandArgument)); } }
/// <summary> /// Storage Lot InfO Next button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbkNextLot_Click(object sender, EventArgs e) { try { if( Lots.getAllLotStatusByOrganizationIdAndLotNumber(UserOrganizationId,Conversion.ParseInt(hndfacilityId.Value),txtParkingLot.Text.Trim())>0) { lblErrorLot.Text = "Storage Lot Already Exist!"; lblErrorLot.Visible = true; lblErrorLot.CssClass = "alert-danger custom-absolute-alert"; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); return; } lblErrorLane.Text = string.Empty; lblErrorLot.Text = string.Empty; lblErrorSpace.Text = string.Empty; int id = 0; Lots lot = new Lots(); lot.LotNumber = txtParkingLot.Text.Trim(); //Guid.NewGuid().ToString().Substring(0, 6); lot.Quantity = 0; lot.OrganizationId = UserOrganizationId;// Convert.ToInt32(ddlStakeholder.SelectedValue); lot.DateCreated = DateTime.Now; lot.IsActive = true; lot.SpaceId = 0; lot.UserID = LoginMemberId;// currentUserInfo.UserId; lot.RoleID = UserOrganizationRoleId;// currentUserInfo.RoleId; lot.IsCompleted = true; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); // Guid g = Guid.NewGuid(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; //imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); //imgLotBarcode.Visible = true; } if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lot.BarCodeId = BarCode.Insert(br); lot.SubLot = false; lot.Permanent = true; lot.ProductCategoryId = CatId; string serialNumber; if (Request.QueryString["fid"] != null) { int facilityid = Convert.ToInt32(Request.QueryString["fid"]); serialNumber = Lots.insertLot(lot, out id, str, facilityid); LoadLots(1, facilityid); hidLotId.Value = id.ToString(); dvLotRecord.Visible = true; if (id > 0) { lblErrorLot.Text = "Storage Lot added successfully!"; lblErrorLot.Visible = true; lblErrorLot.CssClass = "alert-success custom-absolute-alert"; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); txtParkingLot.Text = string.Empty; } } else if (Request.QueryString["fids"] != null) { int facilityid = Convert.ToInt32(Request.QueryString["fids"]); serialNumber = Lots.insertLot(lot, out id, str, facilityid); LoadLots(1, facilityid); hidLotId.Value = id.ToString(); dvLotRecord.Visible = true; if (id > 0) { lblErrorLot.Text = "Storage Lot added successfully!"; lblErrorLot.CssClass = "alert-success custom-absolute-alert"; lblErrorLot.Visible = true; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); txtParkingLot.Text = string.Empty; } } else { serialNumber = Lots.insertLot(lot, out id, str, 0); hidLotId.Value = id.ToString(); dvLotRecord.Visible = true; if (id > 0) { lblErrorLot.Text = "Storage Lot added successfully!"; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); lblErrorLot.CssClass = "alert-success custom-absolute-alert"; lblErrorLot.Visible = true; txtParkingLot.Text = string.Empty; } LoadLots(1); } // Response.Redirect("lots"); //dvSpaceRecord.Visible = true; } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "addInventory.lnkLotSave_Click", ex); } }
protected void gvAdminInventory_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit") { Lots.updateLotQuantity(Convert.ToInt32(e.CommandArgument)); //Load_AllAdminInventory(); Response.Redirect(Request.RawUrl); } else if (e.CommandName == "LotRedirect") { GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer; HiddenField status = (HiddenField)row.FindControl("hidLotStatus"); Response.Redirect("inventory-tire?OpenLotId=" + e.CommandArgument + "&status=" + status.Value); // Server.Transfer("inventory-tire.aspx?tireid="+e.CommandArgument+"&islot=true",true); // HttpContext.Current.RewritePath("inventory-tire.aspx?tireid=" + e.CommandArgument + "&islot=true"); } else if (e.CommandName == "transfer") { GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer; HiddenField hid = (HiddenField)row.FindControl("hidLotSelectId"); Session["TemporaryLotId"] = ""; Session["SpaceId"] = ""; Session["TemporaryLotId"] = hid.Value.ToString(); hidSelectedOrgId.Value = UserOrganizationId.ToString(); LoadPermanentGrid(); } else if (e.CommandName == "ViewTires") { if (CatId == (int)ProductCategory.Tire) { gvAllTire.DataSource = Tire.getAllTireByLotId(Conversion.ParseInt(e.CommandArgument)); gvAllTire.DataBind(); Lots objlot = new Lots(Conversion.ParseInt(e.CommandArgument)); lblLotNumber.Text = objlot.LotNumber; dvPermanentLot.Visible = false; dvAllProducts.Visible = false; dvAllTire.Visible = true; } else { hdnLotId.Value = e.CommandArgument.ToString(); GetAllProducts(1); } } }
private void GetAllProducts(int pageNo) { int count; gvAllProducts.DataSource = Product.getAllProductsByLotId(Conversion.ParseInt(hdnLotId.Value), CatId, pageNo, pageSize, out count); gvAllProducts.DataBind(); Lots objlot = new Lots(Conversion.ParseInt(hdnLotId.Value)); lblLotNumberProduct.Text = objlot.LotNumber; dvPermanentLot.Visible = false; dvAllTire.Visible = false; dvAllProducts.Visible = true; this.TotalItemsR = count; pgrLotProduct.DrawPager(pageNo, TotalItemsR, pageSize, MaxPagesToShow); LinkButton lnkBtn = (LinkButton)pgrLotProduct.FindControl("Button_" + pageNo.ToString()); lnkBtn.Font.Bold = true; }
//// Rowcommand Function Load Main Lots on PageLot protected void gvAdminInventory_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit") { LotId = Convert.ToInt32(e.CommandArgument); } else if (e.CommandName == "LotRedirect") { Response.Redirect("inventory-tire?tireid=" + e.CommandArgument + "&islot=true"); // Server.Transfer("inventory-tire.aspx?tireid="+e.CommandArgument+"&islot=true",true); // HttpContext.Current.RewritePath("inventory-tire.aspx?tireid=" + e.CommandArgument + "&islot=true"); } else if (e.CommandName == "SpaceInfo") { gvSpace.DataSource =LotRows.getSpacesbyLotId(Convert.ToInt32(e.CommandArgument)); gvSpace.DataBind(); //ScriptManager.RegisterStartupScript(this, GetType(), "DataInfo", "ShowSpaceInfo();", true); Lots objlots = new Lots(Conversion.ParseInt(e.CommandArgument)); lblLotNumber.Text = objlots.LotNumber; dvLotDeteleInfo.Visible = false; pnlPermanentLot.Visible = false; dvSpaceInfo.Visible = true; } else if (e.CommandName == "Cancel") { gvAdminInventory.EditIndex = -1; Load_AllAdminInventory(1); } else if (e.CommandName == "Delete") { int tirecount = Lots.gettirecount(Convert.ToInt32(e.CommandArgument)); if (tirecount > 0) { dvLotDeteleInfo.Visible = false; lblTireInfoDisplay.Text = "Inventory must be transferred to a new or existing Storage Location before this Storage Lot can be Deactivated"; lblTireInfoDisplay.ForeColor = Color.Red; Session["TemporaryLotId"] = ""; Session["SpaceId"] = ""; Session["OldLotId"] = e.CommandArgument.ToString(); hidSelectedOrgId.Value = e.CommandArgument.ToString(); LoadPermanentGrid(); //ScriptManager.RegisterStartupScript(this, GetType(), "DataInfo", "ShowDeleteLotInfo();", true); } else { //ScriptManager.RegisterStartupScript(this, GetType(), "DataInfo", "ShowDeleteLotInfo();", true); pnlPermanentLot.Visible = false; dvLotDeteleInfo.Visible = true; Session["OldLotId"] = e.CommandArgument.ToString(); //Space.DeleteLot(Convert.ToInt32(e.CommandArgument)); // LoadPermanentGrid(); //ScriptManager.RegisterStartupScript(this, GetType(), "DataInfo", "ShowLotInfo();", true); //Load_AllAdminInventory(1); } ////Space.DeleteLot(Convert.ToInt32(e.CommandArgument)); //Load_AllAdminInventory(1); } }