/// <summary> /// This method updates the carton storage and pallet id of a carton /// </summary> /// <param name="carton"></param> /// <param name="moveFlags"></param> public void MoveCarton(Carton carton, CartonUpdateFlags moveFlags) { const string QUERY = @" BEGIN <if c='$carton_area'> UPDATE <proxy />SRC_CARTON SC SET SC.SUSPENSE_DATE = NULL, SC.CARTON_STORAGE_AREA = :carton_area ,SC.location_id = :location_id WHERE SC.CARTON_ID = :carton_id; </if> <if c='$pallet_id'> UPDATE <proxy />SRC_CARTON SC SET SC.SUSPENSE_DATE = NULL, SC.PALLET_ID = :pallet_id WHERE SC.CARTON_ID = :carton_id; </if> <if c='$removePallet'> UPDATE <proxy />SRC_CARTON SC SET SC.SUSPENSE_DATE = NULL, SC.PALLET_ID = NULL WHERE SC.CARTON_ID = :carton_id; </if> <if c='$updateLocation'> UPDATE <proxy />SRC_CARTON SC SET SC.SUSPENSE_DATE = NULL, SC.location_id = :location_id WHERE SC.CARTON_ID = :carton_id; </if> END; "; var binder = SqlBinder.Create().Parameter("carton_id", carton.CartonId) .Parameter("carton_area", moveFlags.HasFlag(CartonUpdateFlags.Area) ? carton.CartonArea.AreaId : null) .Parameter("pallet_id", moveFlags.HasFlag(CartonUpdateFlags.Pallet) ? carton.PalletId : null) .Parameter("location_id", moveFlags.HasFlag(CartonUpdateFlags.Location) ? carton.LocationId : null); binder.ParameterXPath("removePallet", moveFlags.HasFlag(CartonUpdateFlags.RemovePallet)); binder.ParameterXPath("updateLocation", moveFlags.HasFlag(CartonUpdateFlags.Location)); _db.ExecuteNonQuery(QUERY, binder); }
public ActionResult DeleteConfirmed(int id) { try { Carton carton = db.Cartons.Find(id); if (carton == null) { return(RedirectToAction("BadRequest", "Error")); } //Bug #1: without code-first ef migrations on, setting the cascade delete on model building won't update actual database constraint // so removing details if they exist and then the carton itself. var cartonDetails = db.CartonDetails.Where(cd => cd.CartonId == id).ToList(); foreach (var item in cartonDetails) { db.CartonDetails.Remove(item); } if (cartonDetails != null && cartonDetails.Count > 0) { db.SaveChanges(); } db.Cartons.Remove(carton); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { log.Error(ex.Message); throw ex; } }
public ActionResult DropItemsConfirmed(int id) { var cartonnew = db.Cartons .Where(c => c.Id == id) .Select(c => new CartonDetailsViewModel() { CartonNumber = c.CartonNumber, CartonId = c.Id, Equipment = c.CartonDetails .Select(cd => new EquipmentViewModel() { Id = cd.EquipmentId, ModelType = cd.Equipment.ModelType.TypeName, SerialNumber = cd.Equipment.SerialNumber }) }) .SingleOrDefault(); //Customer Requirement 1: To delete only cartons which are empty. if (((System.Collections.Generic.List <CandidateProject.ViewModels.EquipmentViewModel>)cartonnew.Equipment).Count > 0) { Carton carton = db.Cartons.Find(id); var cartonDetails = db.CartonDetails.Where(cd => cd.CartonId == id); db.CartonDetails.RemoveRange(cartonDetails); db.SaveChanges(); } return(RedirectToAction("Index")); }
private List <Dictionary <string, string> > cartonListToArray(Carton carton, List <MandUnionFieldType> mandUnionFieldTypeList, int printNum) { List <Dictionary <string, string> > cartonList = new List <Dictionary <string, string> >(); PropertyInfo[] propertyInfoARR = carton.GetType().GetProperties(); Dictionary <string, string> property = new Dictionary <string, string>(); foreach (PropertyInfo propertyInfo in propertyInfoARR) { Object propertyVal = carton.GetType().GetProperty(propertyInfo.Name).GetValue(carton, null); if (propertyVal != null) { property.Add(propertyInfo.Name.ToUpper(), propertyVal.ToString()); } } for (int i = 0; i < printNum; i++) { Dictionary <string, string> cartonDict = new Dictionary <string, string>(); foreach (MandUnionFieldType mandUnionFieldType in mandUnionFieldTypeList) { string fieldName = mandUnionFieldType.FieldName.ToUpper(); if (property.ContainsKey(fieldName)) { cartonDict.Add(fieldName, property[fieldName]); } else { cartonDict.Add(fieldName, mandUnionFieldType.FieldValue); } } cartonList.Add(cartonDict); } return(cartonList); }
public void Afficher(Carton leCarton) { // On a 9 Colonnes, chacune contient un nombre sur 2 caractères // On va écrire chaque case sous la forme !XX // Et on ajoutera ! à la fin de la ligne pour fermer // On a donc besoin d'une ligne horizontale de 3 * 9 + 1 caractères // Maintenant, on affiche le contenu this.LigneHorizontale(); this.SautLigne(); Ligne laLigne; for (int i = 0; i < 3; i++) { laLigne = leCarton[i]; for (int j = 0; j < 9; j++) { this.SeparateurCase(); this.Case(laLigne[j], laLigne[1, j] == 1); } this.SeparateurCase(); this.SautLigne(); } this.LigneHorizontale(); this.SautLigne(); }
public ActionResult DeleteConfirmed(int id) { try { Carton carton = db.Cartons.Where(i => i.Id == id).FirstOrDefault(); var Details = db.CartonDetails.Where(j => j.CartonId == carton.Id).AsEnumerable(); //For Carton Details foreach (var Carton in Details) { var details = Carton; db.CartonDetails.Remove(details); } db.SaveChanges(); db.Cartons.Remove(carton); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Carton", "Index"))); } }
/// <summary> /// Updates carton properties only if the modified values are different from current values /// </summary> /// <param name="currentCarton">.</param> /// <param name="modifiedCarton"></param> /// <param name="updateFlags"></param> /// <param name="reasonCode"></param> /// <returns></returns> /// <remarks> /// Used for optimization. If the modified value is same as current value, the update query can be avoided /// </remarks> public bool UpdateMoveCarton(Carton currentCarton, Carton modifiedCarton, CartonUpdateFlags updateFlags, string reasonCode) { var modifications = this.GetModifications(currentCarton, modifiedCarton, updateFlags); if (modifications == CartonUpdateFlags.None) { // No property of the carton needs to be modified. Bypass checking of qualification rules. return(false); } var updated = false; if ((modifications & CartonUpdateFlags.UpdateTasks) != CartonUpdateFlags.None) { modifiedCarton.CartonId = currentCarton.CartonId; _repos.UpdateCarton(modifiedCarton, modifications, reasonCode); updated = true; } if ((modifications & CartonUpdateFlags.MoveTasks) != CartonUpdateFlags.None) { modifiedCarton.CartonId = currentCarton.CartonId; _repos.MoveCarton(modifiedCarton, modifications); updated = true; } return(updated); }
/// <summary> /// 更新裝箱單狀態, 1是已綁定棧板,2是入庫 3是出庫 /// </summary> /// <param name="carton"></param> /// <returns></returns> public bool updateCartonStatus(Carton carton, int status) { bool saveMark = true; StringBuilder strSql = new StringBuilder(); strSql.Append("update t_carton_info set carton_status=@cartonStatus,update_user=@updateUser,update_time=@updateTime where cartonNo=@cartonNo"); MySqlParameter[] parameters = { new MySqlParameter("@cartonNo", MySqlDbType.VarChar, 900), new MySqlParameter("@cartonStatus", MySqlDbType.Int32, 900), new MySqlParameter("@updateUser", MySqlDbType.VarChar, 900), new MySqlParameter("@updateTime", MySqlDbType.VarChar, 900) }; parameters[0].Value = carton.CartonNo; parameters[1].Value = status; parameters[2].Value = carton.Updateser; parameters[3].Value = carton.Updatetime; int rows = SQLHelper.ExecuteNonQuery(SQLHelper.ConnectionString, CommandType.Text, strSql.ToString(), parameters); if (rows > 0) { saveMark = true; } else { saveMark = false; } return(saveMark); }
public ActionResult Create([Bind(Include = "Id,CartonNumber")] Carton carton) { try { if (ModelState.IsValid) { //existing issue allowed cartons to be named the same, assuming each carton name/number should be unique // added check for existing carton with same carton number var existingCarton = db.Cartons.Where(c => c.CartonNumber == carton.CartonNumber).Select(c => c.Id).FirstOrDefault(); if (existingCarton <= 0) { db.Cartons.Add(carton); db.SaveChanges(); return(RedirectToAction("Index")); } else { ModelState.AddModelError("CartonNumber", "A carton with that name exists, please enter another name"); return(View()); } } return(View(carton)); } catch (Exception ex) { log.Error(ex.Message); throw ex; } }
// GET: Carton/Delete/5 public ActionResult Delete(int?id) { try { if (id == null) { return(RedirectToAction("BadRequest", "Error")); } Carton carton = db.Cartons.Where(c => c.Id == id).FirstOrDefault(); if (carton == null) { return(RedirectToAction("NotFound", "Error")); } //including details to display on confirmation screen carton.CartonDetails = db.CartonDetails.Include("Equipment.ModelType").Where(cd => cd.CartonId == carton.Id).ToList(); return(View(carton)); } catch (Exception ex) { log.Error(ex.Message); throw ex; } }
private Dictionary <string, string> cartonToDic(Carton carton, List <MandUnionFieldType> mandUnionFieldTypeList) { PropertyInfo[] propertyInfoARR = carton.GetType().GetProperties(); Dictionary <string, string> property = new Dictionary <string, string>(); foreach (PropertyInfo propertyInfo in propertyInfoARR) { Object propertyVal = carton.GetType().GetProperty(propertyInfo.Name).GetValue(carton, null); if (propertyVal != null) { property.Add(propertyInfo.Name.ToUpper(), propertyVal.ToString()); } } Dictionary <string, string> cartonDict = new Dictionary <string, string>(); foreach (MandUnionFieldType mandUnionFieldType in mandUnionFieldTypeList) { string fieldName = mandUnionFieldType.FieldName.ToUpper(); if (property.ContainsKey(fieldName)) { cartonDict.Add(fieldName, property[fieldName]); } else { cartonDict.Add(fieldName, mandUnionFieldType.FieldValue); } } return(cartonDict); }
public ActionResult DeleteConfirmed(int id) { var cartonnew = db.Cartons .Where(c => c.Id == id) .Select(c => new CartonDetailsViewModel() { CartonNumber = c.CartonNumber, CartonId = c.Id, Equipment = c.CartonDetails .Select(cd => new EquipmentViewModel() { Id = cd.EquipmentId, ModelType = cd.Equipment.ModelType.TypeName, SerialNumber = cd.Equipment.SerialNumber }) }) .SingleOrDefault(); if (((System.Collections.Generic.List <CandidateProject.ViewModels.EquipmentViewModel>)cartonnew.Equipment).Count == 0) { Carton carton = db.Cartons.Find(id); db.Cartons.Remove(carton); db.SaveChanges(); } else { ViewBag.Message = "Sorry,Carton cannot be deleted since it has equipment in it"; } return(RedirectToAction("Index")); }
public void AddCarton(Carton carton) { List <Carton> cartons = GetAvailableCartons(); cartons.Add(carton); HttpContext.Current.Session["Cartons"] = cartons; }
public ActionResult DeleteConfirmed(int id) { Carton carton = db.Cartons.Find(id); db.Cartons.Remove(carton); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult EmptyCartonConfirmed(int id) { Carton carton = db.Cartons.Find(id); var cartonDetails = db.CartonDetails.Where(cd => cd.CartonId == id); db.CartonDetails.RemoveRange(cartonDetails); db.SaveChanges(); return(RedirectToAction("Index")); }
private void CreateGrid() { vista.AllowUserToAddRows = false; vista.AllowUserToDeleteRows = false; vista.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; vista.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { setDGVTextColumn(0), setDGVTextColumn(1), setDGVTextColumn(2), setDGVTextColumn(3), setDGVTextColumn(4), }); vista.Location = new System.Drawing.Point(420, 30); vista.Name = "gvUserBoard"; vista.ReadOnly = true; vista.Size = new System.Drawing.Size(380, 300); vista.TabIndex = 0; vista.RowHeadersVisible = false; Carton nomCarton = ListaCartones.getCarton(1); int[,] Matriz = nomCarton.getCarton(); string[] rows = new string[5]; for (int i = 0; i < 5; i++) { rows[i] = ""; vista.Rows.Add(rows); } for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { vista.Rows[i].Cells[j].Value = Matriz[i, j].ToString(); } } int[,] bingMatriz = new int[5, 5]; bingMatriz[0, 0] = 0; vista.Rows[2].Cells[2].Value = "BINGO"; //vista.RowTemplate.MinimumHeight = 175 foreach (DataGridViewRow row in vista.Rows) { row.Height = 55; } for (int a = 0; a < 5; a++) { DataGridViewColumn column = vista.Columns[a]; column.Width = 75; vista.Columns[a].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; vista.Columns[a].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; } vista.CurrentCell = vista.Rows[2].Cells[2]; vista.ClearSelection(); tabPage2.Controls.Add(vista); }
public ActionResult Create([Bind(Include = "Id,CartonNumber")] Carton carton) { if (ModelState.IsValid) { db.Cartons.Add(carton); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(carton)); }
public List <Carton> querygetCartonsInfoByCartonNo(string cartonNo) { List <Carton> cartons = null; StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT uuid,cartonNo,cartonQty,carton_status,capacity_no,packType,rule_no,work_no,cus_no,cus_name,cus_po,po_qty,cus_matno,del_matno,offi_no,ver_no,wo_quantity,model_no,so_order,box_No,special_Field,union_Field,prodLine_val,date_code,batchNo,op_user,create_time,update_user,update_time FROM t_carton_info where cartonNo =@cartonNo"); MySqlParameter[] parameters = { new MySqlParameter("@cartonNo", MySqlDbType.VarChar, 900) }; parameters[0].Value = cartonNo; DataSet ds = SQLHelper.ExecuteDataset(SQLHelper.ConnectionString, CommandType.Text, strSql.ToString(), parameters); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { cartons = new List <Carton>(); foreach (DataRow dr in ds.Tables[0].Rows) { Carton carton = new Carton();; carton.Uuid = dr["uuid"].ToString(); carton.CartonNo = dr["cartonNo"].ToString(); carton.CartonQty = (int)dr["cartonQty"]; carton.CartonStatus = dr["carton_status"].ToString(); carton.CapacityNo = dr["capacity_no"].ToString(); carton.PackType = dr["packType"].ToString(); carton.Ruleno = dr["rule_no"].ToString(); carton.Workno = dr["work_no"].ToString(); carton.Cusno = dr["cus_no"].ToString(); carton.Cusname = dr["cus_name"].ToString(); carton.Cuspo = dr["cus_po"].ToString(); carton.Orderqty = dr["po_qty"].ToString(); carton.Cusmatno = dr["cus_matno"].ToString(); carton.Delmatno = dr["del_matno"].ToString(); carton.Offino = dr["offi_no"].ToString(); carton.Verno = dr["ver_no"].ToString(); carton.Woquantity = dr["wo_quantity"].ToString(); carton.Modelno = dr["model_no"].ToString(); carton.SoOrder = dr["so_order"].ToString(); carton.BoxNo = dr["box_No"].ToString(); carton.SpecialField = dr["special_Field"].ToString(); carton.UnionField = dr["union_Field"].ToString(); carton.ProdLineVal = dr["prodLine_val"].ToString(); carton.Datecode = dr["date_code"].ToString(); carton.BatchNo = dr["batchNo"].ToString(); carton.Opuser = dr["op_user"].ToString(); carton.Createtime = dr["create_time"].ToString(); carton.Updateser = dr["update_user"].ToString(); carton.Updatetime = dr["update_time"].ToString(); cartons.Add(carton); } } return(cartons); }
public ActionResult AddCarton(DimensionsViewModel dimensions) { CartonizationService service = new CartonizationService(); int cartonId = service.GetAvailableCartons().Count > 0 ? service.GetAvailableCartons().Last().Id + 1 : 1; Carton p = new Carton(cartonId, dimensions.Height, dimensions.Length, dimensions.Width); service.AddCarton(p); return(Json(p)); }
private void button2_Click(object sender, EventArgs e) { if (this.dataGridView1.CurrentRow == null) { MessageBox.Show("請輸入正確的查詢條件或請選中表中的行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.textBox1.Focus(); return; } int index = this.dataGridView1.CurrentRow.Index; string modelNo = this.dataGridView1.Rows[index].Cells["model_no"].Value.ToString(); string cusNo = this.dataGridView1.Rows[index].Cells["cus_no"].Value.ToString(); string delMatno = this.dataGridView1.Rows[index].Cells["del_matno"].Value.ToString(); string filePath = modelInfoService.previewModelFile(modelNo); if (filePath == null) { MessageBox.Show("未找到該客戶出貨料號對應的打印模板信息,請維護相關信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //查詢打印模板的打印字段 MandRelDel mandRelDel = mandRelDelService.queryManNoByDel(cusNo, delMatno, "1"); if (mandRelDel == null) { MessageBox.Show("未找到該客戶出貨料號對應的打印字段規則信息,請維護相關信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <MandUnionFieldType> mandUnionFieldTypeList = manRelFieldTypeService.queryMandUnionFieldTypeList(mandRelDel.ManNo); if (mandUnionFieldTypeList == null) { MessageBox.Show("未找到該客戶出貨料號對應的打印字段規則信息,請維護相關信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string cartonNo = this.dataGridView1.Rows[index].Cells["cartonNo"].Value.ToString(); Carton carton = cartonService.queryCartonDetailsByNo(cartonNo); if (carton.CtCodeList != null) { initCTSeq(carton); } bool judgePrint = barPrint.bactchPrintPalletByModel(filePath, cartonToDic(carton, mandUnionFieldTypeList)); if (judgePrint) { //printQ.savePrintRecord(ctcodeEntity); } else { MessageBox.Show("打印失敗請聯係管理員!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
public ActionResult DeleteConfirmed(int id) { var range = db.CartonDetails.Where(i => i.CartonId == id); db.CartonDetails.RemoveRange(range); Carton carton = db.Cartons.Find(id); //var items = carton.CartonDetails; db.Cartons.Remove(carton); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// TODO 將集合中的CT碼 賦值到carton中 /// </summary> /// <param name="ctcodeList"></param> private void initCTSeq(List <CTCode> ctcodeList, Carton carton) { List <String> ctList = new List <string>(); for (int i = 0; i < ctcodeList.Count; i++) { switch (i) { case 0: carton.Ct1 = ctcodeList[i].Ctcode; break; case 1: carton.Ct2 = ctcodeList[i].Ctcode; break; case 2: carton.Ct3 = ctcodeList[i].Ctcode; break; case 3: carton.Ct4 = ctcodeList[i].Ctcode; break; case 4: carton.Ct5 = ctcodeList[i].Ctcode; break; case 5: carton.Ct6 = ctcodeList[i].Ctcode; break; case 6: carton.Ct7 = ctcodeList[i].Ctcode; break; case 7: carton.Ct8 = ctcodeList[i].Ctcode; break; case 8: carton.Ct9 = ctcodeList[i].Ctcode; break; case 9: carton.Ct10 = ctcodeList[i].Ctcode; break; } ctList.Add(ctcodeList[i].Ctcode); } carton.CtCodeList = ctList; }
public ActionResult DeleteConfirmed(int id) { if (id <= 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CartonBuilderSingletonUtil.Instance.DeleteAllCartondetail(id); Carton carton = db.Cartons.Find(id); db.Cartons.Remove(carton); db.SaveChanges(); return(RedirectToAction("Index")); }
private void initCTSeq(Carton carton) { List <String> ctcodeList = carton.CtCodeList; for (int i = 0; i < ctcodeList.Count; i++) { switch (i) { case 0: carton.Ct1 = ctcodeList[i]; break; case 1: carton.Ct2 = ctcodeList[i]; break; case 2: carton.Ct3 = ctcodeList[i]; break; case 3: carton.Ct4 = ctcodeList[i]; break; case 4: carton.Ct5 = ctcodeList[i]; break; case 5: carton.Ct6 = ctcodeList[i]; break; case 6: carton.Ct7 = ctcodeList[i]; break; case 7: carton.Ct8 = ctcodeList[i]; break; case 8: carton.Ct9 = ctcodeList[i]; break; case 9: carton.Ct10 = ctcodeList[i]; break; } } }
public string VerificarVictoriaConFigura(string figura) { //Arange Carton carton = new Carton(); string respuesta = ""; //Act foreach (var cord in FigurasCarton.Figuras(figura)) { respuesta = carton.MarcarNumero(carton.ObtenerNumeroEnCoordenada(cord)); } return(respuesta); }
public ActionResult EmptyCarton(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Carton carton = db.Cartons.Find(id); if (carton == null) { return(HttpNotFound()); } return(View(carton)); }
private void fastPendingCartons_MouseDown(object sender, MouseEventArgs e) { try { if (e.Button == System.Windows.Forms.MouseButtons.Right && this.fastPendingCartons.SelectedObject != null) { Carton carton = (Carton)this.fastPendingCartons.SelectedObject; if (carton != null) { LineDetailBinlLocation lineDetailBinlLocation = new LineDetailBinlLocation() { CommodityID = carton.CommodityID, CartonID = carton.CartonID, CartonCode = carton.Code, WarehouseID = this.warehouseAdjustmentViewModel.WarehouseID, BinLocationID = carton.BinLocationID, BinLocationCode = carton.BinLocationCode, Quantity = (decimal)carton.Quantity, LineVolume = carton.LineVolume }; Pickups.WizardDetail wizardDetail = new Pickups.WizardDetail(lineDetailBinlLocation); TabletMDI tabletMDI = new TabletMDI(wizardDetail); if (tabletMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (var checkedObject in this.fastPendingCartons.Objects) { Carton p = (Carton)checkedObject; //if (p.BinLocationID == null) //{ p.BinLocationID = (int)lineDetailBinlLocation.BinLocationID; p.BinLocationCode = lineDetailBinlLocation.BinLocationCode; //} } this.fastPendingCartons.RefreshObject(carton); } wizardDetail.Dispose(); tabletMDI.Dispose(); } } } catch (Exception exception) { ExceptionHandlers.ShowExceptionMessageBox(this, exception); } }
public Carton queryCartonDetailsByNo(string cartonNo) { Carton carton = cartonDao.queryCartonByCartonNo(cartonNo); List <CtRelCarton> ctRelCartons = cartonDao.queryRelCTByCartonNo(cartonNo); if (ctRelCartons != null) { List <String> ctList = new List <string>(); foreach (CtRelCarton ctRelCarton in ctRelCartons) { ctList.Add(ctRelCarton.Ctcode); } carton.CtCodeList = ctList; } return(carton); }
private void btnPruebaAcomodaNum_Click(object sender, EventArgs e) { string text = TopicosExamen1.MenuInicio.ControlID.TextData; string text1 = TopicosExamen1.MenuInicio.ControlID1.TextData1; int primerNum = int.Parse(text); int segundoNum = int.Parse(text1); int id = 1; int [,] Carton1 = LogicaDeNegocio.Metodos.AcomodaNum(); Carton cartonNuevo = new Carton(id, Carton1); LogicaDeNegocio.ListaCartones.AgregarCarton(cartonNuevo); //Carton Carton2 = LogicaDeNegocio.ListaCartones.getCarton(1); //id++; CreateGrid(); }
public ActionResult DeleteConfirmed(int id) { Carton carton = db.Cartons.Find(id); if (carton != null) { // DM: this is a different pattern then is used else where (existing code uses include and where instead of Find) // I believe Find can have some small performance gains due to caching so I'll leave it here but this would be // an item up for team review to determine a preferred pattern for consistency. db.Entry(carton).Collection(c => c.CartonDetails).Load(); db.CartonDetails.RemoveRange(carton.CartonDetails); db.Cartons.Remove(carton); db.SaveChanges(); } return(RedirectToAction("Index")); }
public void addCarton(Carton c) { _cartons.Add(c); }