/// <summary>
    /// 保存数据
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.Lists != null && this.Lists.Count > 0)
        {
            BProductCheckDetailBC bProductCheckDetailBC = new BProductCheckDetailBC();
            try
            {
                if (bProductCheckDetailBC.SaveCheckDetailList(this.Lists))
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"导入数据成功!\");", true);
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"导入数据失败,请重新导入!\");", true);
                }
            }
            catch (Exception ex)
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);

            }
        }
        else
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"导入数据错误,请重新导入!\");", true);
        }
    }
Example #2
0
    public bool SaveProductCheckDetail(int checkDetailId, string strBoxNo, string strCheckResult, int noPassReasonId,
        string strCheckMark, string strCheckDt, int checkGunId, int checkGunIndex, float weight, string strOtherData,
        string strCheckItemNo, string strMaterialNo, int empId)
    {
        BProductCheckDetailBC productCheckDetailBC = new BProductCheckDetailBC();

        try
        {
            //产品检测结果实例赋值
            BProductCheckDetailData productCheckDetailModel = new BProductCheckDetailData();

            productCheckDetailModel.checkDetailId = checkDetailId;//检测单明细ID
            productCheckDetailModel.boxNo = strBoxNo;//箱号
            productCheckDetailModel.checkResult = strCheckResult;//检测结果
            productCheckDetailModel.noPassReasonId = noPassReasonId;//不合格原因
            productCheckDetailModel.checkMark = strCheckMark;//检验备注
            productCheckDetailModel.checkDt = strCheckDt;//检测时间
            productCheckDetailModel.checkGunId = checkGunId;//检测枪
            productCheckDetailModel.checkGunIndex = checkGunIndex;//枪号
            productCheckDetailModel.weight = weight;//称重重量
            productCheckDetailModel.otherData = strOtherData;//其他检测数据
            productCheckDetailModel.isrtEmpId = empId;//添加人员
            productCheckDetailModel.isrtDt = System.DateTime.Now.ToString();//添加时间

            //产品检测结果数据保存
            productCheckDetailBC.EmpID = empId;
            productCheckDetailBC.SaveRecord(productCheckDetailModel, strCheckItemNo, strMaterialNo);

            return true;
        }
        finally
        {
            productCheckDetailBC.Dispose();
        }
    }