?? 復件 gonggaowindow.cs
字號:
private void LoadFclist()
{
DataTable table1 = new DataTable();
table1 = this.Db.DBList("Select Id,FcName From GroupTable Order By NumSet");
DataTable table2 = table1.Clone();
table2.Rows.Add(table2.NewRow());
table2.Rows[0]["FcName"] = "\u6240\u6709\u90e8\u95e8";
table2.Rows[0]["Id"] = "999999";
table1.ImportRow(table2.Rows[0]);
this.FcListST.DataSource = table1;
this.FcListST.DisplayMember = "FcName";
this.FcListST.ValueMember = "Id";
this.FcListST.SelectedValue = "999999";
}
private void LoadGgFile()
{
this.OpenMBST.InitialDirectory = @"c:\";
this.OpenMBST.Filter = "\u6240\u6709\u652f\u6301\u7684\u683c\u5f0f|*.rtf;*.txt;*.htm;*.html|RTF\u683c\u5f0f|*.rtf|\u6587\u672c\u683c\u5f0f(*.txt)|*.txt|htm\u683c\u5f0f|*.htm;*.html|*.*|*.*";
if (this.OpenMBST.ShowDialog() == DialogResult.OK)
{
try
{
string text1;
RichTextBox box1 = new RichTextBox();
if ((text1 = this.OpenMBST.FileName.ToLower().Substring(this.OpenMBST.FileName.Length - 3, 3)) == null)
{
goto Label_00F2;
}
text1 = string.IsInterned(text1);
if (text1 != "rtf")
{
if (text1 == "txt")
{
goto Label_00B6;
}
if (text1 == "htm")
{
goto Label_00CA;
}
if (text1 == "tml")
{
goto Label_00DE;
}
goto Label_00F2;
}
box1.LoadFile(this.OpenMBST.FileName, RichTextBoxStreamType.RichText);
goto Label_0108;
Label_00B6:
box1.LoadFile(this.OpenMBST.FileName, RichTextBoxStreamType.PlainText);
goto Label_0108;
Label_00CA:
box1.LoadFile(this.OpenMBST.FileName, RichTextBoxStreamType.PlainText);
goto Label_0108;
Label_00DE:
box1.LoadFile(this.OpenMBST.FileName, RichTextBoxStreamType.PlainText);
goto Label_0108;
Label_00F2:
MessageBox.Show("\u7cfb\u7edf\u4e0d\u652f\u6301\u6b64\u6587\u4ef6\u683c\u5f0f!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
Label_0108:
this.NrSt.SelectedRtf = box1.Rtf;
}
catch
{
MessageBox.Show("\u8bfb\u53d6\u6587\u4ef6\u51fa\u9519!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
}
private void LoadGGInfo()
{
int num1 = this.MT.FcTemp;
this.ggDt = this.Db.DBList(string.Concat(new object[] { "Select * From GongGao Where ToGroup='", this.MT.GroupIdTemp, "' or ToGroup='A\u516c\u544a' or ToGroup='B\u516c\u544aTo-", num1.ToString(), "' Order By FbDate DESC" }));
this.GGListSt.DisplayMember = "Title";
this.GGListSt.ValueMember = "Id";
this.GGListSt.DataSource = this.ggDt;
}
private void LodGp()
{
try
{
DataTable table1 = new DataTable();
table1 = this.Db.DBList("Select GroupId,GroupName From WorkGroup Where ByFcId=" + this.FcListST.SelectedValue + " Order By NumSet");
DataTable table2 = table1.Clone();
table2.Rows.Add(table2.NewRow());
table2.Rows[0]["GroupName"] = "\u6240\u6709\u90e8\u95e8";
table2.Rows[0]["GroupId"] = "888888";
table1.ImportRow(table2.Rows[0]);
this.GroupIdST.DataSource = table1;
this.GroupIdST.DisplayMember = "GroupName";
this.GroupIdST.ValueMember = "GroupId";
this.GroupIdST.SelectedValue = "888888";
}
catch
{
}
}
private void menuItem1_Click(object sender, EventArgs e)
{
if (this.FcListST.Visible)
{
this.NrSt.SelectionAlignment = HorizontalAlignment.Left;
}
}
private void menuItem2_Click(object sender, EventArgs e)
{
if (this.FcListST.Visible)
{
this.NrSt.SelectionAlignment = HorizontalAlignment.Center;
}
}
private void menuItem3_Click(object sender, EventArgs e)
{
if (this.FcListST.Visible)
{
this.NrSt.SelectionAlignment = HorizontalAlignment.Right;
}
}
private void newdoc()
{
this.UsIdSt.Text = this.MT.UsId;
this.label2.Visible = true;
this.FcListST.Visible = true;
this.GroupIdST.Visible = true;
this.GGListSt.Enabled = false;
this.DateSt.Enabled = false;
this.TitleSt.ReadOnly = false;
this.TitleSt.Text = "\u8bf7\u5728\u6b64\u8f93\u5165\u60a8\u7684\u516c\u544a\u6807\u9898";
this.NrSt.ReadOnly = false;
this.NrSt.Text = "\u8bf7\u5728\u6b64\u8f93\u5165\u60a8\u7684\u516c\u544a\u5185\u5bb9";
}
private void NrSt_LinkClicked(object sender, LinkClickedEventArgs e)
{
Process.Start(e.LinkText);
}
private void OpenWithOffice()
{
string text1 = string.Concat(new string[] { System.Windows.Forms.Application.StartupPath, @"\Temp\~temp_", this.MT.UsId, this.GGListSt.SelectedValue.ToString(), ".rtf" });
ApplicationClass class1 = null;
Document document1 = null;
class1 = new ApplicationClass();
object obj1 = text1;
object obj2 = false;
object obj3 = 0;
object obj4 = true;
object obj5 = true;
object obj6 = Missing.Value;
document1 = class1.Documents.Open(ref obj1, ref obj6, ref obj4, ref obj6, ref obj6, ref obj6, ref obj6, ref obj6, ref obj6, ref obj6, ref obj6, ref obj5);
try
{
class1.Application.CommandBars.AdaptiveMenus = true;
class1.ActiveWindow.DisplayRightRuler = true;
class1.ActiveWindow.DisplayScreenTips = true;
class1.ActiveWindow.DisplayVerticalRuler = true;
class1.ActiveWindow.DisplayRightRuler = true;
class1.ActiveWindow.ActivePane.DisplayRulers = true;
class1.ActiveWindow.ActivePane.View.Type = WdViewType.wdPrintView;
}
catch
{
}
int num1 = class1.ActiveWindow.Application.CommandBars.Count;
for (int num2 = 0; num2 < num1; num2++)
{
try
{
class1.ActiveWindow.Application.CommandBars[num2].Enabled = true;
}
catch
{
}
}
class1.Visible = true;
class1.Activate();
}
private void OutToPrint()
{
try
{
RichTextBox box1 = new RichTextBox();
box1.SelectedRtf = this.NrSt.Rtf;
box1.SaveFile(string.Concat(new string[] { System.Windows.Forms.Application.StartupPath, @"\Temp\~temp_", this.MT.UsId, this.GGListSt.SelectedValue.ToString(), ".rtf" }));
Thread thread1 = new Thread(new ThreadStart(this.OpenWithOffice));
thread1.IsBackground = true;
thread1.Start();
}
catch
{
MessageBox.Show("\u5f88\u62a5\u8c26\u3002\u7531\u4e8e\u4e0d\u660e\u539f\u56e0\uff0c\u6587\u4ef6\u5bfc\u51fa\u5931\u8d25\u3002\u53ef\u80fd\u662f\u60a8\u7684OFFICE\u7248\u672c\u9ad8\u4e8e\n\u7cfb\u7edf\u652f\u6301\u7248\u672c\uff0c\u6216\u60a8\u6ca1\u6709\u5b89\u88c5OFFICE\u7cfb\u7edf\u3002");
}
}
private void SaveTalkInfo()
{
this.SaveST.InitialDirectory = @"C:\";
if (this.SaveST.ShowDialog() == DialogResult.OK)
{
this.NrSt.SaveFile(this.SaveST.FileName);
}
}
private void savetouslook()
{
if (this.GGListSt.Items.Count > 0)
{
DataTable table1 = this.MT.UsLookDt.Clone();
DataRow[] rowArray1 = this.MT.UsLookDt.Copy().Select("LookId=" + this.GGListSt.SelectedValue.ToString() + " And LookType='\u516c\u544a'");
if (rowArray1.Length == 0)
{
table1.Rows.Add(table1.NewRow());
table1.Rows[0]["LookId"] = (int) this.GGListSt.SelectedValue;
table1.Rows[0]["UsId"] = this.MT.UsId;
table1.Rows[0]["LookType"] = "\u516c\u544a";
this.MT.UsLookDt.ImportRow(table1.Rows[0]);
this.Db.InsDb(table1.Rows[0], "UsLookYN", "Id");
}
}
}
private void SendGongGao()
{
string text2;
DataTable table1 = this.ggDt.Clone();
table1.Rows.Add(table1.NewRow());
table1.Rows[0]["Title"] = this.TitleSt.Text;
table1.Rows[0]["Nr"] = this.NrSt.Rtf;
table1.Rows[0]["FbDate"] = DateTime.Now;
table1.Rows[0]["UsId"] = this.MT.UsId;
if (this.FcListST.SelectedValue.ToString() == "999999")
{
table1.Rows[0]["ToGroup"] = "A\u516c\u544a";
}
else if (this.GroupIdST.SelectedValue.ToString() == "888888")
{
table1.Rows[0]["ToGroup"] = "B\u516c\u544aTo-" + this.FcListST.SelectedValue.ToString();
}
else
{
table1.Rows[0]["ToGroup"] = this.GroupIdST.SelectedValue;
}
string text1 = this.Db.InsDb(table1.Rows[0], "GongGao", "Id");
if ((text2 = text1) != null)
{
text2 = string.IsInterned(text2);
if (text2 != "0")
{
if (text2 == "1")
{
MessageBox.Show("\u516c\u544a\u53d1\u9001\u5931\u8d25\uff01", "PoinTO短訊系統");
}
else if (text2 == "2")
{
MessageBox.Show("\u516c\u544a\u53d1\u9001\u5931\u8d25\uff01", "PoinTO短訊系統");
}
}
else
{
MessageBox.Show("\u516c\u544a\u53d1\u9001\u6210\u529f\uff01", "PoinTO短訊系統");
}
}
}
private void toolBar1_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
switch (e.Button.Text)
{
case "新建":
{
this.newdoc();
return;
}
case "另存":
{
this.SaveTalkInfo();
return;
}
case "\u5bfc\u5165":
{
if (!this.FcListST.Visible)
{
MessageBox.Show("\u8bf7\u60a8\u5148新建\u516c\u544a\u3002", "PoinTO短訊系統");
break;
}
this.LoadGgFile();
break;
}
case "\u56fe\u7247":
{
if (!this.FcListST.Visible)
{
MessageBox.Show("\u8bf7\u60a8\u5148新建\u516c\u544a\u3002", "PoinTO短訊系統");
goto Label_019A;
}
this.InsertImage();
goto Label_019A;
}
case "\u53d1\u5e03":
{
if (!this.FcListST.Visible)
{
MessageBox.Show("\u8bf7\u60a8\u5148新建\u516c\u544a\uff0c\u518d\u505a\u53d1\u9001\u3002", "PoinTO短訊系統");
return;
}
if (MessageBox.Show("\u516c\u544a\u53d1\u51fa\u540e\u5c06\u65e0\u6cd5\u505a修改\u3002\u60a8確定\u8981\u53d1\u5e03\u60a8\u6240\u7f16\u5199\u7684\u516c\u544a\u5417\uff1f", "PoinTO短訊系統", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
this.SendGongGao();
}
return;
}
case "\u5b57\u4f53":
{
if (!this.FcListST.Visible)
{
MessageBox.Show("\u8bf7\u60a8\u5148新建\u516c\u544a\u3002", "PoinTO短訊系統");
return;
}
this.Fontst();
return;
}
case "\u989c\u8272":
{
if (!this.FcListST.Visible)
{
MessageBox.Show("\u8bf7\u60a8\u5148新建\u516c\u544a\u3002", "PoinTO短訊系統");
return;
}
this.colorstt();
return;
}
case "關閉":
{
base.Close();
return;
}
case "\u5bf9\u9f50":
{
return;
}
case "\u6253\u5370":
{
this.OutToPrint();
return;
}
default:
{
return;
}
}
this.NrSt.Focus();
return;
Label_019A:
this.NrSt.Focus();
}
private void UsTypeSet()
{
string text1;
if ((text1 = this.MT.UsType) != null)
{
text1 = string.IsInterned(text1);
if ((((text1 != "A") && (text1 != "B")) && (text1 != "C")) && (text1 == "D"))
{
this.toolBarButton2.Enabled = false;
this.toolBarButton5.Enabled = false;
this.toolBarButton6.Enabled = false;
this.toolBarButton7.Enabled = false;
this.toolBarButton9.Enabled = false;
this.toolBarButton10.Enabled = false;
this.toolBarButton13.Enabled = false;
}
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -