sftx.cs
上传用户:toshiba_01
上传日期:2007-06-08
资源大小:306k
文件大小:10k
源码类别:

酒店行业

开发平台:

C#

  1. using System; using System.Collections; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using System.Data ; using System.Data .SqlClient ; namespace RoomManage { public class sftx : RoomManage.pub { private System.ComponentModel.IContainer components = null; public sftx(string s) { // 该调用是 Windows 窗体设计器所必需的。 InitializeComponent(); this.opername =s; // TODO: 在 InitializeComponent 调用后添加任何初始化 } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null)  { components.Dispose(); } } base.Dispose( disposing ); } #region 设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(sftx));
  2. this.groupBox4 = new System.Windows.Forms.GroupBox();
  3. this.label2 = new System.Windows.Forms.Label();
  4. this.label1 = new System.Windows.Forms.Label();
  5. this.button2 = new System.Windows.Forms.Button();
  6. this.groupBox6 = new System.Windows.Forms.GroupBox();
  7. this.label3 = new System.Windows.Forms.Label();
  8. this.label4 = new System.Windows.Forms.Label();
  9. this.groupBox5 = new System.Windows.Forms.GroupBox();
  10. this.dg1 = new System.Windows.Forms.DataGrid();
  11. this.dg2 = new System.Windows.Forms.DataGrid();
  12. this.groupBox2.SuspendLayout();
  13. this.groupBox3.SuspendLayout();
  14. ((System.ComponentModel.ISupportInitialize)(this.dg1)).BeginInit();
  15. ((System.ComponentModel.ISupportInitialize)(this.dg2)).BeginInit();
  16. // 
  17. // button1
  18. // 
  19. this.button1.Location = new System.Drawing.Point(8, 80);
  20. this.button1.Name = "button1";
  21. // 
  22. // groupBox1
  23. // 
  24. this.groupBox1.Name = "groupBox1";
  25. // 
  26. // groupBox2
  27. // 
  28. this.groupBox2.Controls.Add(this.button2);
  29. this.groupBox2.Name = "groupBox2";
  30. this.groupBox2.Controls.SetChildIndex(this.button1, 0);
  31. this.groupBox2.Controls.SetChildIndex(this.button2, 0);
  32. // 
  33. // pictureBox1
  34. // 
  35. this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
  36. this.pictureBox1.Name = "pictureBox1";
  37. // 
  38. // groupBox3
  39. // 
  40. this.groupBox3.Controls.Add(this.dg2);
  41. this.groupBox3.Controls.Add(this.dg1);
  42. this.groupBox3.Controls.Add(this.groupBox5);
  43. this.groupBox3.Controls.Add(this.label4);
  44. this.groupBox3.Controls.Add(this.label3);
  45. this.groupBox3.Controls.Add(this.groupBox6);
  46. this.groupBox3.Controls.Add(this.label2);
  47. this.groupBox3.Controls.Add(this.label1);
  48. this.groupBox3.Controls.Add(this.groupBox4);
  49. this.groupBox3.Name = "groupBox3";
  50. // 
  51. // groupBox4
  52. // 
  53. this.groupBox4.Location = new System.Drawing.Point(0, 240);
  54. this.groupBox4.Name = "groupBox4";
  55. this.groupBox4.Size = new System.Drawing.Size(384, 3);
  56. this.groupBox4.TabIndex = 3;
  57. this.groupBox4.TabStop = false;
  58. this.groupBox4.Text = "groupBox4";
  59. // 
  60. // label2
  61. // 
  62. this.label2.Location = new System.Drawing.Point(200, 248);
  63. this.label2.Name = "label2";
  64. this.label2.Size = new System.Drawing.Size(144, 23);
  65. this.label2.TabIndex = 5;
  66. this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  67. // 
  68. // label1
  69. // 
  70. this.label1.Location = new System.Drawing.Point(8, 248);
  71. this.label1.Name = "label1";
  72. this.label1.TabIndex = 4;
  73. this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  74. // 
  75. // button2
  76. // 
  77. this.button2.Location = new System.Drawing.Point(8, 32);
  78. this.button2.Name = "button2";
  79. this.button2.Size = new System.Drawing.Size(48, 23);
  80. this.button2.TabIndex = 1;
  81. this.button2.Text = "查询";
  82. this.button2.Click += new System.EventHandler(this.button2_Click);
  83. // 
  84. // groupBox6
  85. // 
  86. this.groupBox6.Location = new System.Drawing.Point(0, 48);
  87. this.groupBox6.Name = "groupBox6";
  88. this.groupBox6.Size = new System.Drawing.Size(384, 3);
  89. this.groupBox6.TabIndex = 21;
  90. this.groupBox6.TabStop = false;
  91. // 
  92. // label3
  93. // 
  94. this.label3.Font = new System.Drawing.Font("宋体", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  95. this.label3.ForeColor = System.Drawing.Color.Red;
  96. this.label3.Location = new System.Drawing.Point(8, 19);
  97. this.label3.Name = "label3";
  98. this.label3.Size = new System.Drawing.Size(168, 23);
  99. this.label3.TabIndex = 22;
  100. this.label3.Text = "昨日尚未增款的客人";
  101. this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  102. // 
  103. // label4
  104. // 
  105. this.label4.Font = new System.Drawing.Font("宋体", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  106. this.label4.ForeColor = System.Drawing.Color.Blue;
  107. this.label4.Location = new System.Drawing.Point(208, 19);
  108. this.label4.Name = "label4";
  109. this.label4.Size = new System.Drawing.Size(168, 23);
  110. this.label4.TabIndex = 23;
  111. this.label4.Text = "今日需要增款的客人";
  112. this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  113. // 
  114. // groupBox5
  115. // 
  116. this.groupBox5.Location = new System.Drawing.Point(192, 0);
  117. this.groupBox5.Name = "groupBox5";
  118. this.groupBox5.Size = new System.Drawing.Size(3, 240);
  119. this.groupBox5.TabIndex = 24;
  120. this.groupBox5.TabStop = false;
  121. // 
  122. // dg1
  123. // 
  124. this.dg1.AlternatingBackColor = System.Drawing.Color.Silver;
  125. this.dg1.BackColor = System.Drawing.Color.White;
  126. this.dg1.BackgroundColor = System.Drawing.Color.Lavender;
  127. this.dg1.CaptionBackColor = System.Drawing.Color.Maroon;
  128. this.dg1.CaptionFont = new System.Drawing.Font("Tahoma", 8F);
  129. this.dg1.CaptionForeColor = System.Drawing.Color.White;
  130. this.dg1.CaptionText = "查询结果";
  131. this.dg1.DataMember = "";
  132. this.dg1.Font = new System.Drawing.Font("Tahoma", 8F);
  133. this.dg1.ForeColor = System.Drawing.Color.Black;
  134. this.dg1.GridLineColor = System.Drawing.Color.Silver;
  135. this.dg1.HeaderBackColor = System.Drawing.Color.Silver;
  136. this.dg1.HeaderFont = new System.Drawing.Font("Tahoma", 8F);
  137. this.dg1.HeaderForeColor = System.Drawing.Color.Black;
  138. this.dg1.LinkColor = System.Drawing.Color.Maroon;
  139. this.dg1.Location = new System.Drawing.Point(0, 56);
  140. this.dg1.Name = "dg1";
  141. this.dg1.ParentRowsBackColor = System.Drawing.Color.Silver;
  142. this.dg1.ParentRowsForeColor = System.Drawing.Color.Black;
  143. this.dg1.ReadOnly = true;
  144. this.dg1.SelectionBackColor = System.Drawing.Color.Maroon;
  145. this.dg1.SelectionForeColor = System.Drawing.Color.White;
  146. this.dg1.Size = new System.Drawing.Size(190, 184);
  147. this.dg1.TabIndex = 25;
  148. // 
  149. // dg2
  150. // 
  151. this.dg2.AlternatingBackColor = System.Drawing.Color.GhostWhite;
  152. this.dg2.BackColor = System.Drawing.Color.GhostWhite;
  153. this.dg2.BackgroundColor = System.Drawing.Color.Lavender;
  154. this.dg2.BorderStyle = System.Windows.Forms.BorderStyle.None;
  155. this.dg2.CaptionBackColor = System.Drawing.Color.RoyalBlue;
  156. this.dg2.CaptionForeColor = System.Drawing.Color.White;
  157. this.dg2.CaptionText = "查询结果";
  158. this.dg2.DataMember = "";
  159. this.dg2.FlatMode = true;
  160. this.dg2.Font = new System.Drawing.Font("Tahoma", 8F);
  161. this.dg2.ForeColor = System.Drawing.Color.MidnightBlue;
  162. this.dg2.GridLineColor = System.Drawing.Color.RoyalBlue;
  163. this.dg2.HeaderBackColor = System.Drawing.Color.MidnightBlue;
  164. this.dg2.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
  165. this.dg2.HeaderForeColor = System.Drawing.Color.Lavender;
  166. this.dg2.LinkColor = System.Drawing.Color.Teal;
  167. this.dg2.Location = new System.Drawing.Point(196, 56);
  168. this.dg2.Name = "dg2";
  169. this.dg2.ParentRowsBackColor = System.Drawing.Color.Lavender;
  170. this.dg2.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
  171. this.dg2.ReadOnly = true;
  172. this.dg2.SelectionBackColor = System.Drawing.Color.Teal;
  173. this.dg2.SelectionForeColor = System.Drawing.Color.PaleGreen;
  174. this.dg2.Size = new System.Drawing.Size(188, 184);
  175. this.dg2.TabIndex = 26;
  176. // 
  177. // sftx
  178. // 
  179. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  180. this.ClientSize = new System.Drawing.Size(480, 283);
  181. this.Name = "sftx";
  182. this.Text = "宿费提醒";
  183. this.Load += new System.EventHandler(this.sftx_Load);
  184. this.groupBox2.ResumeLayout(false);
  185. this.groupBox3.ResumeLayout(false);
  186. ((System.ComponentModel.ISupportInitialize)(this.dg1)).EndInit();
  187. ((System.ComponentModel.ISupportInitialize)(this.dg2)).EndInit();
  188. } #endregion
  189. private System.Windows.Forms.GroupBox groupBox4;
  190. private System.Windows.Forms.Label label2;
  191. private System.Windows.Forms.Label label1;
  192. private System.Windows.Forms.Button button2;
  193. private System.Windows.Forms.GroupBox groupBox6;
  194. private System.Windows.Forms.Label label3;
  195. private System.Windows.Forms.Label label4;
  196. private System.Windows.Forms.GroupBox groupBox5;
  197. private System.Windows.Forms.DataGrid dg1;
  198. private System.Windows.Forms.DataGrid dg2;
  199. string opername;//传递操作员姓名
  200. private void sftx_Load(object sender, System.EventArgs e)
  201. {
  202. this.AcceptButton =this.button2 ;
  203. this.label1 .Text ="操 作 员:"+this.opername ;
  204. this.label2 .Text ="查询日期:"+System.DateTime .Today.Date.ToShortDateString();
  205. //绑定dg1
  206. DataConn dc=new DataConn ();
  207. string str=dc.connstr ;
  208. SqlConnection conn=new SqlConnection (str);
  209. DataSet dataset=new DataSet ();
  210. string sql="select 凭证号码,姓名,房间号,联系电话,提醒日期 from tabdjb where 提醒日期<'"+System.DateTime .Today .ToShortDateString() +"'";
  211. SqlDataAdapter a1=new SqlDataAdapter (sql,conn);
  212. a1.Fill (dataset,"t1");
  213. dg1.DataSource =dataset.Tables ["t1"];
  214. a1.Dispose ();
  215. dataset.Dispose ();
  216. }
  217. private void button2_Click(object sender, System.EventArgs e)
  218. {
  219. //绑定dg2
  220. DataConn dc=new DataConn ();
  221. string str=dc.connstr ;
  222. SqlConnection conn=new SqlConnection (str);
  223. DataSet dataset=new DataSet ();
  224. string sql="select 凭证号码,姓名,房间号,联系电话 from tabdjb where 提醒日期='"+System.DateTime .Today .ToShortDateString() +"'";
  225. SqlDataAdapter a1=new SqlDataAdapter (sql,conn);
  226. a1.Fill (dataset,"t1");
  227. dg2.DataSource =dataset.Tables ["t1"];
  228. a1.Dispose ();
  229. dataset.Dispose ();
  230. } } }