// GET: POS/Edit/5 public ActionResult Edit(int?id) { if (id == null) { var curentUserEmail = HttpContext.User.Identity.Name; var student = db.Students.FirstOrDefault(s => s.Email == curentUserEmail); var pos = db.POS.FirstOrDefault(p => p.StudentId == student.Id); var programOfStudy = db.POS.FirstOrDefault(p => p.Id == pos.Id); var programOfStudyViewModel = new PotentialClassIndexViewModel() { CourseList = programOfStudy, posImage = db.Students.FirstOrDefault(s => s.Id == programOfStudy.StudentId) }; return(View(programOfStudyViewModel)); } POS pOS = db.POS.Find(id); var viewModel = new PotentialClassIndexViewModel() { CourseList = pOS, posImage = db.Students.FirstOrDefault(s => s.Id == pOS.StudentId) }; //if (pOS == null) //{ // return HttpNotFound(); //} ViewBag.StudentId = new SelectList(db.Students, "Id", "LastName", pOS.StudentId); return(View(viewModel)); }
// GET: POS/Edit/5 public ActionResult Edit(int?id) { if (id == null) { var curentUserEmail = HttpContext.User.Identity.Name; var student = db.Students.FirstOrDefault(s => s.EmailAddress == curentUserEmail); var pos = db.POS.FirstOrDefault(p => p.StudentID == student.ID); var programOfStudy = db.POS.FirstOrDefault(p => p.ID == pos.ID); var programOfStudyViewModel = new posViewModel() { posCourses = programOfStudy, posDocument = db.Students.FirstOrDefault(s => s.ID == programOfStudy.StudentID) }; return(View(programOfStudyViewModel)); } POS pOS = db.POS.Find(id); var viewModel = new posViewModel() { posCourses = pOS, posDocument = db.Students.FirstOrDefault(s => s.ID == pOS.StudentID) }; //if (pOS == null) //{ // return HttpNotFound(); //} return(View(viewModel)); }
public PartialViewResult posImage(int?id) { POS pOS = db.POS.Find(id); var document = db.Students.Where(s => s.Id == id); return(PartialView("ImagePartial", document)); }
public object Get(POS.Dto.Category request) { var response = new CategoryResponse(); try { if (request.Id.HasValue) { var category = GetById(request.Id.Value); response.Category.Add(category); response.Result = "1 Category was found"; } else { //Get all response.Category = GetByAll(); response.Result = "All Categorys was found"; } } catch (Exception) { } return response; }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { //hide the damn column grdBase.HiddenColumnName = new List<string>() { "stock_head_id" }; DataSet ds = ServiceProvider.StockHeadService.GetStockHead(); if (ds.Tables.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { if (row["Status"].ToStringNullable() == TransactionStatus.IN.NormalCode) { row["Status"] = TransactionStatus.IN.NormalText; } else if (row["Status"].ToStringNullable() == TransactionStatus.IN.FinalCode) { row["Status"] = TransactionStatus.IN.FinalText; } row["Document Date"] = DateTime.Parse(row["Document Date"].ToString()).ConvertDateToDisplay(); row["Period"] = DateTime.Parse(row["Period"].ToString()).ConvertDateToDisplay(); } } grdBase.DataSourceDataSet = ds; grdBase.DataKeyName = new string[] { DataKeyName }; //try to set its visibility grdBase.btnDeleteEnable = false; grdBase.RearrangeButton(); }
public Instructions() { instructions["ST"] = new ST(); instructions["LD"] = new LD(); instructions["ADD"] = new ADD(); instructions["SUB"] = new SUB(); instructions["JMP"] = new JMP(); instructions["JN"] = new JN(); instructions["JP"] = new JP(); instructions["JZ"] = new JZ(); instructions["JNZ"] = new JNZ(); instructions["HALT"] = new HALT(); //Second architecture functions. instructions["LD2"] = new LD2(); instructions["LD3"] = new LD3(); instructions["ST2"] = new ST2(); instructions["ST3"] = new ST3(); instructions["POS"] = new POS(); instructions["PXL"] = new PXL(); instructions["RND"] = new RND(); instructions["CLR"] = new CLR(); instructions["COS"] = new COS(); instructions["SIN"] = new SIN(); instructions["IN"] = new IN(); }
// this not only fetches senses, it processes relatives too List<Sense> fetch_senses(POS s, string searchstr) { StreamReader reader = _dictFiles[getDataFile(s.posType)]; List<Sense> results = new List<Sense>(s.offsets.Count); foreach(long offset in s.offsets) { reader.DiscardBufferedData(); reader.BaseStream.Position = offset; string ln = reader.ReadLine(); // get the sense first int sense_start = ln.LastIndexOf(senseFieldDelim); Debug.Assert(sense_start != -1); string senseAndExample = ln.Substring(sense_start + 2).TrimEnd().Replace('_', ' '); int delim = senseAndExample.IndexOf('"'); if (delim != -1) results.Add(new Sense { Definition = senseAndExample.Substring(0, delim), Example = senseAndExample.Substring(delim) }); else results.Add(new Sense { Definition = senseAndExample }); // then look up the relatives parse_data_line(ln.Substring(0, sense_start), searchstr, s.posType); } return results; }
private static bool UpdateTransaction(PURPurchaseReturnHeader pURPurchaseReturnHeader, PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection, POS.DataLayer.PURPurchaseReturnHeader _pURPurchaseReturnHeader) { _pURPurchaseReturnHeader.IsVoid = false; _pURPurchaseReturnHeader.CreatedBy = GlobalVariables.CurrentUser.UserID; _pURPurchaseReturnHeader.CreateDate = DateTime.Now; _pURPurchaseReturnHeader.UpdatedBy = GlobalVariables.CurrentUser.UserID; _pURPurchaseReturnHeader.UpdateDate = DateTime.Now; _pURPurchaseReturnHeader.IsDeleted = false; _pURPurchaseReturnHeader.DeletedBy = null; _pURPurchaseReturnHeader.DeleteDate = null; _pURPurchaseReturnHeader.OriginalHeaderID = pURPurchaseReturnHeader.OriginalHeaderID; _pURPurchaseReturnHeader.ReturnDate = pURPurchaseReturnHeader.ReturnDate; _pURPurchaseReturnHeader.PurchaseReturnID = pURPurchaseReturnHeader.PurchaseReturnID; POS.DataLayer.PURPurchaseReturnLineCollection _pURPurchaseReturnLineCollection = new DataLayer.PURPurchaseReturnLineCollection(); foreach (PURPurchaseReturnLine pURPurchaseReturnLine in pURPurchaseReturnLineCollection) { POS.DataLayer.PURPurchaseReturnLine _pURPurchaseReturnLine = new POS.DataLayer.PURPurchaseReturnLine(); _pURPurchaseReturnLine.Qty = pURPurchaseReturnLine.Qty; _pURPurchaseReturnLine.BatchNumber = pURPurchaseReturnLine.BatchNumber; _pURPurchaseReturnLine.ExpiryDate = pURPurchaseReturnLine.ExpiryDate; _pURPurchaseReturnLine.OriginalpurchaseLineID = pURPurchaseReturnLine.OriginalpurchaseLineID; _pURPurchaseReturnLine.Reason = pURPurchaseReturnLine.Reason; _pURPurchaseReturnLineCollection.Add(_pURPurchaseReturnLine); } POS.DataLayer.PURPurchaseReturnLine pURPurchaseReturnLineObj = new DataLayer.PURPurchaseReturnLine(); return pURPurchaseReturnLineObj.UpdateTransaction(_pURPurchaseReturnHeader, _pURPurchaseReturnLineCollection); }
public bool ExisteEnLaBaseDeDatos() { POSRepositorio repo = new POSRepositorio(); POS p = repo.Buscar((int)IDNumericUpDown.Value); return(p != null); }
private void Busquedabutton_Click_1(object sender, EventArgs e) { int id; int.TryParse(IDNumericUpDown.Text, out id); POSRepositorio repo = new POSRepositorio(); POS p = new POS(); p = repo.Buscar(id); Limpiar(); if (p == null) { MessageBox.Show("No encontrado"); } else { if (p.Estado == false) { LlenarCampo(p); } else { MessageBox.Show("Ya este registro del pos esta cerrado en caja"); } } }
private void BatchInsert(String fileName, String encoder) { String content = PanGu.Framework.File.ReadFileToString(fileName, Encoding.GetEncoding(encoder)); String[] words = PanGu.Framework.Regex.Split(content, @"\r\n"); bool allUse = false; WordAttribute lstWord = null; foreach (String word in words) { if (word == null) { continue; } if (word.Trim() == "") { continue; } string[] strs = word.Split(new char[] { '|' }); if (strs.Length == 3) { try { POS pos = (POS)int.Parse(strs[1].Substring(2, strs[1].Length - 2), System.Globalization.NumberStyles.HexNumber); double frequency = double.Parse(strs[2]); string w = strs[0].Trim(); _WordDict.InsertWord(w, frequency, pos); continue; } catch { } } FormBatchInsert frmBatchInsert = new FormBatchInsert(); if (!allUse || lstWord == null) { frmBatchInsert.Word.Word = word.Trim(); if (frmBatchInsert.ShowDialog() == DialogResult.OK) { lstWord = frmBatchInsert.Word; allUse = frmBatchInsert.AllUse; _WordDict.InsertWord(lstWord.Word, lstWord.Frequency, lstWord.Pos); } } else { lstWord.Word = word.Trim(); _WordDict.InsertWord(lstWord.Word, lstWord.Frequency, lstWord.Pos); } } }
private WordDictionaryFile LoadFromTextFile(String fileName) { WordDictionaryFile dictFile = new WordDictionaryFile(); dictFile.Dicts = new List <WordAttribute>(); using (StreamReader sr = new StreamReader(fileName, Encoding.UTF8)) { while (!sr.EndOfStream) { string line = sr.ReadLine(); string[] strs = line.Split(new char[] { '|' }); if (strs.Length == 3) { string word = strs[0].Trim(); POS pos = (POS)int.Parse(strs[1].Substring(2, strs[1].Length - 2), System.Globalization.NumberStyles.HexNumber); double frequency = double.Parse(strs[2]); WordAttribute dict = new WordAttribute(word, pos, frequency); dictFile.Dicts.Add(dict); } } } return(dictFile); }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { //hide the damn column grdBase.HiddenColumnName = new List<string>() { "ID" };//, "Supplier", "Warehouse" }; //grdBase.SetColumnFit(); List<string> statusList; if (ddlStatus.SelectedIndex == 0) statusList = new List<string>() { KitichenStatus.Cancel, KitichenStatus.Finish }; else statusList = new List<string>() { ddlStatus.SelectedValue.ToString() }; grdBase.DataSourceDataSet = ServiceProvider.KCSaleOrderDetailService.FindOrderInKitchenHistory(txtTableName.Text.Trim(), txtMenuName.Text.Trim(), statusList); grdBase.DataKeyName = new string[] { DataKeyName }; //try to set its visibility grdBase.btnDeleteEnable = false; grdBase.btnAddEnable = false; grdBase.RearrangeButton(); }
private void btnLogin_Click(object sender, EventArgs e) { DataSet dsCashier = new DataSet(); dsCashier = com.ReturnDataSet("SELECT dbo.Users.ID, dbo.Users.Username, dbo.Users.FactoryId, dbo.Factories.Code AS Factory " + "FROM dbo.Users INNER JOIN " + "dbo.Factories ON dbo.Users.FactoryId = dbo.Factories.ID " + "WHERE(dbo.Users.Username = '******') AND(dbo.Users.IsActive = 1)"); if (dsCashier.Tables[0].Rows.Count > 0) { Variables._CashierId = Convert.ToInt32(dsCashier.Tables[0].Rows[0].ItemArray.GetValue(0).ToString()); Variables._CashierEPF = dsCashier.Tables[0].Rows[0].ItemArray.GetValue(1).ToString(); Variables._CashierFactoryId = Convert.ToInt32(dsCashier.Tables[0].Rows[0].ItemArray.GetValue(2).ToString()); Variables._CashierFactoryName = dsCashier.Tables[0].Rows[0].ItemArray.GetValue(3).ToString(); POS pOS = new POS(); this.Hide(); pOS.Show(); } else { MessageBox.Show("Access Denied." + "\n" + " Please Enter a Valid Username", "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Error); txtUsername.Clear(); txtUsername.Focus(); //lblMessage.Text = "Access Denied"; } }
public void ClearForm() { try { m_si = new POS(); textBoxCode.Text = ""; dateKryptonDateTimePicker.Value = DateTime.Today; employeeKryptonComboBox.SelectedIndex = 0; currencyKryptonComboBox.SelectedIndex = 0; nettotalAmountkryptonNumericUpDown.Value = 0m; notesKryptonTextBox.Text = ""; divisionKryptonComboBox.SelectedIndex = 0; termofpaymentKryptonComboBox.SelectedIndex = 0; duedateKryptonDateTimePicker.Value = DateTime.Today; subTotalKryptonNumericUpDown.Value = 0m; discPercentKryptonNumericUpDown.Value = 0m; discAmountkryptonNumericUpDown.Value = 0m; discAfterAmountKryptonNumericUpDown.Value = 0m; taxKryptonComboBox.SelectedIndex = 0; taxAfterAmountkryptonNumericUpDown.Value = 0m; otherExpensekryptonNumericUpDown.Value = 0m; supplierkryptonComboBox.Text = "POS"; docnokryptonTextBox.Text = ""; docdatekryptonDateTimePicker.Value = DateTime.Today; itemsDataGrid.Rows.Clear(); errorProvider1.Clear(); } catch (Exception x) { KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void Test01Connectivity() { POS pos = new POS(PORT); Assert.IsTrue(pos.Connect()); pos.Disonnect(); }
void AddFormsToDictionary(List <string> forms, string word, POS pos) { foreach (string form in forms) { AddToDictionary(form, word, pos); } }
public void findLastUnvisitedSpTest() { try { POS sp1 = new POS(0, 0, 0, 2, 0); POS sp2 = new POS(0, 0, 0, 2, 0); List<POS> spList = new List<POS>(); spList.Add(sp1); spList.Add(sp2); List<POS> visitedSpList = new List<POS>(); visitedSpList.Add(sp1); Storyline np = new Storyline(0, 4); np.setStorypointList(spList); np.setVisitedStorypointList(visitedSpList); Assert.IsNotNull(sp1); Assert.IsNotNull(sp2); Assert.IsNotNull(np); Assert.IsNotNull(spList); Assert.IsNotNull(visitedSpList); Assert.Equals(sp1, np.findLastUnvisitedSp()); } catch (SecurityException e) { Console.WriteLine("Security Exception:\n\n{0}", e.Message); } }
public ActionResult Delete_Detalles(int id_det) { dev_orquestaEntities db = new dev_orquestaEntities(); DETALLE_INVENTARIO detalle = new DETALLE_INVENTARIO(); List <Detalle_InventarioDTO> datos = new List <Detalle_InventarioDTO>(); ARTICULO art = new ARTICULO() { }; detalle = db.DETALLE_INVENTARIO .Include("ARTICULO").FirstOrDefault(ct => ct.Id_Detalle_Inventario.Equals(id_det)); if (detalle.ARTICULO.Id_Categoria == 1) { POS po = db.ARTICULO.OfType <POS>().FirstOrDefault(ct => ct.Id_Articulo.Equals(detalle.ARTICULO.Id_Articulo)); db.ARTICULO.Remove(po); } else { SIM si = db.ARTICULO.OfType <SIM>().FirstOrDefault(ct => ct.Id_Articulo.Equals(detalle.ARTICULO.Id_Articulo)); db.ARTICULO.Remove(si); } db.DETALLE_INVENTARIO.Remove(detalle); db.SaveChanges(); datos = lista_datos_detalles(detalle.Id_Inventario); return(View("Details", datos)); }
public object Get(POS.Dto.Brand request) { var response = new BrandResponse(); response.Result = "1 Brand was found"; try { if (request.Id.HasValue) { var brand = GetById(request.Id.Value); response.Brand.Add(brand); response.Result = "All Brands was found"; } else { //Get all response.Brand = GetByAll(); response.Result = "was faund all"; } } catch (Exception) { throw; } return response; }
private Y_POS yRollingMean(List <Y_POS> posList) { int n = posList.Count; int cnt = 1; POS pos = posList[n - 1]; POS maxPos = pos; POS minPos = pos; for (int i = n - 2; i >= 0 && i >= n - 9; i--) { cnt++; pos = pos + posList[i]; maxPos = POS.max(maxPos, posList[i]); minPos = POS.min(minPos, posList[i]); } if (cnt > 2) { pos = (pos - maxPos - minPos) / (cnt - 2); } else { pos = pos / cnt; } return(new Y_POS(pos)); }
public POS LlenarClase() { POS pos = new POS(); pos.PosId = Convert.ToInt32(IDNumericUpDown.Value); pos.Cantidad = Convert.ToInt32(CantidadLabel.Text); pos.Fecha = FechaDateTimePicker.Value; pos.Impuesto = Convert.ToDouble(ImpuestosResultadolabel.Text); pos.SubTotal = Convert.ToDouble(SubtotalResultadolabel.Text); pos.Total = Convert.ToDouble(TotalResultadolabel.Text); pos.Estado = false; if (TarjetaRadioButton.Checked) { pos.TipoPago = "Tarjeta credito"; } else { pos.TipoPago = "Efectivo"; } pos.ProductosPOS = this.detalle; CargarGrid(); return(pos); }
public PartialViewResult GetPOSDocument(int?id) { POS pOS = db.POS.Find(id); var document = db.Students.Where(s => s.ID == id); return(PartialView("_ProgramOfStudyDocuments", document)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,ProductName,Quantity,Amount")] POS pOS) { if (id != pOS.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pOS); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!POSExists(pOS.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pOS)); }
private void btn_pha_Click(object sender, EventArgs e) { this.Close(); POS nn = new POS(); nn.Show(); }
public void InactivePOS(POS pos) { using (var con = WriteConnection()) { con.Execute("UPDATE POS SET [Status]=@Status WHERE SN=@SN", new { Status = POSStatus.Inactived, SN = pos.Sn }); } }
private static bool UpdateTransaction(SALSalesReturnHeader sALSalesReturnHeader, SALSalesReturnLineCollection sALSalesReturnLineCollection, POS.DataLayer.SALSalesReturnHeader _sALSalesReturnHeader) { _sALSalesReturnHeader.IsVoid = false; _sALSalesReturnHeader.CreatedBy = GlobalVariables.CurrentUser.UserID; _sALSalesReturnHeader.CreateDate = DateTime.Now; _sALSalesReturnHeader.UpdatedBy = GlobalVariables.CurrentUser.UserID; _sALSalesReturnHeader.UpdateDate = DateTime.Now; _sALSalesReturnHeader.IsDeleted = false; _sALSalesReturnHeader.DeletedBy = null; _sALSalesReturnHeader.DeleteDate = null; _sALSalesReturnHeader.OriginalSalesHeadeID = sALSalesReturnHeader.OriginalSalesHeadeID; _sALSalesReturnHeader.ReturnDate = sALSalesReturnHeader.ReturnDate; _sALSalesReturnHeader.SlaesReturnHeaderID = sALSalesReturnHeader.SlaesReturnHeaderID; _sALSalesReturnHeader.InventoryID = sALSalesReturnHeader.InventoryID; _sALSalesReturnHeader.ReturnMoney = sALSalesReturnHeader.ReturnMoney; POS.DataLayer.SALSalesReturnLineCollection _sALSalesReturnLineCollection = new DataLayer.SALSalesReturnLineCollection(); foreach (SALSalesReturnLine sALSalesReturnLine in sALSalesReturnLineCollection) { POS.DataLayer.SALSalesReturnLine _sALSalesReturnLine = new POS.DataLayer.SALSalesReturnLine(); _sALSalesReturnLine.Qty = sALSalesReturnLine.Qty; _sALSalesReturnLine.BatchNumber = sALSalesReturnLine.BatchNumber; _sALSalesReturnLine.ExpiryDate = sALSalesReturnLine.ExpiryDate; _sALSalesReturnLine.OriginalSalesLineID = sALSalesReturnLine.OriginalSalesLineID; _sALSalesReturnLine.Reason = sALSalesReturnLine.Reason; _sALSalesReturnLineCollection.Add(_sALSalesReturnLine); } POS.DataLayer.SALSalesReturnLine sALSalesReturnLineObj = new DataLayer.SALSalesReturnLine(); return sALSalesReturnLineObj.UpdateTransaction(_sALSalesReturnHeader, _sALSalesReturnLineCollection); }
private void OKkryptonButton_Click(object sender, EventArgs e) { if (gridData.SelectedRows.Count > 0) { POS = (POS)gridData.SelectedRows[0].Tag; this.Close(); } }
public IEnumerable <Term> FindTermsByPOS(POS pos) { var result = from term in terms.Values where term.PoS == pos select term; return(result); }
public override global::System.Data.DataSet Clone() { POS cln = ((POS)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
private void gridData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (gridData.SelectedRows.Count > 0) { POS = (POS)gridData.SelectedRows[0].Tag; this.Close(); } }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { Material entity = new Material(); entity.material_code = txtMaterialCode.Text; entity.material_name = txtMaterialName.Text; grdBase.DataSourceDataSet = ServiceProvider.MaterialService.GetGridMaterial(entity); grdBase.DataKeyName = new string[] { DataKeyName }; }
private void PointOfSaleBtn_Click(object sender, EventArgs e) { POS aPOS = new POS(); aPOS.Show(); aPOS.MdiParent = this; UpdateMain(); }
public ActionResult DeleteConfirmed(int id) { POS pOS = db.POS.Find(id); db.POS.Remove(pOS); db.SaveChanges(); return(RedirectToAction("Index")); }
private void POS_Click(object sender, EventArgs e) { POS ps = new POS(""); Hide(); ps.ShowDialog(); Close(); }
public X_POS(POS p) { init(21); for (int i = 0; i < N; i++) { vec[i] = p.vec[i]; } }
public WordInfo(string word, int position, POS pos, double frequency, int rank, WordType wordTye, WordType originalWordType) : base(word, pos, frequency) { Position = position; WordType = wordTye; OriginalWordType = originalWordType; Rank = rank; }
public Y_POS(POS p) { init(35); for (int i = 0; i < N; i++) { vec[i] = p.vec[i]; } }
public void CompareToTest() { try { POS sp1 = new POS(1, 0, 0, 3, 0); POS sp2 = new POS(1, 0, 0, 2, 0); Assert.Equals(1, sp1.CompareTo(sp2)); } catch (SecurityException e) { Console.WriteLine("Security Exception:\n\n{0}", e.Message); } }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenRotationOne Begin (GameObject go, float duration, POS pos , float angle) { TweenRotationOne comp = UITweener.Begin<TweenRotationOne>(go, duration); comp.pos = pos; comp.from = comp.value; comp.to = angle; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return comp; }
public void grdBomDetail_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { //hide the damn column //grdBomHead.HiddenColumnName = new List<string>() { "ID" };//, "Supplier", "Warehouse" }; //grdBase.SetColumnFit(); grdBomDetail.DataSourceDataSet = ServiceProvider.KCSaleOrderDetailService.FindBOMDetailByOrderDetailId(globalMaterialID); //try to set its visibility grdBomDetail.btnDeleteEnable = false; grdBomDetail.btnAddEnable = false; grdBomDetail.btnSearchEnable = false; // grdBomHead.RearrangeButton(); }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { //hide the damn column grdBomHead.HiddenColumnName = new List<string>() { "ID" }; grdBomHead.DataSourceDataSet = ServiceProvider.KCSaleOrderDetailService.FindBOMHeaderByOrderDetailId(globalMaterialID); grdBomHead.DataKeyName = new string[] { DataKeyName }; //try to set its visibility grdBomHead.btnDeleteEnable = false; grdBomHead.btnAddEnable = false; grdBomHead.btnSearchEnable = false; // grdBomHead.RearrangeButton(); }
public void isInOrderTest() { try { POS sp1 = new POS(0, 0, 0, 2, 0); POS sp2 = new POS(0, 0, 0, 2, 0); List<POS> spList = new List<POS>(); spList.Add(sp1); spList.Add(sp2); Storyline np = new Storyline(0, 4); np.setStorypointList(spList); Assert.True(np.isInOrder(sp1)); } catch (SecurityException e) { Console.WriteLine("Security Exception:\n\n{0}", e.Message); } }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { //hide the damn column grdBase.HiddenColumnName = new List<string>() { "ID" };//, "Supplier", "Warehouse" }; //grdBase.SetColumnFit(); grdBase.DataSourceDataSet = ServiceProvider.KCSaleOrderDetailService.FindOrderInKitchenList(txtTableName.Text.Trim(), txtMenuName.Text.Trim()); grdBase.DataKeyName = new string[] { DataKeyName }; //try to set its visibility grdBase.btnDeleteEnable = false; grdBase.btnAddEnable = false; grdBase.RearrangeButton(); }
public POSINFO() { pipeID = 0; Idx = 0; direction = 0; pos = new POS (); bFinish = new bool[4]; bFinish_connect = new bool[4]; bFinish_In_connect = new bool[4]; for (int i=0; i<4; i++) { bFinish[i] = false; bFinish_connect[i] = false; bFinish_In_connect[i] = false; } bEndFinish = false; endCount = 0; }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { //hide the damn column grdBase.HiddenColumnName = new List<string>() { "tran_head_id" }; DataSet ds = ServiceProvider.TranHeadService.GetGridTranHeadIssueMaterial( txtDocNo.Text , dpDateFrom.Value , dpDateTo.Value , txtReferenceNo.Text , rdoWarehouse.Checked , rdoWaste.Checked , rdoOther.Checked , ddlWarehouse.SelectedValue.ToString() , txtOther.Text); if (ds.Tables.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { if (row["Status"].ToStringNullable() == TransactionStatus.IN.NormalCode) { row["Status"] = TransactionStatus.IN.NormalText; } else if (row["Status"].ToStringNullable() == TransactionStatus.IN.FinalCode) { row["Status"] = TransactionStatus.IN.FinalText; } row["Document Date"] = DateTime.Parse(row["Document Date"].ToString()).ConvertDateToDisplay(); } } grdBase.DataSourceDataSet = ds; grdBase.DataKeyName = new string[] { DataKeyName }; //try to set its visibility grdBase.btnDeleteEnable = false; grdBase.RearrangeButton(); }
public List<SearchWordResult> SearchByPos(POS Pos) { Debug.Assert(_WordDict != null); List<SearchWordResult> result = new List<SearchWordResult>(); foreach (WordAttribute wa in _WordDict.Values) { if ((wa.Pos & Pos) != 0) { SearchWordResult wordResult = new SearchWordResult(); wordResult.Word = wa; wordResult.SimilarRatio = 0; result.Add(wordResult); } } return result; }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { grdBase.DataSourceDataSet = ServiceProvider.SystemConfigGroupService.FindAllDataSet(false); grdBase.DataKeyName = new string[] { DataKeyName }; }
public void SortTest() { try { POS sp1 = new POS(1, 0, 0, 2, 0); POS sp2 = new POS(1, 0, 0, 2, 0); List<POS> unsortedList = new List<POS>(); unsortedList.Add(sp2); unsortedList.Add(sp1); List<POS> sortedList = new List<POS>(); sortedList.Add(sp1); sortedList.Add(sp2); unsortedList.Sort(); Assert.Equals(sortedList, unsortedList); } catch (SecurityException e) { Console.WriteLine("Security Exception:\n\n{0}", e.Message); } }
private void BindMenu(List<OrderDTO> mainMenu, FlowLayoutPanel flowPanel, POS.Control.Theme t) { if (mainMenu != null && mainMenu.Count > 0) { flowPanel.Controls.Clear(); foreach (OrderDTO Menuitem in mainMenu) { BaseButton btnMenu = new BaseButton(); btnMenu.Width = this.defaultBtnW; btnMenu.Height = this.defaultBtnH; btnMenu.Text = Menuitem.menu_name; btnMenu.CommandArg = Menuitem.menu_id.ToString(); btnMenu.DataObject = Menuitem; if (ServiceProvider.MenuService.HaveMinuItem(Menuitem.menu_id, Menuitem.dining_type_id, Menuitem.menu_group_id, Menuitem.menu_category_id)) { btnMenu.Click += new EventHandler(btnMenu_Click); btnMenu.Theme = t; } else { btnMenu.Click += new EventHandler(btnMenuItem_Click); if (Menuitem.isInventoryItem) { btnMenu.Theme = Theme.MSOffice2010_RED; } else { btnMenu.Theme = Theme.MSOffice2010_Green; } } btnMenu.Font = this.defaultBtnFont; flowPanel.Controls.Add(btnMenu); } } }
//Reviewer Ihcene: Update was fixed, for the rendering of the beacon, for each frames // Update is called once per frame //Check if this storypoint follows the sequence public bool isInOrder(POS sp) { /*for (int i = 0; i < storyPoints.Count; i++) { if (sp.id == storyPoints[0].id) return true; if (sp.id == storyPoints[i].id) { if (storyPoints[i - 1].isVisited()) return true; } } return false;*/ int currentPoi = this.storyPoints.IndexOf(sp); POS[] poss = this.storyPoints.ToArray(); for (int i = 0; i < currentPoi; i++) { if (!poss[i].isVisited()) { return false; } } return true; }
public void InsertWord(String word, double frequency, POS pos) { if (_WordDict == null) { return; } string key = word.ToLower(); if (key.Length == 1) { if (_FirstCharDict.ContainsKey(key[0])) { return; } } if (key.Length == 2) { uint doubleChar = ((uint)key[0] * 65536) + key[1]; if (_DoubleCharDict.ContainsKey(doubleChar)) { return; } } if (_WordDict.ContainsKey(key)) { return; } WordAttribute wa = new WordAttribute(word, pos, frequency); if (key.Length == 1) { if (!_FirstCharDict.ContainsKey(key[0])) { _FirstCharDict.Add(key[0], wa); return; } } if (key.Length == 2) { uint doubleChar = ((uint)key[0] * 65536) + key[1]; if (!_DoubleCharDict.ContainsKey(doubleChar)) { _DoubleCharDict.Add(doubleChar, wa); return; } } _WordDict.Add(key, wa); long tripleChar = ((long)key[0]) * 0x100000000 + (uint)(key[1] * 65536) + key[2]; byte[] wordLenArray; if (!_TripleCharDict.TryGetValue(tripleChar, out wordLenArray)) { wordLenArray = new byte[4]; wordLenArray[0] = (byte)key.Length; _TripleCharDict.Add(tripleChar, wordLenArray); } else { bool find = false; int i; for (i = 0; i < wordLenArray.Length; i++) { byte len = wordLenArray[i]; if (len == key.Length) { find = true; break; } if (len == 0) { wordLenArray[i] = (byte)key.Length; find = true; break; } } if (!find) { byte[] temp = new byte[wordLenArray.Length * 2]; wordLenArray.CopyTo(temp, 0); wordLenArray = temp; wordLenArray[i] = (byte)key.Length; _TripleCharDict[tripleChar] = wordLenArray; } } }
/// <summary> /// Gets all synsets for a word, optionally restricting the returned synsets to one or more parts of speech. This /// method does not perform any morphological analysis to match up the given word. It does, however, replace all /// spaces with underscores and call String.ToLower to normalize case. /// </summary> /// <param name="word">Word to get SynSets for. This method will replace all spaces with underscores and /// call ToLower() to normalize the word's case.</param> /// <param name="posRestriction">POSs to search. Cannot contain POS.None. Will search all POSs if no restriction /// is given.</param> /// <returns>Set of SynSets that contain word</returns> public Set<SynSet> GetSynSets(string word, params POS[] posRestriction) { // use all POSs if none are supplied if (posRestriction == null || posRestriction.Length == 0) posRestriction = new POS[] { POS.Adjective, POS.Adverb, POS.Noun, POS.Verb }; Set<POS> posSet = new Set<POS>(posRestriction); if (posSet.Contains(POS.None)) throw new Exception("Invalid SynSet POS request: " + POS.None); // all words are lower case and space-replaced word = word.ToLower().Replace(' ', '_'); // gather synsets for each POS Set<SynSet> allSynsets = new Set<SynSet>(); foreach (POS pos in posSet) if (_inMemory) { // read instantiated synsets from memory Set<SynSet> synsets; if (_posWordSynSets[pos].TryGetValue(word, out synsets)) // optimization: if there are no more parts of speech to check, we have all the synsets - so set the return collection and make it read-only. this is faster than calling AddRange on a set. if (posSet.Count == 1) { allSynsets = synsets; allSynsets.IsReadOnly = true; } else allSynsets.AddRange(synsets); } else { // get index line for word string indexLine = _posIndexWordSearchStream[pos].Search(word); // if index line exists, get synset shells and instantiate them if (indexLine != null) { // get synset shells and instantiate them SynSet mostCommonSynset; Set<SynSet> synsets = GetSynSetShells(indexLine, pos, out mostCommonSynset, this); foreach (SynSet synset in synsets) { synset.Instantiate(); allSynsets.Add(synset); } // we only need to set this flag if there is more than one synset for the word-pos pair if (synsets.Count > 1) mostCommonSynset.SetAsMostCommonSynsetFor(word); } } return allSynsets; }
/// <summary> /// Gets synset shells from a word index line. A synset shell is an instance of SynSet with only the POS and Offset /// members initialized. These members are enough to look up the full synset within the corresponding data file. This /// method is static to prevent inadvertent references to a current WordNetEngine, which should be passed via the /// corresponding parameter. /// </summary> /// <param name="wordIndexLine">Word index line from which to get synset shells</param> /// <param name="pos">POS of the given index line</param> /// <param name="mostCommonSynSet">Returns the most common synset for the word</param> /// <param name="wordNetEngine">WordNetEngine to pass to the constructor of each synset shell</param> /// <returns>Synset shells for the given index line</returns> private static Set<SynSet> GetSynSetShells(string wordIndexLine, POS pos, out SynSet mostCommonSynSet, WordNetEngine wordNetEngine) { Set<SynSet> synsets = new Set<SynSet>(); mostCommonSynSet = null; // get number of synsets string[] parts = wordIndexLine.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); int numSynSets = int.Parse(parts[2]); // grab each synset shell, from last to first int firstOffsetIndex = parts.Length - numSynSets; for (int i = parts.Length - 1; i >= firstOffsetIndex; --i) { // create synset int offset = int.Parse(parts[i]); // add synset to collection SynSet synset = new SynSet(pos, offset, wordNetEngine); synsets.Add(synset); // if this is the last synset offset to get (since we grabbed them in reverse order), record it as the most common synset if (i == firstOffsetIndex) mostCommonSynSet = synset; } if (mostCommonSynSet == null) throw new Exception("Failed to get most common synset"); return synsets; }
/// <summary> /// Gets the relation for a given POS and symbol /// </summary> /// <param name="pos">POS to get relation for</param> /// <param name="symbol">Symbol to get relation for</param> /// <returns>SynSet relation</returns> internal static SynSetRelation GetSynSetRelation(POS pos, string symbol) { return _posSymbolRelation[pos][symbol]; }
public void UpdateWord(String word, double frequency, POS pos) { string key = word.ToLower(); if (key.Length == 1) { if (_FirstCharDict.ContainsKey(key[0])) { _FirstCharDict[key[0]].Word = word; _FirstCharDict[key[0]].Frequency = frequency; _FirstCharDict[key[0]].Pos = pos; return; } else { return; } } if (key.Length == 2) { uint doubleChar = ((uint)key[0] * 65536) + key[1]; if (_DoubleCharDict.ContainsKey(doubleChar)) { _DoubleCharDict[doubleChar].Word = word; _DoubleCharDict[doubleChar].Frequency = frequency; _DoubleCharDict[doubleChar].Pos = pos; return; } else { return; } } if (_WordDict == null) { return; } if (!_WordDict.ContainsKey(key)) { return; } _WordDict[key].Word = word; _WordDict[key].Frequency = frequency; _WordDict[key].Pos = pos; }
/// <summary> /// Gets the most common synset for a given word/pos pair. This is only available for memory-based /// engines (see constructor). /// </summary> /// <param name="word">Word to get SynSets for. This method will replace all spaces with underscores and /// will call String.ToLower to normalize case.</param> /// <param name="pos">Part of speech to find</param> /// <returns>Most common synset for given word/pos pair</returns> public SynSet GetMostCommonSynSet(string word, POS pos) { // all words are lower case and space-replaced...we need to do this here, even though it gets done in GetSynSets (we use it below) word = word.ToLower().Replace(' ', '_'); // get synsets for word-pos pair Set<SynSet> synsets = GetSynSets(word, pos); // get most common synset SynSet mostCommon = null; if (synsets.Count == 1) return synsets.First(); else if (synsets.Count > 1) { // one (and only one) of the synsets should be flagged as most common foreach (SynSet synset in synsets) if (synset.IsMostCommonSynsetFor(word)) if (mostCommon == null) mostCommon = synset; else throw new Exception("Multiple most common synsets found"); if (mostCommon == null) throw new NullReferenceException("Failed to find most common synset"); } return mostCommon; }
public void grdBase_onLoadDataGrid(object sender, POS.Control.GridView.DataBindArgs e) { grdBase.DataSourceDataSet = ServiceProvider.BillOfMaterialHeadService.GetGridBOMHead(Converts.ParseLongNullable(ddlBOMGroup.SelectedValue.ToStringNullable()),txtBOMCode.Text,txtBOMName.Text); grdBase.DataKeyName = new string[] { DataKeyName }; }
public StoryPointView(POS sp) { this.sp = sp; sp.attachObserver(this); }
/// <summary> /// Gets definition line for synset from data file /// </summary> /// <param name="pos">POS to get definition for</param> /// <param name="offset">Offset into data file</param> internal string GetSynSetDefinition(POS pos, int offset) { // set data file to synset location StreamReader dataFile = _posSynSetDataFile[pos]; dataFile.DiscardBufferedData(); dataFile.BaseStream.Position = offset; // read synset definition string synSetDefinition = dataFile.ReadLine(); // make sure file positions line up if (int.Parse(synSetDefinition.Substring(0, synSetDefinition.IndexOf(' '))) != offset) throw new Exception("Position mismatch: passed " + offset + " and got definition line \"" + synSetDefinition + "\""); return synSetDefinition; }