private void explorerBar1_ItemClick(object sender, Janus.Windows.ExplorerBar.ItemEventArgs e) { try { Application.UseWaitCursor = true; if (!lookupsLoaded) { LoadLookups(); } Search srch = new Search(Atmng, eFileBindingSource); switch (e.Item.Key) { case "ndToday": srch.DoSearch(Atmng.WorkingAsOfficer.UserName, DateTime.Today, atDates.StandardDate.Tomorrow.BeginDate); break; case "ndYesterday": srch.DoSearch(Atmng.WorkingAsOfficer.UserName, atDates.StandardDate.Yesterday.BeginDate, DateTime.Today); break; case "ndLastWeek": srch.DoSearch(Atmng.WorkingAsOfficer.UserName, atDates.StandardDate.LastWeek.BeginDate, atDates.StandardDate.LastWeek.EndDate); break; case "ndThisWeek": srch.DoSearch(Atmng.WorkingAsOfficer.UserName, atDates.StandardDate.ThisWeek.BeginDate, atDates.StandardDate.ThisWeek.EndDate); break; case "ndCustom": fCustomDateRange fDateRangeFiles = new fCustomDateRange(); if (fDateRangeFiles.ShowDialog() == DialogResult.OK) { srch.DoSearch(Atmng.WorkingAsOfficer.UserName, (DateTime)fDateRangeFiles.BeginDate, (DateTime)fDateRangeFiles.EndDate); } break; case "ndAssFiles": srch.DoSearch(Atmng.WorkingAsOfficer.ContactId, Atmng.WorkingAsOfficer.PositionCode); break; case "ndContactFiles": srch.DoSearch(Atmng.WorkingAsOfficer.ContactId, null); break; default: return; } eFileGridEX.RootTable.Columns["FullFileNumber"].Visible = true; eFileGridEX.RootTable.Columns["SIN"].Visible = false; eFileGridEX.Focus(); Application.UseWaitCursor = false; } catch (Exception x) { Application.UseWaitCursor = false; UIHelper.HandleUIException(x); } }
private void explorerBar1_ItemClick(object sender, Janus.Windows.ExplorerBar.ItemEventArgs e) { switch (e.Item.Key) { case "ItemNewCustomer": frmCustomer newCustomer = new frmCustomer(); newCustomer.MdiParent = this; newCustomer.Show(); break; case "ItemNewSale": frmPurchase newSale = new frmPurchase(); newSale.MdiParent = this; newSale.Show(); break; case "ItemNewRecieve": frmPayment newRecieve = new frmPayment(); newRecieve.MdiParent = this; newRecieve.Show(); break; case "ItemCardex": frmCardex cardex = new frmCardex(); cardex.MdiParent = this; cardex.Show(); break; case "ItemCheck": frmCustomerList NewCheck = new frmCustomerList(); NewCheck.MdiParent = this; NewCheck.Show(); break; default: break; } }
private void explorerBar1_ItemClick(object sender, Janus.Windows.ExplorerBar.ItemEventArgs e) { try { Application.UseWaitCursor = true; atLogic.WhereClause wcy = new atLogic.WhereClause(); if (e.Item.Key.StartsWith("ndChron")) { wcy.Add("d.docid", "in", "select docid from recipient where officerid = " + myAtmng.WorkingAsOfficer.OfficerId.ToString() + " and type=0"); } else { wcy.Add("d.docid", "in", "select docid from recipient where officerid = " + myAtmng.WorkingAsOfficer.OfficerId.ToString() + " and type in (1,2)"); } atLogic.WhereClause wcToExecute = wcy; bool executeSearch = true; switch (e.Item.Key) { case "ndCheckedOut": atLogic.WhereClause wc = new atLogic.WhereClause(); wc.Add("CheckedoutBy", "=", myAtmng.WorkingAsOfficer.OfficerId); wcToExecute = wc; break; case "ndDrafts": atLogic.WhereClause wcDrafts = new atLogic.WhereClause(); wcDrafts.Add("d.OfficerId", "=", myAtmng.WorkingAsOfficer.OfficerId); wcDrafts.Add("d.IsDraft", "=", true); wcToExecute = wcDrafts; break; case "ndChronToday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Today.BeginDate, atDates.StandardDate.Today.EndDate); break; case "ndChronYesterday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Yesterday.BeginDate, atDates.StandardDate.Yesterday.EndDate); break; case "ndChronThisWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.ThisWeek.BeginDate, atDates.StandardDate.ThisWeek.EndDate); break; case "ndChronLastWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.LastWeek.BeginDate, atDates.StandardDate.LastWeek.EndDate); break; case "ndChronCustom": fCustomDateRange fDateRange = new fCustomDateRange(); if (fDateRange.ShowDialog() == DialogResult.OK) { wcy.Add("d.efDate", "Between", (DateTime)fDateRange.BeginDate, (DateTime)fDateRange.EndDate); } else { executeSearch = false; } break; case "ndRecToday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Today.BeginDate, atDates.StandardDate.Today.EndDate); break; case "ndRecYesterday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Yesterday.BeginDate, atDates.StandardDate.Yesterday.EndDate); break; case "ndRecThisWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.ThisWeek.BeginDate, atDates.StandardDate.ThisWeek.EndDate); break; case "ndRecLastWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.LastWeek.BeginDate, atDates.StandardDate.LastWeek.EndDate); break; case "ndRecCustom": fCustomDateRange fDateRange2 = new fCustomDateRange(); if (fDateRange2.ShowDialog() == DialogResult.OK) { wcy.Add("d.efDate", "Between", (DateTime)fDateRange2.BeginDate, (DateTime)fDateRange2.EndDate); } else { executeSearch = false; } break; default: executeSearch = false; break; } if (executeSearch) { myDM.GetDocument().PreRefresh(); myDM.GetDocument().Search(wcToExecute, false); PostDataLoad(myDM); ucRecordList1.SearchResult(true); } Application.UseWaitCursor = false; } catch (Exception x) { Application.UseWaitCursor = false; UIHelper.HandleUIException(x); } }
private void explorerBar1_ItemClick(object sender, Janus.Windows.ExplorerBar.ItemEventArgs e) { switch (e.Item.Text.ToString()) { case "修改": if (this.m_selectNode == "") { MessageBox.Show("请先选择数据!"); return; } this.m_isEdit = true; this.richTextBox1.ReadOnly = false; this.textBox3.ReadOnly = false; this.textBox6.ReadOnly = false; this.textBox4.ReadOnly = false; this.textBox9.ReadOnly = false; this.textBox10.ReadOnly = false; this.textBox8.ReadOnly = false; this.textBox13.ReadOnly = false; this.textBox12.ReadOnly = false; this.richTextBox1.BackColor = Color.White; this.textBox3.BackColor = Color.White; this.textBox6.BackColor = Color.White; this.textBox4.BackColor = Color.White; this.textBox9.BackColor = Color.White; this.textBox10.BackColor = Color.White; this.textBox8.BackColor = Color.White; this.textBox13.BackColor = Color.White; this.textBox12.BackColor = Color.White; for (int i = 0; i < m_labelActive.Count; i++) { m_textBoxActive[i].ReadOnly = false; m_textBoxActive[i].BackColor = Color.White; } break; case "保存": if (this.m_selectNode == "") { MessageBox.Show("请先选择数据!"); return; } if (this.m_isEdit == false) { MessageBox.Show("请先修改数据!"); return; } this.richTextBox1.ReadOnly = true; this.textBox3.ReadOnly = true; this.textBox6.ReadOnly = true; this.textBox4.ReadOnly = true; this.textBox9.ReadOnly = true; this.textBox10.ReadOnly = true; this.textBox8.ReadOnly = true; this.textBox13.ReadOnly = true; this.textBox12.ReadOnly = true; this.richTextBox1.BackColor = Color.AliceBlue; this.textBox3.BackColor = Color.AliceBlue; this.textBox6.BackColor = Color.AliceBlue; this.textBox4.BackColor = Color.AliceBlue; this.textBox9.BackColor = Color.AliceBlue; this.textBox10.BackColor = Color.AliceBlue; this.textBox8.BackColor = Color.AliceBlue; this.textBox13.BackColor = Color.AliceBlue; this.textBox12.BackColor = Color.AliceBlue; for (int i = 0; i < m_labelActive.Count; i++) { m_textBoxActive[i].ReadOnly = false; m_textBoxActive[i].BackColor = Color.AliceBlue; } string sqlText = "update SHEETMETADATA set SOURCEFORMAT='" + textBox3.Text + "'," + "DESCRIPTION='" + richTextBox1.Text + "'," + "ALIANAME='" + textBox6.Text + "'," + "SOURCE='" + textBox4.Text + "'," + "HEIGHTDATUM='" + textBox10.Text + "'," + "SHEETNO='" + textBox9.Text + "'," + "COOR='" + textBox8.Text + "'," + "SCALE='" + textBox13.Text + "'," + "EDITER='" + textBox12.Text + "' where NAME='" + textBox1.Text + "'"; m_oraCmd.CommandText = sqlText; m_oraCmd.ExecuteNonQuery(); if (this.m_labelActive.Count > 0) { sqlText = "update CUSTOMMETADATA set "; for (int i = 0; i < this.m_customField.Count; i++) { if (i != this.m_customField.Count - 1) { sqlText += this.m_customField[i].ToString() + "='" + this.m_textBoxActive[i].Text.Trim().ToString() + "',"; } else { sqlText += this.m_customField[i].ToString() + "='" + this.m_textBoxActive[i].Text.Trim().ToString() + "'"; } } sqlText += " where NAME='" + textBox1.Text + "'"; m_oraCmd.CommandText = sqlText; m_oraCmd.ExecuteNonQuery(); } this.m_isEdit = false; MessageBox.Show("更新成功!"); break; case "按名称": frmSearchByName frmSearch = new frmSearchByName(); frmSearch.ShowDialog(); string name = frmSearch.Name; if (name != "") { sqlText = "select *from SHEETMETADATA where NAME='" + name + "'"; m_oraCmd.CommandText = sqlText; OracleDataReader dr = m_oraCmd.ExecuteReader(); if (dr.Read()) { this.textBox1.Text = dr.GetValue(0).ToString(); this.textBox5.Text = dr.GetValue(2).ToString(); this.textBox7.Text = dr.GetValue(1).ToString(); this.textBox2.Text = dr.GetValue(4).ToString(); this.textBox3.Text = dr.GetValue(3).ToString(); this.textBox4.Text = dr.GetValue(7).ToString(); this.textBox6.Text = dr.GetValue(6).ToString(); this.richTextBox1.Text = dr.GetValue(5).ToString(); this.textBox9.Text = dr.GetValue(6).ToString(); this.textBox10.Text = dr.GetValue(9).ToString(); this.textBox8.Text = dr.GetValue(11).ToString(); this.textBox13.Text = dr.GetValue(12).ToString(); this.textBox12.Text = dr.GetValue(13).ToString(); //this.m_selectNode = e.Node.Text; } else { this.textBox1.Text = ""; this.textBox5.Text = ""; this.textBox7.Text = ""; this.textBox2.Text = ""; this.textBox3.Text = ""; this.textBox4.Text = ""; this.textBox6.Text = ""; this.richTextBox1.Text = ""; this.textBox9.Text = ""; this.textBox10.Text = ""; this.textBox8.Text = ""; this.textBox13.Text = ""; this.textBox12.Text = ""; //this.m_selectNode = ""; } } break; } }