王 垚
2021-02-04 3bdc41a3c5a0857b04c1ee4d6f7cc515d1983820
src/BLL/Demo.BillView/PRD/Pro_ScDayImport.cs
@@ -111,10 +111,34 @@
                    DateTime date = Convert.ToDateTime(this.Model.GetValue("F_Paez_Date"));
                    if (dt.Rows.Count > 0)
                    {
                        //Entity entity = this.View.BillBusinessInfo.GetEntity("FEntity");
                        //DynamicObjectCollection rows = this.Model.GetEntityDataObject(entity);
                        this.Model.DeleteEntryData("FEntity");
                        //验证导入模板
                        string ErrorResult = "";
                        string error = "";
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            error = "";
                            if (dt.Rows[i][1].ToString() == "")
                                error += "生产订单号不能为空;";
                            if (dt.Rows[i][2].ToString() == "")
                                error += "生产组织不能为空;";
                            if (dt.Rows[i][3].ToString() == "")
                                error += "生产车间不能为空;";
                            if (dt.Rows[i][5].ToString() == "")
                                error += "产品代码不能为空;";
                            if (dt.Rows[i][13].ToString() == "")
                                error += "交货日期不能为空;";
                            if (dt.Rows[i][14].ToString() == "")
                                error += "订单等级不能为空;";
                            if (error.Length > 0)
                                ErrorResult += $"Excel模板存在错误,行数{i + 1}:{error}\r\n";
                        }
                        if (ErrorResult.Length > 0)
                        {
                            this.View.ShowErrMessage(ErrorResult);
                            return;
                        }
                        this.Model.DeleteEntryData("FEntity");
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            //根据生产订单号和物料查询是否存在明细