/// <summary>
    /// 取消检测判定
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUnSubmit_Click(object sender, EventArgs e)
    {
        SCommBB commBB = new SCommBB();
        BCheckBillBB checkBillBB = new BCheckBillBB();

        try
        {
            bool isChecked = false;

            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");

                if (chkId.Checked == true)
                {
                    string strArriveBillNo = "", strFinanceBillNo = "", strMaterialNo = "";

                    strArriveBillNo = this.grid.DataKeys[gvrow.RowIndex]["arriveBillNo"].ToString();
                    strFinanceBillNo = this.grid.DataKeys[gvrow.RowIndex]["financeBillNo"].ToString();
                    strMaterialNo = this.grid.DataKeys[gvrow.RowIndex]["materialNo"].ToString();

                    //更改检测单
                    BCheckBillData checkBillModel = checkBillBB.GetModel(Convert.ToInt32(chkId.ValidationGroup));

                    if (checkBillModel.instantState != "05" && checkBillModel.instantState != "06")
                    {
                        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"当前检测单未检测判定!\");", true);
                        return;
                    }

                    isChecked = true;

                    commBB.ExecuteSql("update dbo.BCheckBill set checkResult=null,checkEmpId=0,checkDt=null,instantState='04' where id=" + chkId.ValidationGroup);

                    //更改箱检测结果
                    commBB.ExecuteSql("update dbo.BArrangeBillBox set checkResult=0,checkResultDt=null,checkResultEmpId=0 where arriveBillNo='"
                        + strArriveBillNo + "' and financeBillNo='" + strFinanceBillNo + "' and materialNo='" + strMaterialNo + "'");
                }
            }

            if (isChecked)
            {
                this.BindGrid();
            }
            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
        {
            commBB.Dispose();
            checkBillBB.Dispose();
        }
    }
    /// <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();
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 数据保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.ValidataBillState())
        {
            string strInfo = "";
            bool isValidate = this.ValidatePageControlValue(out strInfo);

            if (isValidate)
            {
                BCheckBillBB checkBillBB = new BCheckBillBB();
                BCheckBillBC checkBillBC = new BCheckBillBC();

                try
                {
                    BCheckBillData model = new BCheckBillData();
                    List<BCheckDetailData> listDetail = this.SetDetailApplyBillModel();

                    if (this.State == "1")
                    {
                        this.SetModel(ref model);
                        model.checkBillNo = "";
                        model.isrtDt = DateTime.Now.ToString();
                        model.isrtEmpId = this.currentUser.empId;
                    }
                    else if (this.State == "2")
                    {
                        model = checkBillBB.GetModel(this.IdValue);
                        this.SetModel(ref model);
                        model.updtDt = DateTime.Now.ToString();
                        model.updtEmpId = this.currentUser.empId;
                    }

                    //保存检测单数据
                    checkBillBC.SavelData(model, listDetail, isReNew);

                    Response.Write("<script laguage=\"javascript\">alert('保存成功,请及时提交检测单!');</script>");// "alert", "alert('订单保存成功,请及时提交订单!!');", true);

                    Response.Redirect("BCheckBillList.aspx?&itemno=" + this.itemNo + "&pTypeNo=main", false);
                    Response.Flush();
                    //this.IdValue = model.id;
                    //this.State = "2";
                    //this.ShowInfo(this.IdValue);
                    //this.DtResult = null;
                    //this.BindDetailTable("old");

                    return;
                }
                catch (Exception ex)
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
                    return;
                }
                finally
                {
                    checkBillBB.Dispose();
                    checkBillBC.Dispose();
                    //Response.Redirect("BCheckBillList.aspx?&itemno=" + this.itemNo + "&pTypeNo=main", false);
                }
            }
            else
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + strInfo + "');", true);
            }
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 提交
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        bool retChecked = false;
        BCheckBillBB checkBillBB = new BCheckBillBB();
        BCheckBillBC checkBillBC = new BCheckBillBC();

        try
        {
            //获取选中的数据Id
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
                if (chkId.Checked == true)
                {
                    retChecked = true;
                    int id = int.Parse(chkId.ValidationGroup);
                    BCheckBillData model = checkBillBB.GetModel(id);

                    if (model.instantState == "01")//判断检测单是否已经提交,已经提交不允许提交
                    {
                        //状态置为提交
                        model.commitDt = DateTime.Now.ToString();
                        model.commitEmpId = this.currentUser.empId;
                        model.instantState = "02";
                        checkBillBC.CommitData(model);

                        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"提交成功!\");", true);
                    }
                    else
                    {
                        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"检测单已经提交!\");", true);
                        return;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            checkBillBB.Dispose();
            checkBillBC.Dispose();
        }

        if (retChecked)
        {
            this.BindGrid();
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 修改
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        BCheckBillBB checkBillBB = new BCheckBillBB();

        try
        {
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
                if (chkId.Checked == true)
                {
                    int id = int.Parse(chkId.ValidationGroup);
                    BCheckBillData model = checkBillBB.GetModel(id);
                    if (model.instantState == "01")//判断检测单是否已经提交,已经提交不允许再次修改
                    {
                        Response.Redirect("BCheckBill.aspx?state=2&id=" + chkId.ValidationGroup + "&itemNo=" + this.itemNo + "&pTypeNo=edit", false);
                        return;
                    }
                    else
                    {
                        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"当前检测单已经提交,不允许修改!\");", true);
                        return;
                    }
                }
            }

            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"请选择一条记录!\");", true);
            return;
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            checkBillBB.Dispose();
        }
    }
Ejemplo n.º 6
0
    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDel_Click(object sender, EventArgs e)
    {
        bool retChecked = false;
        BCheckBillBB checkBillBB = new BCheckBillBB();
        SCommBB comBB = new SCommBB();

        try
        {
            //获取选中的数据Id
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
                if (chkId.Checked == true)
                {
                    retChecked = true;
                    int id = int.Parse(chkId.ValidationGroup);
                    BCheckBillData model = checkBillBB.GetModel(id);

                    if (model.instantState == "01")//判断检测单是否已经提交,已经提交不允许删除
                    {
                        //删除主数据
                        checkBillBB.DeleteRecord(id);

                        //删除明细
                        string strsql = "delete  from BCheckDetail where checkBillId='" + id.ToString() + "'";
                        comBB.Query(strsql);
                    }
                    else
                    {
                        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"当前检测单已经提交,不允许删除!\");", true);
                        return;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            checkBillBB.Dispose();
            comBB.Dispose();
        }

        if (retChecked)
        {
            this.BindGrid();
        }
    }
Ejemplo n.º 7
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();
        }
    }
Ejemplo n.º 8
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();
        }
    }