?? zkadd.cs
字號:
this.numericUpDown_x.TabIndex = 1;
this.numericUpDown_x.ThousandsSeparator = true;
this.numericUpDown_x.Validated += new System.EventHandler(this.numericUpDown_x_Validated);
//
// dateTimePicker_data
//
this.dateTimePicker_data.Location = new System.Drawing.Point(286, 99);
this.dateTimePicker_data.Name = "dateTimePicker_data";
this.dateTimePicker_data.Size = new System.Drawing.Size(98, 21);
this.dateTimePicker_data.TabIndex = 7;
//
// txt_other
//
this.txt_other.Location = new System.Drawing.Point(86, 128);
this.txt_other.Multiline = true;
this.txt_other.Name = "txt_other";
this.txt_other.Size = new System.Drawing.Size(298, 48);
this.txt_other.TabIndex = 8;
this.txt_other.Text = "";
//
// txt_com
//
this.txt_com.Location = new System.Drawing.Point(286, 73);
this.txt_com.Name = "txt_com";
this.txt_com.Size = new System.Drawing.Size(98, 21);
this.txt_com.TabIndex = 6;
this.txt_com.Text = "";
this.txt_com.Validated += new System.EventHandler(this.txt_com_Validated);
//
// label10
//
this.label10.Location = new System.Drawing.Point(38, 144);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(32, 16);
this.label10.TabIndex = 23;
this.label10.Text = "備注";
//
// label11
//
this.label11.Location = new System.Drawing.Point(206, 81);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(76, 16);
this.label11.TabIndex = 20;
this.label11.Text = "施工單位(*)";
//
// label12
//
this.label12.Location = new System.Drawing.Point(206, 104);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(76, 16);
this.label12.TabIndex = 19;
this.label12.Text = "施工時間(*)";
//
// label13
//
this.label13.Location = new System.Drawing.Point(6, 77);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(80, 16);
this.label13.TabIndex = 2;
this.label13.Text = "孔口坐標Y(*)";
//
// label14
//
this.label14.Location = new System.Drawing.Point(6, 102);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(80, 16);
this.label14.TabIndex = 3;
this.label14.Text = "孔口坐標Z(*)";
//
// label15
//
this.label15.Location = new System.Drawing.Point(206, 30);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(76, 16);
this.label15.TabIndex = 21;
this.label15.Text = "終孔深度(*)";
//
// label16
//
this.label16.Location = new System.Drawing.Point(14, 28);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(72, 17);
this.label16.TabIndex = 0;
this.label16.Text = "鉆孔編號(*)";
//
// txt_no
//
this.txt_no.Location = new System.Drawing.Point(88, 23);
this.txt_no.Name = "txt_no";
this.txt_no.Size = new System.Drawing.Size(96, 21);
this.txt_no.TabIndex = 0;
this.txt_no.Text = "";
this.txt_no.Validated += new System.EventHandler(this.txt_no_Validated);
//
// txt_lay
//
this.txt_lay.Location = new System.Drawing.Point(286, 48);
this.txt_lay.Name = "txt_lay";
this.txt_lay.Size = new System.Drawing.Size(98, 21);
this.txt_lay.TabIndex = 5;
this.txt_lay.Text = "";
this.txt_lay.Validated += new System.EventHandler(this.txt_lay_Validated);
//
// label17
//
this.label17.Location = new System.Drawing.Point(206, 54);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(76, 16);
this.label17.TabIndex = 22;
this.label17.Text = "終孔層位(*)";
//
// label18
//
this.label18.Location = new System.Drawing.Point(6, 53);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(80, 17);
this.label18.TabIndex = 1;
this.label18.Text = "孔口坐標X(*)";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.dataGrid_lay);
this.groupBox2.Location = new System.Drawing.Point(8, 192);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(688, 186);
this.groupBox2.TabIndex = 9;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "鉆孔煤層信息";
//
// dataGrid_lay
//
this.dataGrid_lay.CaptionVisible = false;
this.dataGrid_lay.DataMember = "";
this.dataGrid_lay.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGrid_lay.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid_lay.Location = new System.Drawing.Point(3, 17);
this.dataGrid_lay.Name = "dataGrid_lay";
this.dataGrid_lay.Size = new System.Drawing.Size(682, 166);
this.dataGrid_lay.TabIndex = 0;
//
// erp
//
this.erp.ContainerControl = this;
//
// ZKAdd
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(704, 389);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ZKAdd";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "鉆孔數據添加";
this.groupBox4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown_h)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown_z)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown_y)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown_x)).EndInit();
this.groupBox2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGrid_lay)).EndInit();
this.ResumeLayout(false);
}
#endregion
#region 得到輸入的數據、驗證數據
private void get_value()
{
this.k_no = this.txt_no.Text.Trim();
this.k_x = Convert.ToDouble(this.numericUpDown_x.Value);
this.k_y = Convert.ToDouble(this.numericUpDown_y.Value);
this.k_z = Convert.ToDouble(this.numericUpDown_z.Value);
this.k_h = Convert.ToDouble(this.numericUpDown_h.Value);
this.k_other = this.txt_other.Text.Trim();
this.k_com = this.txt_com.Text.Trim();
this.k_date = (DateTime)this.dateTimePicker_data.Value;
this.k_lay = this.txt_lay.Text.Trim();
}
/// <summary>
/// 設置錯誤信息和去掉錯誤信息
/// </summary>
/// <param name="no">是否錯誤</param>
/// <param name="control">錯誤的對象</param>
/// <param name="errstring">錯誤的信息</param>
private void setErr(bool no,System.Windows.Forms.Control control,string errstring,ref bool b_ok)
{
if(no)
{
this.erp.SetError(control,errstring);
b_ok = false;
}
else
{
this.erp.SetError(control,"");
b_ok = true;
}
}
#endregion
#region 添加鉆孔的基本信息 、添加相關煤層信息
/// <summary>
/// 判斷鉆孔是否存在
/// </summary>
/// <param name="k_no">鉆孔的編號</param>
/// <returns>true or false 不存在返回true</returns>
private bool kong_isin(string k_no)
{
DataBase myDB = new DataBase();
SqlParameter[] myParamers={
new SqlParameter("@k_id",SqlDbType.Char,10),
new SqlParameter("@count",SqlDbType.Int)
};
myParamers[0].Value = k_no;
myParamers[1].Direction = ParameterDirection.Output;
if(myDB.RunProcedure_Nr("up_find_kong",myParamers))
{
int m = Convert.ToInt32(myParamers[1].Value);
if(m==0)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
/// <summary>
/// 開始添加鉆孔的基本信息,并且得到該條紀錄的id號
/// </summary>
/// <returns>添加是否成功</returns>
private bool add_kong_ok()
{
DataBase myDB = new DataBase();
SqlParameter[] myParamers={
new SqlParameter("@k_bianhao",SqlDbType.Char,10),
new SqlParameter("@x",SqlDbType.Float),
new SqlParameter("@y",SqlDbType.Float),
new SqlParameter("@z",SqlDbType.Float),
new SqlParameter("@shigong_time",SqlDbType.DateTime),
new SqlParameter("@shigong_danwei",SqlDbType.Char,30),
new SqlParameter("@beizhu",SqlDbType.VarChar,500),
new SqlParameter("@kong_shendu",SqlDbType.Float),
new SqlParameter("@kong_cengwei",SqlDbType.Char,5),
new SqlParameter("@k_id",SqlDbType.Int,4)
} ;
myParamers[0].Value = this.k_no;
myParamers[1].Value = this.k_x;
myParamers[2].Value = this.k_y;
myParamers[3].Value = this.k_z;
myParamers[4].Value = this.k_date;
myParamers[5].Value = this.k_com;
myParamers[6].Value = this.k_other;
myParamers[7].Value = this.k_h;
myParamers[8].Value = this.k_lay;
myParamers[9].Direction = ParameterDirection.Output;
if(myDB.RunProcedure_Nr("up_add_kong",myParamers))
{
this.k_id = Convert.ToInt32(myParamers[9].Value);
return true;
}
else
{
MessageBox.Show("添加鉆孔信息錯誤!","錯誤信息",MessageBoxButtons.OK,MessageBoxIcon.Error);
return false;
}
}
/// <summary>
/// 得到所有的填充選項
/// </summary>
/// <returns>DataSet 包含填充信息</returns>
private DataSet get_fill()
{
DataSet yanset = new DataSet();
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -