private bool TestScanTable(int _TestStepNo) { //Test scan items PrintAction?.Invoke("Step " + _TestStepNo + "->" + "TestScanTable->Log-> Testing ScanTable..."); bool bLocalFailure = !SelectedDBService.ScanTable( TableName, out List <JObject> Result_4, (string Message) => { Console.WriteLine("Step " + _TestStepNo + "->" + "TestScanTable->Error-> " + Message); bLocalFailure = true; }); if (bLocalFailure) { PrintAction?.Invoke("Step " + _TestStepNo + "->" + "TestScanTable->Error-> ScanTable failed."); return(false); } string Readable = ""; if (Result_4 != null) { foreach (var Cur in Result_4) { Readable += Cur.ToString() + "\n"; } } PrintAction?.Invoke("Step " + _TestStepNo + "->" + "TestScanTable->Log-> ScanTable succeed. Returned: " + Readable); return(true); }
void Done() { Time?.Invoke(1f); Cur?.Invoke(_to); OnDone?.Invoke(); _timer = null; }
public ActionResult DeleteConfirmed(int id) { Cur cur = db.Curs.Find(id); db.Curs.Remove(cur); db.SaveChanges(); return(RedirectToAction("Index")); }
public void UpdateCur() { foreach (Square s in Children) { if (s.Val != 0) { Cur.Add(s.Val); } } }
public ActionResult Edit([Bind(Include = "CurId,Ogrn,Socrnameorg")] Cur cur) { if (ModelState.IsValid) { db.Entry(cur).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cur)); }
async void setThumbnailFromSfToImgAndCurMid(StorageFile sf) { await Cur.SetThumbnail(sf); if (Cur.Thumbnail != null) { img1.Source = Cur.Thumbnail; img1.Width = 2 * Cur.Thumbnail.PixelWidth; img1.Height = 2 * Cur.Thumbnail.PixelHeight; } }
public ActionResult Create([Bind(Include = "CurId,Ogrn,Socrnameorg")] Cur cur) { if (ModelState.IsValid) { db.Curs.Add(cur); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cur)); }
public CStatTestFixture(int slotMax) { for (int i = 0; i < slotMax; i++) { SerialNo.Add(""); ResultName.Add(""); ResultId.Add(0); Result.Add(0); Value.Add(""); Volt.Add(0); Cur.Add(0); DD.Add(""); } }
// GET: Cur/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cur cur = db.Curs.Find(id); if (cur == null) { return(HttpNotFound()); } return(View(cur)); }
public bool Update(float dt) { if (null != _delay) { bool isDelayed = _delay.UpdateTimer(dt); if (isDelayed) { // return true if its being delayed return(true); } else { _delay = null; OnStart?.Invoke(); } } if (null != _timer) { if (_timer.UpdateTimer(dt)) { float t = _timer.GetPercentage(); Vector2 cur = Quadratic(_from, _control, _to, t); // notify Time?.Invoke(t); Cur?.Invoke(cur); // return true since it's still updating return(true); } else { Done(); } } return(false); }
async void updateSaveSettings() { try { if (Cur == null) { return; } try { var cur = MruLst.FirstOrDefault(r => r.FileOnly.Equals(Cur.FileOnly, StringComparison.OrdinalIgnoreCase)); if (cur == null) { return; } if (!Cur.Equals(cur)) { Cur = cur; } if ( Cur.PlayPosn == mp_Xm.PlaybackSession.Position && Cur.PlayLeng == mp_Xm.PlaybackSession.NaturalDuration && Cur.LastPcNm == DevOp.MachineName) { return; } Cur.PlayPosn = mp_Xm.PlaybackSession.Position; Cur.PlayLeng = mp_Xm.PlaybackSession.NaturalDuration; Cur.LastPcNm = DevOp.MachineName; Cur.LastUsed = DateTime.Now; //AppSettingsHelper.RemoVal(AppSetConst.Mru4Roam); AppSettingsHelper.SaveVal(AppSetConst.Mru4Roam, JsonHelper.ToJson(MruLst)); AppSettingsHelper.SaveVal(AppSetConst.PagesTtl, PagesTtl); AppSettingsHelper.SaveVal(AppSetConst.PlayRate, mp_Xm.PlaybackSession.PlaybackRate); tbDbg3.Text = tbInfo.Text += "."; } catch (COMException ex) { Debug.WriteLine($"$#~>{ex.Message}"); var min = MruLst.Min(x => x.LastUsed); if (MruLst.Any(r => r.LastUsed == min)) { var mru = MruLst.FirstOrDefault(r => r.LastUsed == min); MruLst.Remove(mru); await Speak($"Max limit exceeded. Removing {mru.FileOnly}"); updateSaveSettings(); } else { await Speak($"the history has {MruLst.Count} files. i.e.: nothing to remove."); } } catch (Exception ex) { Debug.WriteLine($"$#~>{ex.Message}"); if (Debugger.IsAttached) { Debugger.Break(); } else { await popEx(ex, "updateStngs"); } } } finally { Debug.WriteLine("--- UpdtStng "); } }
public override int GetHashCode() { return(BitMask.GetHashCode() ^ Cur.GetHashCode()); }
//public string yearmonth(string s) //{ // #region YYYY/MM/DD // if (s != "") // { // // date // if (s[2] == '-' || s[2] == '/') // { // d = s.Substring(0, 2).ToString(); // } // else if (s[1] == '-' || s[1] == '/') // { // d = s.Substring(0, 1).ToString(); // } // else // { // } // // month && year // if (s[5] == '-' || s[5] == '/') // { // m = s.Substring(3, 2).ToString(); // //year // if (s.Length >= 9) // { // y = s.Substring(6, 4).ToString(); // } // else if (s.Length < 9) // { // y = "20" + s.Substring(6, 2).ToString(); // } // else // { // } // ///year // } // else if (s[4] == '-' || s[4] == '/') // { // //year // if (s.Length >= 8) // { // y = s.Substring(5, 4).ToString(); // } // else if (s.Length < 8) // { // y = "20" + s.Substring(5, 2).ToString(); // } // else // { // } // //year // if (s[1] == '-' || s[1] == '/') // { // m = s.Substring(2, 2).ToString(); // } // else if (s[2] == '-' || s[2] == '/') // { // m = s.Substring(3, 1).ToString(); // } // else // { // } // } // else if (s[3] == '-' || s[3] == '/') // { // if (s[1] == '-' || s[1] == '/') // { // m = s.Substring(2, 1).ToString(); // } // //year // if (s.Length >= 7) // { // y = s.Substring(4, 4).ToString(); // } // else if (s.Length < 7) // { // y = "20" + s.Substring(4, 2).ToString(); // } // else // { // } // } // g = y.ToString() + '-' + m.ToString() + '-' + d.ToString(); // } // else // { // g = ""; // } // return (g); // #endregion //} #endregion #region RETURN NOTE protected void lnkReturnNote_Click(object sender, EventArgs e) { conn = obje.NewConnection(); DateTime Cur; Cur = DateTime.Now; string Cur1 = Cur.ToString("yyyy/MM/dd"); string Tim = Cur.ToString("hh:mm tt"); string Dat = Cur.ToString("dd MMM"); if (txtFromDate.Text != "") { FD = obje.yearmonthdate(txtFromDate.Text); } OdbcCommand LnReturn = new OdbcCommand("CALL selectcond(?,?,?)", conn); LnReturn.CommandType = CommandType.StoredProcedure; LnReturn.Parameters.AddWithValue("tblname", "t_material_retrun m,t_material_return_items mi,m_inventory inv,m_sub_item i,m_sub_store s,m_sub_unit u"); LnReturn.Parameters.AddWithValue("attribute", "itemname,itemcode,storename,sum(return_qty) as return_qty,m.retno,unitname"); if (txtFromDate.Text != "") { LnReturn.Parameters.AddWithValue("conditionv", "mi.item_id=i.item_id and mi.item_id=inv.item_id and m.returnedto=s.store_id and m.retno=mi.retno " + "and date(returnedon) = '" + FD + "' and u.unit_id=inv.unit_id group by mi.item_id,m.returnedto"); } else if (txtFromDate.Text == "") { LnReturn.Parameters.AddWithValue("conditionv", "mi.item_id=i.item_id and mi.item_id=inv.item_id and m.returnedto=s.store_id and m.retno=mi.retno and u.unit_id=inv.unit_id group by mi.item_id,m.returnedto"); } OdbcDataAdapter ReturnDat = new OdbcDataAdapter(LnReturn); DataTable dt = new DataTable(); ReturnDat.Fill(dt); if (dt.Rows.Count == 0) { lblOk.Text = "No Details found"; lblHead.Text = "Tsunami ARMS - Warning"; pnlOk.Visible = true; pnlYesNo.Visible = false; ModalPopupExtender2.Show(); return; } OdbcCommand Malayalam = new OdbcCommand("select seasonname from m_season s,m_sub_season d where curdate()>=startdate and curdate()<=enddate and " + " s.rowstatus<>'2' and s.season_sub_id=d.season_sub_id and d.rowstatus<>'2' and s.is_current='1'", conn); OdbcDataReader Malr = Malayalam.ExecuteReader(); if (Malr.Read()) { Season = Malr[0].ToString(); } DateTime gh = DateTime.Now; string transtim = gh.ToString("dd-MM-yyyy hh-mm tt"); string ch = "Returned Items Details" + transtim.ToString() + ".pdf"; Document doc = new Document(iTextSharp.text.PageSize.LETTER, 10, 10, 50, 50); string pdfFilePath = Server.MapPath(".") + "/pdf/" + ch; Font font9 = FontFactory.GetFont("ARIAL", 9); Font font8 = FontFactory.GetFont("ARIAL", 9, 1); Font font10 = FontFactory.GetFont("ARIAL", 12, 1); Font font11 = FontFactory.GetFont("ARIAL", 10, 1); pdfPage page = new pdfPage(); page.strRptMode = "Blocked Room"; PdfWriter wr = PdfWriter.GetInstance(doc, new FileStream(pdfFilePath, FileMode.Create)); wr.PageEvent = page; doc.Open(); PdfPTable table2 = new PdfPTable(8); table2.TotalWidth = 550f; table2.LockedWidth = true; float[] colwidth1 = { 2, 5, 3, 4, 6, 3, 5, 3 }; table2.SetWidths(colwidth1); PdfPCell cell = new PdfPCell(new Phrase("Material Return Note ", font10)); cell.Colspan = 8; cell.Border = 1; cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right table2.AddCell(cell); PdfPCell cella = new PdfPCell(new Phrase("Season Name : " + Season, font11)); cella.Colspan = 4; cella.Border = 0; cella.HorizontalAlignment = 0; //0=Left, 1=Centre, 2=Right table2.AddCell(cella); PdfPCell cellb = new PdfPCell(new Phrase("Date : " + Dat, font11)); cellb.Colspan = 4; cellb.Border = 0; cellb.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right table2.AddCell(cellb); PdfPCell cell5a = new PdfPCell(new Phrase(new Chunk("No", font8))); table2.AddCell(cell5a); PdfPCell cell6a = new PdfPCell(new Phrase(new Chunk("Item Name", font8))); table2.AddCell(cell6a); PdfPCell cell8a = new PdfPCell(new Phrase(new Chunk("Code", font8))); table2.AddCell(cell8a); PdfPCell cell8b = new PdfPCell(new Phrase(new Chunk("UOM", font8))); table2.AddCell(cell8b); PdfPCell cell8p = new PdfPCell(new Phrase(new Chunk("Ret Office", font8))); table2.AddCell(cell8p); PdfPCell cell8y = new PdfPCell(new Phrase(new Chunk("Ret Qty", font8))); table2.AddCell(cell8y); PdfPCell cell10k = new PdfPCell(new Phrase(new Chunk("Ret No", font8))); table2.AddCell(cell10k); PdfPCell cell10p = new PdfPCell(new Phrase(new Chunk("Remark", font8))); table2.AddCell(cell10p); doc.Add(table2); int slno = 0; int i = 0; foreach (DataRow dr in dt.Rows) { slno = slno + 1; if (i > 35) { i = 0; doc.NewPage(); PdfPTable table1 = new PdfPTable(8); table1.TotalWidth = 550f; table1.LockedWidth = true; float[] colwidth2 = { 2, 5, 3, 4, 6, 3, 5, 3 }; table1.SetWidths(colwidth2); PdfPCell cell5ab = new PdfPCell(new Phrase(new Chunk("No", font8))); table1.AddCell(cell5ab); PdfPCell cell6ab = new PdfPCell(new Phrase(new Chunk("Item Name", font8))); table1.AddCell(cell6ab); PdfPCell cell8ab = new PdfPCell(new Phrase(new Chunk("Code", font8))); table1.AddCell(cell8ab); PdfPCell cell8bb = new PdfPCell(new Phrase(new Chunk("UOM", font8))); table1.AddCell(cell8bb); PdfPCell cell8pb = new PdfPCell(new Phrase(new Chunk("Ret Office", font8))); table1.AddCell(cell8pb); PdfPCell cell8yb = new PdfPCell(new Phrase(new Chunk("Ret Qty", font8))); table1.AddCell(cell8yb); PdfPCell cell10kb = new PdfPCell(new Phrase(new Chunk("Ret No", font8))); table1.AddCell(cell10kb); PdfPCell cell10pb = new PdfPCell(new Phrase(new Chunk("Remark", font8))); table1.AddCell(cell10pb); doc.Add(table1); } PdfPTable table = new PdfPTable(8); table.TotalWidth = 550f; table.LockedWidth = true; float[] colwidth3 = { 2, 5, 3, 4, 6, 3, 5, 3 }; table.SetWidths(colwidth3); PdfPCell cell11 = new PdfPCell(new Phrase(new Chunk(slno.ToString(), font9))); table.AddCell(cell11); string itn = dr["itemname"].ToString(); PdfPCell cell12 = new PdfPCell(new Phrase(new Chunk(itn.ToString(), font9))); table.AddCell(cell12); string ic = dr["itemcode"].ToString(); PdfPCell cell14 = new PdfPCell(new Phrase(new Chunk(ic.ToString(), font9))); table.AddCell(cell14); string un = dr["unitname"].ToString(); PdfPCell cell15 = new PdfPCell(new Phrase(new Chunk(un.ToString(), font9))); table.AddCell(cell15); PdfPCell cell16 = new PdfPCell(new Phrase(new Chunk(dr["storename"].ToString(), font9))); table.AddCell(cell16); PdfPCell cell17 = new PdfPCell(new Phrase(new Chunk(dr["return_qty"].ToString(), font9))); table.AddCell(cell17); PdfPCell cell18 = new PdfPCell(new Phrase(new Chunk(dr["retno"].ToString(), font9))); table.AddCell(cell18); PdfPCell cell18a = new PdfPCell(new Phrase(new Chunk("", font9))); table.AddCell(cell18a); i++; doc.Add(table); } PdfPTable table5 = new PdfPTable(3); PdfPCell cellab = new PdfPCell(new Phrase(new Chunk(" ", font9))); cellab.Border = 1; table5.AddCell(cellab); PdfPCell cellac = new PdfPCell(new Phrase(new Chunk(" ", font9))); cellac.Border = 1; table5.AddCell(cellac); PdfPCell cellav = new PdfPCell(new Phrase(new Chunk(" ", font9))); cellav.Border = 1; table5.AddCell(cellav); PdfPCell cellaq = new PdfPCell(new Phrase(new Chunk("Item returned by", font8))); cellaq.Border = 0; table5.AddCell(cellaq); PdfPCell cellaw = new PdfPCell(new Phrase(new Chunk("Accepted by", font8))); cellaw.Border = 0; table5.AddCell(cellaw); PdfPCell cellae = new PdfPCell(new Phrase(new Chunk("Approved by", font8))); cellae.Border = 0; table5.AddCell(cellae); doc.Add(table5); doc.Close(); Random r = new Random(); string PopUpWindowPage = "print.aspx?reportname=" + ch.ToString() + "&Title=Returned Item Details"; string Script = ""; Script += "<script id='PopupWindow'>"; Script += "confirmWin = window.open(' " + PopUpWindowPage + "','" + r.Next() + "','scrollbars=yes,resizable=1,width=1350,height=680,left=0,top=0,status');"; Script += "confirmWin.Setfocus()</script>"; if (!Page.IsClientScriptBlockRegistered("PopupWindow")) { Page.RegisterClientScriptBlock("PopupWindow", Script); } conn.Close(); }
public void setCurNameSelector() { Cur sc1 = null; Cur sc2 = null; if (selectedCur1 != null && selectedCur2 != null) { sc1 = selectedCur1; sc2 = selectedCur2; } curNames.Clear(); result.Valute.RUB = new Cur(); result.Valute.RUB.CharCode = "RUB"; result.Valute.RUB.Value = 1; curNames.Add(result.Valute.RUB); curNames.Add(result.Valute.AUD); curNames.Add(result.Valute.AZN); curNames.Add(result.Valute.GBP); curNames.Add(result.Valute.AMD); curNames.Add(result.Valute.BYN); curNames.Add(result.Valute.BGN); curNames.Add(result.Valute.BRL); curNames.Add(result.Valute.AMD); curNames.Add(result.Valute.HUF); curNames.Add(result.Valute.HKD); curNames.Add(result.Valute.DKK); curNames.Add(result.Valute.USD); curNames.Add(result.Valute.EUR); curNames.Add(result.Valute.INR); curNames.Add(result.Valute.KZT); curNames.Add(result.Valute.CAD); curNames.Add(result.Valute.KGS); curNames.Add(result.Valute.CNY); curNames.Add(result.Valute.MDL); curNames.Add(result.Valute.NOK); curNames.Add(result.Valute.PLN); curNames.Add(result.Valute.RON); curNames.Add(result.Valute.XDR); curNames.Add(result.Valute.SGD); curNames.Add(result.Valute.TJS); curNames.Add(result.Valute.TRY); curNames.Add(result.Valute.TMT); curNames.Add(result.Valute.UZS); curNames.Add(result.Valute.UAH); curNames.Add(result.Valute.CZK); curNames.Add(result.Valute.SEK); curNames.Add(result.Valute.CHF); curNames.Add(result.Valute.ZAR); curNames.Add(result.Valute.KRW); curNames.Add(result.Valute.JPY); if (sc1 != null && sc2 != null) { foreach (Cur c in curNames) { if (c.CharCode == sc1.CharCode) { selectedCur1 = c; } if (c.CharCode == sc2.CharCode) { selectedCur2 = c; } } } }