Esempio n. 1
0
        private void btnAddDetail_Click(object sender, EventArgs e)
        {
            frmSelectMaterial frmSelectMaterial = new frmSelectMaterial();

            frmSelectMaterial.Tag = "";
            frmSelectMaterial.ShowDialog();

            //选择的料件填充
            if (frmSelectMaterial.Tag.ToString() != "")
            {
                //得到选择的料件guid,然后得到
                Material material = MaterialManage.GetMaterialByGuid(frmSelectMaterial.Tag.ToString());

                //填充数据
                gridView1.AddNewRow();
                gridView1.SetFocusedRowCellValue(gridMaterialGuid, material.MaterialGuid);
                gridView1.SetFocusedRowCellValue(gridMaterialId, material.MaterialId);
                gridView1.SetFocusedRowCellValue(gridMaterialName, material.MaterialName);
                gridView1.SetFocusedRowCellValue(gridClassName, material.ClassId);
                gridView1.SetFocusedRowCellValue(gridBarNo, material.BarNo);
                gridView1.SetFocusedRowCellValue(gridSpec, material.Spec);
                gridView1.SetFocusedRowCellValue(gridUnit, material.Unit);
                gridView1.SetFocusedRowCellValue(gridRemark, material.Remark);
            }
        }
Esempio n. 2
0
        //选择料件
        private void btnSelectMaterial_Click(object sender, EventArgs e)
        {
            frmSelectMaterial frmSelectMaterial = new frmSelectMaterial();

            frmSelectMaterial.Tag = "";
            frmSelectMaterial.ShowDialog();

            //选择的料件填充
            if (frmSelectMaterial.Tag.ToString() != "")
            {
                //得到选择的料件guid,然后得到
                Material material = MaterialManage.GetMaterialByGuid(frmSelectMaterial.Tag.ToString());

                //填充数据
                txtMaterialGuid.Text = material.MaterialGuid;
                txtBarNo.Text        = material.BarNo;
                txtMaterialName.Text = material.MaterialName;
                txtMaterialId.Text   = material.MaterialId;
                txtSpec.Text         = material.Spec;
            }
        }
Esempio n. 3
0
        private void btnAddDetail_Click(object sender, EventArgs e)
        {
            frmSelectMaterial frmSelectMaterial = new frmSelectMaterial();

            frmSelectMaterial.Tag = "";
            frmSelectMaterial.ShowDialog();

            //选择的料件填充
            if (frmSelectMaterial.Tag.ToString() != "")
            {
                //得到选择的料件guid,然后得到
                Material material = MaterialManage.GetMaterialByGuid(frmSelectMaterial.Tag.ToString());

                //填充数据
                gridView1.AddNewRow();
                gridView1.SetFocusedRowCellValue(gridMaterialGuid, material.MaterialGuid);
                gridView1.SetFocusedRowCellValue(gridMaterialID, material.MaterialId);
                gridView1.SetFocusedRowCellValue(gridMaterialName, material.MaterialName);
                gridView1.SetFocusedRowCellValue(gridClassName, material.ClassId);
                gridView1.SetFocusedRowCellValue(gridBarNo, material.BarNo);
                gridView1.SetFocusedRowCellValue(gridSpec, material.Spec);
                gridView1.SetFocusedRowCellValue(gridUnit, material.Unit);
                gridView1.SetFocusedRowCellValue(gridRemark, material.Remark);

                //出库单货品是否自动计算平均单价
                if (this.Text == "出库单新增" || this.Text == "出库单编辑")
                {
                    string AutoFillBillOutPrice = System.Configuration.ConfigurationSettings.AppSettings["IsAutoFillBillOutPrice"].ToString();;
                    if (AutoFillBillOutPrice == "true")
                    {
                        decimal priceAVG = 0;
                        string  guid     = ((DataRowView)(gridView1.GetFocusedRow())).Row[0].ToString();
                        //得到此料件在某个仓库中的平均价,写入单价列中
                        priceAVG = bm.sp_GetMaterialPrice(guid, cboDepot.Text);
                        gridView1.SetFocusedRowCellValue(gridPrice, priceAVG);
                    }
                }
            }
        }