public void BindViewModel <T>(T viewModel) where T : IViewModel { view.DataContext = viewModel; viewModel.CloseWindow = () => { OnClose?.Invoke(); view.Close(); }; }
private void Button_Click_2(object sender, RoutedEventArgs e) { Acumulator.Instance().OTracker.offerteRuimte_.Korting = new Classes.KortingNode { AuthDate = DateTime.Now, KortingBedrag = KortingBedrag, Omschrijving = "Korting" }; Parent.Close(); }
private static void ResetHandler() { DetailsWindow.Close(); CreativePanelManager.Reset(); hudButton?.Dispose(); hudButton = null; if (hudLayoutControl != null) { hudLayoutControl.Loaded -= LayoutControl_Loaded; hudLayoutControl = null; } gameplayInputContext?.Stop(); gameplayInputContext = null; }
public void Activate(string result) { if (result == "yes") { string sql; sql = "DELETE FROM data_list "; sql += "WHERE person_id='" + Session["PationID"].ToString() + "' "; sql += "AND dialysis_date='" + Session["DialysisDate"].ToString() + "' "; sql += "AND dialysis_time='" + Session["DialysisTime"].ToString() + "'; "; sql += "DELETE FROM clinical2_nurse "; sql += "WHERE cln2_patic='" + Session["PationID"].ToString() + "' "; sql += "AND cln2_date='" + Session["DialysisDate"].ToString() + "' "; sql += "AND cln2_time='" + Session["DialysisTime"].ToString() + "'; "; db.Excute(sql); DetailsWindow.Close(); show_grid(); X.Msg.Notify("提示", "已经删除明细").Show(); } }
private void ProbeerReserveerComplete(InvokeOperation <bool> resOperation) { var btnText = InvokeBtn.Content.ToString().ToLower(); var msgText = ""; if (btnText == "reserveer") { msgText = "Het reserveren is "; } else if (btnText == "annuleer") { msgText = "Het annuleren is "; } if (resOperation.HasError)//!(!resOperation.Value && btnText == "annuleer") ) { //reserveer failed msgText += "mislukt. Dit blok is waarschijnlijk al bezet."; Acumulator.Instance().ctx.RejectChanges(); } else if (!resOperation.Value && btnText == "reserveer") { //reserveer failed msgText += "mislukt. Dit blok is waarschijnlijk al bezet."; Acumulator.Instance().ctx.RejectChanges(); } else { msgText += "gelukt!"; } MessageBox.Show(msgText); if (DwParent != null) { DwParent.Close(); MakerParent.DataContext = null; MakerParent.ReloadData(); } }
protected void SaveSelRow(object sender, DirectEventArgs e) { string sql = ""; string drg_code, drg_intake, drg_freq, drg_medway; string toDay = DateTime.Now.ToString("yyyy-MM-dd"); string toTime = DateTime.Now.ToString("HH:mm"); string[] StrArray = new string[4]; RowSelectionModel sm = this.Grid_DrugTerm.GetSelectionModel() as RowSelectionModel; foreach (SelectedRow row in sm.SelectedRows) { StrArray = GetDrugValue(row.RecordID.ToString()); drg_code = StrArray[0]; drg_intake = StrArray[1]; drg_freq = StrArray[2]; drg_medway = StrArray[3]; if (DrugKind.Text == "L") { sql += "INSERT INTO longterm_ordermgt(lgord_patic, lgord_dateord, lgord_timeord, lgord_usr1, lgord_dtactst, lgord_usr2, "; sql += "lgord_drug, lgord_intake, lgord_freq, lgord_medway, lgord_actst) "; sql += "VALUES('" + PationID.Text + "','" + toDay + "','" + toTime + "','" + DocName.Text + "','','" + DocName.Text + "',"; sql += "'" + drg_code + "','" + drg_intake + "','" + drg_freq + "','" + drg_medway + "','00001'); "; } else //==S { sql += "INSERT INTO shortterm_ordermgt(shord_patic, shord_dateord, shord_timeord, shord_usr1, shord_dtactst, shord_usr2, "; sql += "shord_drug, shord_intake, shord_freq, shord_medway, shord_actst) "; sql += "VALUES('" + PationID.Text + "','" + toDay + "','" + toTime + "','" + DocName.Text + "','','" + DocName.Text + "',"; sql += "'" + drg_code + "','" + drg_intake + "','" + drg_freq + "','" + drg_medway + "','00001'); "; } } db.Excute(sql); Store istore = Grid_DrugTerm.GetStore(); istore.RemoveAll(); DetailsWindow.Close(); //更新長期醫囑清單 if (DrugKind.Text == "L") { sql = "SELECT a.lgord_id,a.lgord_dateord,a.lgord_timeord,a.lgord_usr1,b.drg_name,a.lgord_intake,a.lgord_freq,a.lgord_medway,a.lgord_comment,a.lgord_dtactst "; sql += ", CASE a.lgord_actst WHEN '00001' THEN '' WHEN '00002' THEN '停用' END As Status "; sql += "FROM longterm_ordermgt a "; sql += "LEFT JOIN drug_list b ON a.lgord_drug=b.drg_code "; sql += "WHERE a.lgord_patic='" + PationID.Text + "' "; sql += "ORDER BY a.lgord_dateord DESC, Status"; //sql += " AND a.lgord_actst='00001'"; //只取使用中的藥物 DataTable dt = db.Query(sql); GridStore1.DataSource = db.GetDataArray(dt); GridStore1.DataBind(); } else //更新短期醫囑清單 { sql = "SELECT a.shord_id,a.shord_dateord,a.shord_timeord,a.shord_usr1,b.drg_name,a.shord_intake,a.shord_freq,a.shord_medway,a.shord_comment,a.shord_dtactst "; sql += ", CASE a.shord_actst WHEN '00001' THEN '' WHEN '00002' THEN '停用' END As Status "; sql += "FROM shortterm_ordermgt a "; sql += "LEFT JOIN drug_list b ON a.shord_drug = b.drg_code "; sql += "WHERE a.shord_patic='" + PationID.Text + "' "; //sql += "AND a.shord_dateord='" + toDay + "' "; sql += "ORDER BY a.shord_dateord DESC, Status"; //sql += "AND a.shord_actst='00001'";//只取使用中 DataTable dt = db.Query(sql); GridStore1.DataSource = db.GetDataArray(dt); GridStore1.DataBind(); } }
public void Close() { DetailsWindow.Close(); DetailsWindow = new DetailsWindow(); _open = false; }