| | |
| | | } |
| | | else |
| | | { |
| | | this.dataGridView1.DataSource = null; |
| | | this.dataGridView1.DataSource = new List<WMS.yunneiWCS.material>(); |
| | | this.toolStripLabel5.Text = "/" + 0; |
| | | MessageBox.Show("获取失败"); |
| | | } |
| | |
| | | |
| | | private void materialAdd_Click(object sender, EventArgs e) |
| | | { |
| | | addMaterial addmaterial = new addMaterial(1,0,"","",3,""); |
| | | |
| | | addMaterial addmaterial = new addMaterial(1, 0, "", "", 3, ""); |
| | | |
| | | addmaterial.ShowDialog(); |
| | | if (addmaterial.DialogResult == DialogResult.OK) |
| | | { |
| | |
| | | |
| | | private void btnFind_Click(object sender, EventArgs e) |
| | | { |
| | | name= textBoxMaterialName.Text.Trim(); |
| | | code= textBoxMaterialCode.Text.Trim(); |
| | | name = textBoxMaterialName.Text.Trim(); |
| | | code = textBoxMaterialCode.Text.Trim(); |
| | | try |
| | | { |
| | | paging paga = new paging(); |
| | |
| | | ms.Show(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary>分页回车键 |
| | | /// |
| | | /// </summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | if (e.KeyCode==Keys.Enter) |
| | | if (e.KeyCode == Keys.Enter) |
| | | { |
| | | int numPapg = 0; |
| | | int.TryParse(toolStripTextBox1.Text.Trim(), out numPapg); |
| | | int sizetatol = 0; |
| | | int a=this.toolStripLabel5.Text.Trim().Length; |
| | | string size = this.toolStripLabel5.Text.Trim().Substring(1, a-1); |
| | | int a = this.toolStripLabel5.Text.Trim().Length; |
| | | string size = this.toolStripLabel5.Text.Trim().Substring(1, a - 1); |
| | | int.TryParse(size, out sizetatol); |
| | | if (numPapg > 0 && numPapg <= sizetatol) |
| | | { |
| | |
| | | if (dataGridView1.Columns[e.ColumnIndex].Name == "edit") |
| | | { |
| | | int i = dataGridView1.CurrentRow.Index; |
| | | int id =Convert.ToInt32( dataGridView1.Rows[i].Cells["materialId"].Value.ToString()); |
| | | if (id==3||id==4) |
| | | int id = Convert.ToInt32(dataGridView1.Rows[i].Cells["materialId"].Value.ToString()); |
| | | if (id == 3 || id == 4) |
| | | { |
| | | WMS.EnumDefine.messages ms = new WMS.EnumDefine.messages(2, "空托盘不允许编辑"); |
| | | ms.Show(); |
| | |
| | | } |
| | | string code = dataGridView1.Rows[i].Cells["materialCode"].Value.ToString(); |
| | | string name = dataGridView1.Rows[i].Cells["materialName"].Value.ToString(); |
| | | int type = dataGridView1.Rows[i].Cells["materialType"].Value.ToString()=="1"?1:0; |
| | | int type = dataGridView1.Rows[i].Cells["materialType"].Value.ToString() == "1" ? 1 : 0; |
| | | string version = dataGridView1.Rows[i].Cells["version"].Value == null ? "" : dataGridView1.Rows[i].Cells["version"].Value.ToString(); |
| | | addMaterial addmaterial = new addMaterial(2, id, code, name, type, version); |
| | | |
| | |
| | | this.btnReset_Click(null, null);//刷新主窗体 |
| | | WMS.EnumDefine.messages ms = new WMS.EnumDefine.messages(2, "修改失败"); |
| | | ms.Show(); |
| | | } |
| | | } |
| | | } |
| | | if (dataGridView1.Columns[e.ColumnIndex].Name == "delete") |
| | | { |
| | |
| | | ms.Show(); |
| | | return; |
| | | } |
| | | string res = FLogin.wcsWcf.materialOP(3, id, "", "", 0,""); |
| | | if (res=="") |
| | | string res = FLogin.wcsWcf.materialOP(3, id, "", "", 0, ""); |
| | | if (res == "") |
| | | { |
| | | WMS.EnumDefine.messages ms = new WMS.EnumDefine.messages(1, "删除成功"); |
| | | ms.Show(); |
| | | btnReset_Click(null,null); |
| | | btnReset_Click(null, null); |
| | | } |
| | | else |
| | | { |
| | |
| | | switch (dgv.Columns[e.ColumnIndex].Name) |
| | | { |
| | | case "materialType": |
| | | if ((int)e.Value<2) |
| | | if ((int)e.Value < 2) |
| | | { |
| | | e.Value = (int)e.Value == 1 ? "缸体" : "缸盖"; |
| | | } |
| | | else |
| | | { |
| | | e.Value = "空托盘"; |
| | | e.Value = "空托盘"; |
| | | } |
| | | e.FormattingApplied = true; |
| | | break; |
| | |
| | | int.TryParse(size, out sizetatol); |
| | | toolStripLabel4.Enabled = true; |
| | | if (numPapg <= sizetatol) |
| | | { |
| | | { |
| | | |
| | | paging paga = new paging(); |
| | | paga.pagenum = numPapg; |
| | | paga.pagesize = pagesize; |
| | | findData(paga,name,code ); |
| | | findData(paga, name, code); |
| | | toolStripLabel1.Enabled = true; |
| | | if (numPapg == sizetatol) |
| | | { |
| | |
| | | { |
| | | SolidBrush b = new SolidBrush(this.dataGridView1.RowHeadersDefaultCellStyle.ForeColor); |
| | | e.Graphics.DrawString((e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture), this.dataGridView1.DefaultCellStyle.Font, b, e.RowBounds.Location.X + 20, e.RowBounds.Location.Y + 4); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |