private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { UpFile objsh2 = new UpFile(); objsh2 = objsh2.Retrieveq(comboBox1.Text); label1.Text = "公文標題:" + objsh2.GetFileTitle(); progressBar1.Maximum = 4; progressBar1.Value = Convert.ToInt32(objsh2.GetFileStatus()) + 1; ModifyProgressBarColor.SetState(progressBar1, 1); if (objsh2.GetFileStatus().Equals("0")) { label2.Text = "目前狀態:公文以上傳審核中"; } else if (objsh2.GetFileStatus().Equals("1")) { ModifyProgressBarColor.SetState(progressBar1, 2); label2.Text = "目前狀態:公文被退件請修正"; } else if (objsh2.GetFileStatus().Equals("2")) { label2.Text = "目前狀態:公文已通過待歸檔"; } else if (objsh2.GetFileStatus().Equals("3")) { label2.Text = "目前狀態:公文已歸檔"; } }
public bool UpfdateUpFile(UpFile objUpFile) { Boolean tf = false; DBConnect dbconn = new DBConnect(); dbconn.ConnectDB(); try { // 注意 : 字串要用單引號 ' ', 數字欄位不需要單引號 dbconn.getCmd().CommandText = "Update FileData SET FixContent='" + objUpFile.GetFFixContent() + "',Status='" + objUpFile.GetFileStatus() + "' WHERE FileNumber= '" + objUpFile.GetFileNumber() + "'"; dbconn.getCmd().CommandType = System.Data.CommandType.Text; dbconn.getConn().Open(); dbconn.getCmd().ExecuteNonQuery(); tf = true; } catch (Exception e) { System.Console.WriteLine("Error message :" + e.ToString()); } finally { if (dbconn.getConn() != null) { dbconn.getConn().Close(); } }; return(tf); }