schangxiang@126.com
2025-09-01 4b51c3551c3957ddd5236a18dd480637835cf7d6
WMS/WMS/UI/Basic/material.cs
@@ -84,7 +84,7 @@
                }
                else
                {
                    this.dataGridView1.DataSource = null;
                    this.dataGridView1.DataSource = new List<WMS.yunneiWCS.material>();
                    this.toolStripLabel5.Text = "/" + 0;
                    MessageBox.Show("获取失败");
                }
@@ -99,8 +99,8 @@
        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)
            {
@@ -111,8 +111,8 @@
        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();
@@ -150,8 +150,8 @@
                ms.Show();
            }
        }
        /// <summary>分页回车键
        /// 
        /// </summary>
@@ -161,13 +161,13 @@
        {
            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)
                    {
@@ -198,8 +198,8 @@
                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();
@@ -207,7 +207,7 @@
                    }
                    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);
@@ -223,7 +223,7 @@
                        this.btnReset_Click(null, null);//刷新主窗体
                        WMS.EnumDefine.messages ms = new WMS.EnumDefine.messages(2, "修改失败");
                        ms.Show();
                    }
                    }
                }
                if (dataGridView1.Columns[e.ColumnIndex].Name == "delete")
                {
@@ -235,12 +235,12 @@
                        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
                    {
@@ -267,13 +267,13 @@
                    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;
@@ -308,12 +308,12 @@
                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)
                    {
@@ -458,13 +458,13 @@
        {
            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);
        }