コード例 #1
0
    public bool UpdateCheckBil(int checkBillId, int empId, string instantState, string checkResult, string checkmark, string checkDt, string arriveBillNo, string materialNo, string finaceBillNO)
    {
        //第一步 更新BcheckBill
        BCheckBillBB checkBillBB = new BCheckBillBB();
        SCommBB commBB = new SCommBB();

        HS.Model.BCheckBillData data = checkBillBB.GetModel(Convert.ToInt32(checkBillId));
        try
        {
            if (data.instantState == "04")
            {
                data.instantState = instantState;//05是合格 06是不合格
                data.checkMark = checkmark;
                data.checkDt = DateTime.Now.ToString();
                data.checkEmpId = empId;
                data.checkResult = checkResult;//直接是合格或是不合格
                if (checkBillBB.ModifyRecord(data))
                {
                    bool checkResultNew;
                    if (checkResult == "合格")
                        checkResultNew = true;
                    else
                        checkResultNew = false;
                    //第二步 更新BarrangeBillBox

                    //更改所有箱的判定结果
                    commBB.ExecuteSql("update dbo.BArrangeBillBox set checkResult='" + checkResultNew
                        + "',checkResultDt='" + System.DateTime.Now.ToString() + "',checkResultEmpId='" + empId
                        + "' where arriveBillNo='" + arriveBillNo + "' and financeBillNo='" + finaceBillNO
                        + "' and materialNo='" + materialNo + "'");
                }

            }
            return true;
        }
        catch
        {
            return false;
        }
        finally
        {
            checkBillBB.Dispose();
            commBB.Dispose();
        }
    }
コード例 #2
0
    /// <summary>
    /// 保存判断结果
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSaveRet_click(object sender, EventArgs e)
    {
        BCheckBillBB checkBillBB = new BCheckBillBB();
        SCommBB commBB = new SCommBB();

        try
        {
            HS.Model.BCheckBillData data = checkBillBB.GetModel(Convert.ToInt32(this.IdValue));

            if (data.instantState == "04")
            {
                data.instantState = this.rdopass.Checked ? "05" : "06";//05 合格  06不合格
                data.checkMark = this.txtMark.Text;
                data.checkDt = DateTime.Now.ToString();
                data.checkEmpId = this.currentUser.empId;
                data.checkResult = this.rdopass.Checked ? "合格" : "不合格";

                if (checkBillBB.ModifyRecord(data))
                {
                    bool checkResult = rdopass.Checked ? true : false;

                    //更改所有箱的判定结果
                    commBB.ExecuteSql("update dbo.BArrangeBillBox set checkResult='" + checkResult
                        + "',checkResultDt='" + System.DateTime.Now.ToString() + "',checkResultEmpId='" + this.currentUser.empId
                        + "' where arriveBillNo='" + Request.QueryString["ano"] + "' and financeBillNo='" + Request.QueryString["fno"]
                        + "' and materialNo='" + Request.QueryString["mno"] + "'");

                    this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"检测单判定录入成功!\");location.replace('BCheckBillListResult.aspx?itemNo=0402&pTypeNo=main');", true);
                }
                else
                {
                    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);
            return;
        }
        finally
        {
            checkBillBB.Dispose();
            commBB.Dispose();
        }
    }
コード例 #3
0
    public bool FinishCheckBill(int checkBillId)
    {
        BCheckBillBB checkBillBB = new BCheckBillBB();

        try
        {
            BCheckBillData checkBillModel = new BCheckBillData();

            checkBillModel = checkBillBB.GetModel(checkBillId);
            checkBillModel.instantState = "04";

            return checkBillBB.ModifyRecord(checkBillModel);

        }
        finally
        {
            checkBillBB.Dispose();
        }
    }