public override Boolean Equals(object obj) { if ((obj == null) || (obj.GetType() != this.GetType())) { return(false); } BinByTask castObj = (BinByTask)obj; return((castObj != null) && (this.RowID == castObj.RowID)); }
public IList<BinByTask> Select(BinByTask data) { IList<BinByTask> datos = new List<BinByTask>(); try { datos = GetHsql(data).List<BinByTask>(); if (!Factory.IsTransactional) Factory.Commit(); } catch (Exception e) { NHibernateHelper.WriteEventLog(WriteLog.GetTechMessage(e)); } return datos; }
public void UpdateBinByTask(BinByTask data) { Factory.DaoBinByTask().Update(data); }
public void DeleteBinByTask(BinByTask data) { Factory.DaoBinByTask().Delete(data); }
public BinByTask SaveBinByTask(BinByTask data) { return Factory.DaoBinByTask().Save(data); }
public IList<BinByTask> GetBinByTask(BinByTask data) { return Factory.DaoBinByTask().Select(data); }
public void ResetCountedBinTask(BinByTask binTask) { TranMngr.ResetCountedBinTask(binTask); }
public BinByTask SelectById(BinByTask data) { return (BinByTask)base.SelectById(data); }
public Boolean Delete(BinByTask data) { return base.Delete(data); }
public Boolean Update(BinByTask data) { return base.Update(data); }
public BinByTask Save(BinByTask data) { return (BinByTask)base.Save(data); }
public void CreateScheduledCount() { DocumentType docType = new DocumentType { DocClass = new DocumentClass { DocClassID = SDocClass.Task } }; docType.DocTypeID = SDocType.CountTask; // search for the Scheduled counts... IList<CountSchedule> list = Factory.DaoCountSchedule().Select(new CountSchedule { NextDateRun = DateTime.Today, IsDone = false }); foreach (CountSchedule sch in list) { Document document = new Document { Comment = "Scheduled Counting : "+sch.Title, DocType = docType, CrossDocking = false, IsFromErp = false, Location = sch.Location, Company = sch.Location.Company, Date1 = DateTime.Today, CreationDate = DateTime.Now, CreatedBy = WmsSetupValues.SystemUser, Notes = sch.CountOption.ToString() }; document = DocMngr.CreateNewDocument(document, true); // parametros para ejecutar el query DataSet paramsQuery = BasicMngr.GetDataSet(sch.Parameters); // ejecuta el query q trae los productos/bines DataSet dataSet = Factory.DaoIqReport().GetReportObject(sch.Query, paramsQuery); bool useProduct = true; if (sch.CountOption == 0) //Only BIN useProduct = false; foreach (DataRow row in dataSet.Tables[0].Rows) { // siempre deben enviar los alias "producto" "binCode" en el reporte !!! Product prod = null; try { if (!string.IsNullOrEmpty(row["Product"].ToString()) && useProduct) prod = Factory.DaoProduct().Select(new Product { ProductCode = row["Product"].ToString() }, 0)[0]; } catch { } Bin bin = null; try { if (!string.IsNullOrEmpty(row["BinCode"].ToString())) bin = Factory.DaoBin().Select(new Bin { BinCode = row["BinCode"].ToString() })[0]; } catch { } //Crea el BinTask x prod/bin BinByTask binByTask = new BinByTask { CreatedBy = WmsSetupValues.SystemUser, CreationDate = DateTime.Now, Bin = bin, Product = prod, TaskDocument = document, Status = new Status { StatusID = DocStatus.New } }; try { Factory.DaoBinByTask().Save(binByTask); } catch (Exception e) { continue; } } // programamos sgte fecha de conteo (si no se pasa de la fecha final) if (sch.NextDateRun.Value.AddDays(double.Parse(sch.RepeatEach.ToString())) <= sch.Finish.Value) sch.NextDateRun = sch.NextDateRun.Value.AddDays(double.Parse(sch.RepeatEach.ToString())); else // ya finaliza el conteo repetitivo sch.IsDone = true; sch.ModDate = DateTime.Now; sch.ModifiedBy = WmsSetupValues.SystemUser; Factory.DaoCountSchedule().Update(sch); } }
public void ResetCountedBinTask(BinByTask binTask) { //Saca el listado delso completado, para cancelarlos. IList<BinByTaskExecution> list = Factory.DaoBinByTaskExecution() .Select(new BinByTaskExecution { BinTask = binTask }) .Where(f=>f.Status.StatusID == DocStatus.Completed || f.Status.StatusID == DocStatus.New) .ToList(); //, Status = new Status { StatusID = DocStatus.Completed } if (list == null || list.Count == 0) return; Status cancelled = WType.GetStatus(new Status{StatusID = DocStatus.Cancelled }); foreach (BinByTaskExecution bte in list) { bte.Status = cancelled; bte.ModDate = DateTime.Now; bte.ModifiedBy = binTask.ModifiedBy; Factory.DaoBinByTaskExecution().Update(bte); } }