jhz
2024-09-09 4d232e1320144ac421bcdec1ebfe3424d667c7a6
WarM/²Ö¿â¹ÜÀí/Kf_SellOutBill.cs
@@ -3244,6 +3244,71 @@
        private void cmdHDataIn_Click(object sender, EventArgs e)
        {
            WarM.Gy_DataInTmp2 oGy_DataInTmp2 = new Gy_DataInTmp2();
            oGy_DataInTmp2.ShowDialog();
            int HDataMaterNumberCol = 0;
            int HDataQtyCol = 1;
            int HDataMoneyCol = 2;
            if (oGy_DataInTmp2.isOK == 1)
            {
                initGrid();
                for (int i = 0; i <= oGy_DataInTmp2.grdMain.RowCount - 1; i++)
                {
                    if (DBUtility.ClsPub.isStrNull(oGy_DataInTmp2.grdMain.Rows[i].Cells[HDataMaterNumberCol].Value) != "")
                    {
                        DAL.ClsGy_Material_View oMater = new DAL.ClsGy_Material_View();
                        DAL.ClsGy_Unit_View oUnit = new DAL.ClsGy_Unit_View();
                        //DAL.ClsGy_MatePriceCus_Ctl oMatePriceCus = new DAL.ClsGy_MatePriceCus_Ctl();
                        //DAL.ClsGy_MateNumRelation_View oRelation = new DAL.ClsGy_MateNumRelation_View();
                        if (oMater.GetInfoByNumber(DBUtility.ClsPub.isStrNull(oGy_DataInTmp2.grdMain.Rows[i].Cells[HDataMaterNumberCol].Value)))
                        {
                            grdMain.Rows[i].Cells[HMaterNumberCol].Value = oMater.omodel.HNumber;
                            grdMain.Rows[i].Cells[HMaterModelCol].Value = oMater.omodel.HModel;
                            grdMain.Rows[i].Cells[HMaterNameCol].Value = oMater.omodel.HName;
                            grdMain.Rows[i].Cells[HSubjoinCol].Value = oMater.omodel.HSubjoin;
                            grdMain.Rows[i].Cells[HUnitIDCol].Value = oMater.omodel.HUnitID.ToString();
                            if (oUnit.GetInfoByID(oMater.omodel.HUnitID))
                            {
                                grdMain.Rows[i].Cells[HUnitIDCol].Value = oUnit.omodel.HItemID;
                                grdMain.Rows[i].Cells[HUnitNameCol].Value = oUnit.omodel.HName;
                                grdMain.Rows[i].Cells[HUnitNumberCol].Value = oUnit.omodel.HNumber;
                            }
                            //if (oRelation.GetInfoByMaterAndCus(oMater.omodel.HItemID, DBUtility.ClsPub.isLong(this.txtHSupID.Tag)))
                            //{
                            //    grdMain.Rows[grdMain.CurrentRow.Index].Cells[HCusRelationNumberCol].Value = oRelation.omodel.HNumber;
                            //    grdMain.Rows[grdMain.CurrentRow.Index].Cells[HCusRelationNameCol].Value = oRelation.omodel.HName;
                            //}
                            grdMain.Rows[i].Cells[HQtyCol].Value = DBUtility.ClsPub.isDoule(oGy_DataInTmp2.grdMain.Rows[i].Cells[HDataQtyCol].Value, 4);
                            grdMain.Rows[i].Cells[HMoneyCol].Value = DBUtility.ClsPub.isDoule(oGy_DataInTmp2.grdMain.Rows[i].Cells[HDataMoneyCol].Value, 2);
                            if (DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HQtyCol].Value) != 0)
                            {
                                double sPrice = ClsPub.isDoule(grdMain.Rows[i].Cells[HMoneyCol].Value) / ClsPub.isDoule(grdMain.Rows[i].Cells[HQtyCol].Value);
                                grdMain.Rows[i].Cells[HPriceCol].Value = ClsPub.isDoule(sPrice, 4);
                            }
                            if (this.ModCaption == "销售出库单_零售1" && oMater.omodel.HRatePrice > 0)
                            {
                                grdMain.Rows[i].Cells[HSalePriceCol].Value = oMater.omodel.HRatePrice.ToString();//获取促销价
                            }
                            else
                            {
                                grdMain.Rows[i].Cells[HSalePriceCol].Value = oMater.omodel.HSalePrice.ToString();
                            }
                            //if (DBUtility.ClsPub.isDoule(grdMain.Rows[grdMain.CurrentRow.Index].Cells[HPriceCol].Value) == 0)
                            //{
                            //    grdMain.Rows[grdMain.CurrentRow.Index].Cells[HPriceCol].Value = grdMain.Rows[grdMain.CurrentRow.Index].Cells[HSalePriceCol].Value;
                            //}
                            //EditingControl.Text = grdMain.Rows[grdMain.CurrentRow.Index].Cells[grdMain.CurrentCell.ColumnIndex].Value.ToString();
                            //Sub_RowCount(i, HMoneyCol);
                        }
                        else
                        {
                            MessageBox.Show("第" + Convert.ToString(i + 1) + "行,错误的物料代码!");
                        }
                    }
                }
            }
        }
    }
}