/// <summary>
    /// 生成排拖单
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnPaiFact_Click(object sender, EventArgs e)
    {
        //获取选中的数据Id
        foreach (GridViewRow gvrow in this.grid.Rows)
        {
            CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
            if (chkId.Checked == true)
            {
                string strBillNo = "", strCustNm = "", strArriveDt = "", strSate = "";

                strBillNo = chkId.ValidationGroup;
                strCustNm = this.grid.DataKeys[gvrow.RowIndex].Values["custNm"].ToString();
                strArriveDt = this.grid.DataKeys[gvrow.RowIndex].Values["arriveDt"].ToString();

                //实时获取订单状态
                using (BArriveBillBB billBB = new BArriveBillBB())
                {
                    DataSet ds = billBB.GetVList(" billNo='" + strBillNo + "'");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        strSate = ds.Tables[0].Rows[0]["instantState"].ToString();
                    }
                }

                //判断到货单明细是否全部完成
                using (BArriveDetailBB arriveDetailBB = new BArriveDetailBB())
                {
                    DataTable dtArriveDetail = arriveDetailBB.GetList("arriveBillNo='" + strBillNo + "'").Tables[0];

                    foreach (DataRow row in dtArriveDetail.Rows)
                    {
                        if (Convert.ToBoolean(row["isFinishReceive"]) == false)
                        {
                            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"当前到货单未收货完成!\");", true);
                            return;
                        }
                    }
                }

                if (strSate != "03" && strSate != "04" && strSate != "05")
                {
                    Response.Redirect("../BArriveDetail/BArriveDetailList.aspx?billNo=" + strBillNo
                        + "&custnm=" + Server.UrlEncode(strCustNm) + "&arriveDt=" + Server.UrlEncode(strArriveDt) + "&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;
    }
Пример #2
0
    /// <summary>
    /// 绑定到货物料明细表
    /// </summary>
    protected void BindMateriel()
    {
        using (BArriveDetailBB arriveDetailBB = new BArriveDetailBB())
        {
            string strWhere = " isFinishReceive=1";
            DataSet ds = new DataSet();

            //到货单号
            if (this.txtA.Text.Trim() != "")
            {
                strWhere += " and arriveBillNo like '%" + this.txtA.Text.Replace("'", "''") + "%' ";
            }

            //采购单号
            if (this.txtB.Text.Trim() != "")
            {
                strWhere += " and financeBillNo like '%" + this.txtB.Text.Replace("'", "''") + "%' ";
            }

            //物料
            if (this.txtC.Text.Trim() != "")
            {
                strWhere += " and (materialNo like '%" + this.txtC.Text.Replace("'", "''")
                    + "%' or materialDesc like '%" + this.txtC.Text.Replace("'", "''") + "%')";
            }

            //必须是排托已完成的物料
            //strWhere += " and exists (select 1 from dbo.BArriveBill where dbo.BArriveBill.instantState='05' and dbo.BArriveBill.billNo=dbo.vBArriveDetail.arriveBillNo)";

            //必须尚未生成检验单的物料
            strWhere += @" and not exists(select 1 from BCheckBill where BCheckBill.arriveBillNo=vBArriveDetail.arriveBillNo and
                                               BCheckBill.financeBillNo=vBArriveDetail.financeBillNo and BCheckBill.materialNo=vBArriveDetail.materialNo)";

            //判定必须有收货并且有放置在质检区信息
            strWhere += @" and exists(select 1 from dbo.vBArrangeBillBox as t
                                      where t.arriveBillNo=dbo.vBArriveDetail.arriveBillNo
                                          and t.financeBillNo=dbo.vBArriveDetail.financeBillNo
                                          and t.materialNo=dbo.vBArriveDetail.materialNo
                                          and t.wareType='01')";

            //到货单物料所在库位类别为质检区
            strWhere += @" and not exists(select 1 from dbo.vBArrangeBillBox as t
                                          where t.arriveBillNo=dbo.vBArriveDetail.arriveBillNo
                                              and t.financeBillNo=dbo.vBArriveDetail.financeBillNo
                                              and t.materialNo=dbo.vBArriveDetail.materialNo
                                              and t.wareType<>'01')";

            ds = arriveDetailBB.GetVList(strWhere);
            this.grvMateriel.DataSource = ds.Tables[0];
            this.grvMateriel.DataBind();

            //赋值记录条数、页面总数
            this.Label3.Text = ds.Tables[0].Rows.Count.ToString();
            this.Label2.Text = this.grvMateriel.PageCount.ToString();
            this.currPage.Text = (this.grvMateriel.PageIndex + 1).ToString();
        }
    }
Пример #3
0
    /// <summary>
    /// 到货单列表行事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void grid_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();

        try
        {
            GridViewRow gvRow = (e.CommandSource as LinkButton).NamingContainer as GridViewRow;
            BArriveDetailData arriveDetailModel = new BArriveDetailData();

            #region 重新收货

            if (e.CommandName == "receive")
            {
                int id = Convert.ToInt32(this.grid.DataKeys[gvRow.RowIndex]["id"]);

                arriveDetailModel = arriveDetailBB.GetModel(id);

                arriveDetailModel.isFinishReceive = false;//收货未完成

                arriveDetailBB.ModifyRecord(arriveDetailModel);

                return;
            }

            #endregion 重新收货
        }
        finally
        {
            arriveDetailBB.Dispose();
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.StrWhere = "1=1";
            string id= Request.QueryString["id"];

            BArriveDetailBB arriveDetailBB = new BArriveDetailBB();
            BArriveBillBB arriveBillBB = new BArriveBillBB();
            DataSet ds = new DataSet();

            try
            {
                vBArriveBillData data = arriveBillBB.GetVModel(Convert.ToInt32(id));
                this.IdValue =  data.billNo;
                this.StrWhere = " arriveBillNo='" + data.billNo + "'";
                txtBillNo.Text = data.billNo;
                txtSupple.Text = data.custNm;
                txtarrageBillNo.Text = "PT" + data.billNo;
                txtarriveDt.Text = Convert.ToDateTime(data.arriveDt).ToString("yyyy-MM-dd");
                this.DtDetail = arriveDetailBB.GetVList(this.StrWhere).Tables[0];
            }
            finally
            {
                arriveDetailBB.Dispose();
            }

            this.BindGrid();
        }

        InitPageData();
    }
    /// <summary>
    /// 初始化数据
    /// </summary>
    private void InitData()
    {
        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();
        BArrangeBillDetailBB arrangeBillDetailBB = new BArrangeBillDetailBB();

        try
        {
            #region 生成到货明细数据源

            //到货明细
            this.DtDetail = arriveDetailBB.GetVList(" arriveBillNo='" + this.ArriveBillNo + "'").Tables[0];

            #endregion 生成到货明细数据源

            #region 生成排托明细数据源

            //排托明细
            string strWhere = "arriveBillNo=@arriveBillNo";
            SqlParameter[] param = new SqlParameter[] { new SqlParameter("@arriveBillNo", this.ArriveBillNo) };
            DataSet ds = arrangeBillDetailBB.GetVList(strWhere, param);

            if (ds != null && ds.Tables.Count > 0)
            {
                this.DtResult = ds.Tables[0];

                this.DtResult.Columns.Add(new DataColumn("rowId", typeof(string)));
                this.DtResult.Columns.Add(new DataColumn("isdel", typeof(string)));
                this.DtResult.Columns.Add(new DataColumn("ischeck", typeof(string)));
                this.DtResult.Columns.Add(new DataColumn("hideAmount", typeof(string)));

                foreach (DataRow dr in this.DtResult.Rows)
                {
                    dr["rowId"] = Guid.NewGuid().ToString();
                    dr["isdel"] = "0";
                    dr["ischeck"] = "false";

                    #region 记录合计行

                    if (dr["boxNum"] != null && dr["boxNum"] != DBNull.Value)
                    {
                        //初始化时保存amount的原始值
                        dr["hideAmount"] = dr["boxNum"].ToString() == "" ? "0" : dr["boxNum"].ToString();
                    }
                    else
                    {
                        dr["hideAmount"] = "0";
                    }

                    #endregion
                }
            }

            #endregion 生成排托明细数据源
        }
        finally
        {
            arriveDetailBB.Dispose();
            arrangeBillDetailBB.Dispose();
        }
    }
Пример #6
0
    /// <summary>
    /// 提交SAP
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnCommit_Click(object sender, EventArgs e)
    {
        DMWJEXECUTE services = new DMWJEXECUTE();
        IList<string> messList = new List<string>();
        messList.Clear();
        try
        {
            bool isChecked = false;

            //获取选中的数据Id
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");

                if (chkId.Checked == true)
                {
                    int financeBillId = 0, financeBillLineNum = 0;
                    string strMaterialNo = "", custNo = "", custNm = "";
                    DateTime stockDt, arriveDt;
                    double num = 0;

                    financeBillId = Convert.ToInt32(this.grid.DataKeys[gvrow.RowIndex]["financeBillId"]);
                    financeBillLineNum = Convert.ToInt32(this.grid.DataKeys[gvrow.RowIndex]["financeBillLineNum"]);
                    strMaterialNo = this.grid.DataKeys[gvrow.RowIndex]["materialNo"].ToString();
                    num = Convert.ToDouble(this.grid.DataKeys[gvrow.RowIndex]["num"]);
                    stockDt = Convert.ToDateTime(this.grid.DataKeys[gvrow.RowIndex]["stockDt"]);
                    arriveDt = Convert.ToDateTime(this.grid.DataKeys[gvrow.RowIndex]["arriveDt"]);
                    custNo = this.grid.DataKeys[gvrow.RowIndex]["custNo"].ToString();
                    custNm = this.grid.DataKeys[gvrow.RowIndex]["custNm"].ToString();

                    string mess = Convert.ToInt32(chkId.ValidationGroup).ToString() + ";" + financeBillId.ToString() + ";" + financeBillLineNum.ToString() + ";" + strMaterialNo + ";" + num.ToString() + ";" + stockDt + ";" + arriveDt + ";" + custNo + ";" + custNm;

                    messList.Add(mess);
                    //strResult = services.SAPInStock(Convert.ToInt32(chkId.ValidationGroup), financeBillId,
                    //    financeBillLineNum, strMaterialNo, num, stockDt, arriveDt, custNo, custNm);

                    //if (strResult.Split('&')[0] == "1")
                    //{
                    //    isChecked = true;
                    //}
                    //else if (strResult.Split('&')[0] == "0")
                    //{
                    //    this.BindGrid();
                    //    this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + strResult.Split('&')[1] + "\");", true);
                    //    return;
                    //}
                }
            }

            if (messList.Count > 0)
            {
                SapOnlineService.SapOnlineService sapService = new SapOnlineService.SapOnlineService();
                SapOnlineService.POR1[] list = new SapOnlineService.POR1[messList.Count];
                for (int i = 0; i < messList.Count; i++)
                {
                    SapOnlineService.POR1 por1 = new SapOnlineService.POR1();
                    por1.DocEntry = Convert.ToInt32(messList[i].Split(';')[1].ToString());
                    por1.LineNum = Convert.ToInt32(messList[i].Split(';')[2].ToString());
                    por1.ItemCode = messList[i].Split(';')[3].ToString();
                    por1.Quantity = Convert.ToDouble(messList[i].Split(';')[4].ToString());//数量
                    list[i] = por1;
                }
                string strResult = sapService.Web_AddPDN_For_POR1(messList[0].Split(';')[7].ToString(), messList[0].Split(';')[8].ToString(), Convert.ToDateTime(messList[0].Split(';')[5].ToString()), "由WMS同步", Convert.ToDateTime(messList[0].Split(';')[5].ToString()), "由WMS同步", Convert.ToDateTime(messList[0].Split(';')[6].ToString()), list);

                if (strResult.Split('&')[0] == "1")
                {
                    for (int i = 0; i < messList.Count; i++)
                    {
                        BArriveDetailData arriveDetailModel = new BArriveDetailData();
                        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();
                        SCommBB commBB = new SCommBB();
                        arriveDetailModel = arriveDetailBB.GetModel(Convert.ToInt32(messList[i].Split(';')[0]));

                        arriveDetailModel.isSapInStock = true;//是否已提交SAP入库

                        arriveDetailBB.ModifyRecord(arriveDetailModel);

                        //更改物料箱的“是否已提交SAP入库”状态
                        commBB.ExecuteSql(@"update dbo.BArrangeBillBox set isSapInStock=1 where isSapInStock=0
                                       and inStockDt is not null and arriveBillNo='" + arriveDetailModel.arriveBillNo
                                         + "' and financeBillId='" + messList[i].Split(';')[1].ToString() + "' and financeBillLineNum='" + messList[i].Split(';')[2].ToString()
                                         + "' and materialNo='" + messList[i].Split(';')[3].ToString() + "'"
                                         +" or oldMaterialNo ='"+ messList[i].Split(';')[3].ToString() + "'"
                                         +" and  isSapInStock=0  and inStockDt is not null and arriveBillNo='" + arriveDetailModel.arriveBillNo
                                         + "' and financeBillId='" + messList[i].Split(';')[1].ToString() + "' and financeBillLineNum='" + messList[i].Split(';')[2].ToString()+"'");

                    }

                    isChecked = true;
                }
                else if (strResult.Split('&')[0] == "0")
                {
                    this.BindGrid();
                    this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + strResult.Split('&')[1] + "\");", true);
                    return;
                }

            }

            if (isChecked)
            {
                this.BindGrid();
                this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"SAP入库成功!\");", true);
            }
        }
        catch (Exception error)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + error.Message + "\");", true);
        }
        finally
        {
            services.Dispose();

        }
    }
    /// <summary>
    /// 绑定数据
    /// </summary>
    private void BindGrid()
    {
        //throw new NotImplementedException();
        BArriveDetailBB saleBillBB = new BArriveDetailBB();
        DataSet ds = new DataSet();

        try
        {

            string strwhere = this.StrWhere;

            //销售订单编号
            if (!string.IsNullOrEmpty(this.txtSaleBillNo.Text))
            {
                strwhere += " and billNo like '%" + this.txtSaleBillNo.Text.Trim().Replace("'", "''").Trim() + "%'";
            }

            //客户
            if (!string.IsNullOrEmpty(this.txtMaterialNo.Text))
            {
                strwhere += " and (MaterialNo like '%" + this.txtMaterialNo.Text.Replace("'", "''").Trim()
                    + "%')";
            }

            //订单状态

           // ds = saleBillBB.GetVListChange(strwhere);
            ds = saleBillBB.GetVListChange(strwhere);
            this.grid.DataSource = ds.Tables[0];
            this.grid.DataBind();

            //赋值记录条数、页面总数
            this.Label3.Text = ds.Tables[0].Rows.Count.ToString();
            this.Label2.Text = this.grid.PageCount.ToString();
            this.currPage.Text = (this.grid.PageIndex + 1).ToString();
        }
        finally
        {
            saleBillBB.Dispose();
        }
    }
    /// <summary>
    /// 提交按钮
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnCommit_Click(object sender, EventArgs e)
    {
        DMWJEXECUTE services = new DMWJEXECUTE();
        IList<string> messList = new List<string>();
        messList.Clear();
        try
        {
            bool isChecked = false;

            //获取选中的数据Id
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");

                if (chkId.Checked == true)
                {
                    int financeBillId = 0, financeBillLineNum = 0;
                    string strMaterialNo = "", custNo = "", custNm = "";
                    string financeBillNo = "";
                    DateTime stockDt, arriveDt;
                    double num = 0;
                    string SAPDocEntry = "";
                    string arrivebillNO = "";
                    //financeBillId = Convert.ToInt32(this.grid.DataKeys[gvrow.RowIndex]["financeBillId"]);
                    financeBillLineNum = Convert.ToInt32(this.grid.DataKeys[gvrow.RowIndex]["financeBillLineNum"]);
                    arrivebillNO = this.grid.DataKeys[gvrow.RowIndex]["arriveBillNo"].ToString();
                    financeBillNo = this.grid.DataKeys[gvrow.RowIndex]["financeBillNo"].ToString();
                    SAPDocEntry = arrivebillNO.Remove(0, 2);
                    strMaterialNo = this.grid.DataKeys[gvrow.RowIndex]["materialNo"].ToString();
                    num = Convert.ToDouble(this.grid.DataKeys[gvrow.RowIndex]["num"]);
                    stockDt = Convert.ToDateTime(this.grid.DataKeys[gvrow.RowIndex]["stockDt"]);
                    arriveDt = Convert.ToDateTime(this.grid.DataKeys[gvrow.RowIndex]["arriveDt"]);
                    custNo = this.grid.DataKeys[gvrow.RowIndex]["custNo"].ToString();
                    custNm = this.grid.DataKeys[gvrow.RowIndex]["custNm"].ToString();
                    SapOnlineService.SapOnlineService sapService = new SapOnlineService.SapOnlineService();
                    string strResult = sapService.IGN1_Web_Add_From_WMS(Convert.ToDateTime(stockDt), financeBillNo, int.Parse(SAPDocEntry), strMaterialNo, num, "01");

                    int id = Convert.ToInt32(chkId.ValidationGroup);
                    if (strResult.Split('&')[0] == "1")
                    {

                            BArriveDetailData arriveDetailModel = new BArriveDetailData();
                            BArriveDetailBB arriveDetailBB = new BArriveDetailBB();
                            SCommBB commBB = new SCommBB();
                            arriveDetailModel = arriveDetailBB.GetModel(id);

                            arriveDetailModel.isSapInStock = true;//是否已提交SAP入库

                            arriveDetailBB.ModifyRecord(arriveDetailModel);

                            //更改物料箱的“是否已提交SAP入库”状态
                            commBB.ExecuteSql(@"update dbo.BArrangeBillBox set isSapInStock=1 where isSapInStock=0
                                       and inStockDt is not null and arriveBillNo='" + arriveDetailModel.arriveBillNo
                                             + "'  and financeBillLineNum='" + financeBillLineNum
                                             + "' and materialNo='" +strMaterialNo + "'"
                                             + " or oldMaterialNo ='" +strMaterialNo+ "'"
                                             + " and  isSapInStock=0  and inStockDt is not null and arriveBillNo='" + arriveDetailModel.arriveBillNo
                                             + "'and financeBillLineNum='" + financeBillLineNum + "'");
                            isChecked = true;

                        }

                    else if (strResult.Split('&')[0] == "0")
                    {
                        this.BindGrid();
                        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + strResult.Split('&')[1] + "\");", true);
                        return;
                    }
                }

                if (isChecked)
                {
                    this.BindGrid();
                    this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"SAP入库成功!\");", true);
                }

            }

        }
        catch (Exception error)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + error.Message + "\");", true);
        }
        finally
        {
            services.Dispose();

        }
    }
Пример #9
0
    public void FinishTSArriveDetail(int arriveDetailId)
    {
        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();
        SCommBB commBB = new SCommBB();

        try
        {
            BArriveDetailData arriveDetailModel = new BArriveDetailData();
            object obj = null;
            string strArriveBillNo = "", strFinanceBillNo = "", strMaterialNo = "";

            arriveDetailModel = arriveDetailBB.GetModel(arriveDetailId);
            arriveDetailModel.isFinishReceive = true;//收货完成

            arriveDetailBB.ModifyRecord(arriveDetailModel);

            //更改到货单明细的排托数量
            strArriveBillNo = arriveDetailModel.arriveBillNo;
            strFinanceBillNo = arriveDetailModel.financeBillNo;
            strMaterialNo = arriveDetailModel.materialNo;

            obj = commBB.ExecuteScalar("select count(1) from dbo.BArrangeBillBox where arriveBillNo='"
                + strArriveBillNo + "' and financeBillNo='" + strFinanceBillNo + "' and materialNo='" + strMaterialNo + "'");
            if (obj != null)
            {
                commBB.ExecuteSql("update dbo.BarriveDetail set boxNum=" + obj.ToString() + " where id=" + arriveDetailId.ToString());
            }
        }
        finally
        {
            arriveDetailBB.Dispose();
            commBB.Dispose();
        }
    }
Пример #10
0
    public bool UpdateArriveDetailWeight(int arriveDetailId, double firstBoxSingleWeight)
    {
        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();

        try
        {
            BArriveDetailData arriveDetailModel = new BArriveDetailData();

            arriveDetailModel = arriveDetailBB.GetModel(arriveDetailId);
            arriveDetailModel.firstBoxSingleWeight = firstBoxSingleWeight;

            return arriveDetailBB.ModifyRecord(arriveDetailModel);
        }
        finally
        {
            arriveDetailBB.Dispose();
        }
    }
Пример #11
0
    public void SaveArriveBox(int arriveDetailId, string strArriveBillNo, string strFinanceBillNo, string strMaterialNo,
        string strBoxNo, string strPalletNo, int factNum, int isrtEmpId, string strWareLocatorNo)
    {
        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();
        BArrangeBillBoxBB arrangeBillBoxBB = new BArrangeBillBoxBB();
        SCommBB commBB = new SCommBB();

        try
        {
            BArriveDetailData arriveDetailModel = new BArriveDetailData();
            BArrangeBillBoxData arrangeBillBoxModel = new BArrangeBillBoxData();
            DataTable dtWareLocator = new DataTable();

            //获取某库位信息
            dtWareLocator = this.GetWareLocatorInfo(strWareLocatorNo);

            //获取到货单明细实例
            arriveDetailModel = arriveDetailBB.GetModel(arriveDetailId);

            arrangeBillBoxModel.arriveBillNo = strArriveBillNo;//到货单号
            arrangeBillBoxModel.financeBillNo = strFinanceBillNo;//采购单号
            arrangeBillBoxModel.financeBillId = arriveDetailModel.financeBillId;//采购订单ID
            arrangeBillBoxModel.financeBillLineNum = arriveDetailModel.financeBillLineNum;//采购订单行号
            arrangeBillBoxModel.materialNo = strMaterialNo;//物料号
            arrangeBillBoxModel.boxNo = strBoxNo;//箱号
            arrangeBillBoxModel.palletNo = strPalletNo;//托盘号
            arrangeBillBoxModel.wareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//库区
            arrangeBillBoxModel.wareLocatorNo = strWareLocatorNo;//库位
            arrangeBillBoxModel.isBoxArrange = false;//箱子是否已经排托
            arrangeBillBoxModel.isPalletUsing = false;//托盘是否占用
            arrangeBillBoxModel.acceptEmpId = isrtEmpId;//收货人
            arrangeBillBoxModel.acceptDt = System.DateTime.Now.ToString();//收货时间
            arrangeBillBoxModel.factNum = factNum;//收货数量

            arrangeBillBoxBB.AddRecord(arrangeBillBoxModel);

            //锁定库位
            commBB.ExecuteSql("update dbo.LWareLocator set isUsing=1 where wareLocatorNo='" + strWareLocatorNo + "'");
        }
        finally
        {
            arriveDetailBB.Dispose();
            arrangeBillBoxBB.Dispose();
            commBB.Dispose();
        }
    }
Пример #12
0
    public string SAPInStock(int arriveDetailId, int financeBillId, int financeBillLineNum, string strMaterialNo,
        double num, DateTime stockDt, DateTime arriveDt, string custNo, string custNm)
    {
        SapOnlineService.SapOnlineService sapService = new SapOnlineService.SapOnlineService();
        SCommBB commBB = new SCommBB();
        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();

        try
        {
            SapOnlineService.POR1[] list = null;
            SapOnlineService.POR1 por1 = new SapOnlineService.POR1();
            BArriveDetailData arriveDetailModel = new BArriveDetailData();
            string strResult = "";

            //SAP入库
            //需要传递:采购订单号、行号、物料号、数量
            list = new SapOnlineService.POR1[1];

            por1.DocEntry = financeBillId;//采购订单号
            por1.LineNum = financeBillLineNum;//采购订单行号
            por1.ItemCode = strMaterialNo;//物料编号
            por1.Quantity = num;//数量

            list[0] = por1;
            strResult = sapService.Web_AddPDN_For_POR1(custNo, custNm, stockDt, "由WMS同步", stockDt, "由WMS同步", stockDt, list);
            // strResult = sapService.Web_AddPDN_For_POR1(por1.DocEntry, stockDt, "从仓库系统生成", arriveDt, list);

            if (strResult.Split('&')[0] == "1")
            {
                //更改到货中间表数据
                arriveDetailModel = arriveDetailBB.GetModel(arriveDetailId);

                arriveDetailModel.isSapInStock = true;//是否已提交SAP入库

                arriveDetailBB.ModifyRecord(arriveDetailModel);

                //更改物料箱的“是否已提交SAP入库”状态
                commBB.ExecuteSql(@"update dbo.BArrangeBillBox set isSapInStock=1 where isSapInStock=0
                                    and inStockDt is not null and arriveBillNo='" + arriveDetailModel.arriveBillNo
                                    + "' and financeBillId='" + financeBillId + "' and financeBillLineNum='" + financeBillLineNum
                                    + "' and materialNo='" + strMaterialNo + "'");
            }

            return strResult;
        }
        finally
        {
            sapService.Dispose();
            arriveDetailBB.Dispose();
            commBB.Dispose();
        }
    }
Пример #13
0
    public DataTable GetArriveDetail(int arriveDetailId)
    {
        BArriveDetailBB arriveDetailBB = new BArriveDetailBB();

        try
        {
            DataTable dt = new DataTable();

            dt = arriveDetailBB.GetVList("id=" + arriveDetailId.ToString()).Tables[0];
            return dt;
        }
        finally
        {
            arriveDetailBB.Dispose();
        }
    }
    /// <summary>
    /// 提交排托单
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnCommit_Click(object sender, EventArgs e)
    {
        BArriveDetailBB bb = new BArriveDetailBB();

        try
        {
            //获取选中的数据Id
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
                if (chkId.Checked == true)
                {
                    string strBillNo = "";
                    DataSet ds = new DataSet();

                    strBillNo = chkId.ValidationGroup;

                    if (bb.ModifyRecordSC(strBillNo))
                    {
                        this.BindGrid();//重新绑定到货单列表
                        return;
                    }
                    else
                    {
                        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"更改生产到货单状态失败!\");", true);
                        return;
                    }

                }

            }

            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"请选择一条记录!\");", true);
            return;
        }
        finally
        {
            bb.Dispose();

        }
    }
Пример #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.StrWhere = "1=1";
            string id= Request.QueryString["id"];

            BArriveDetailBB arriveDetailBB = new BArriveDetailBB();
            TSBarrivebillBB arriveBillBB = new TSBarrivebillBB();
            DataSet ds = new DataSet();

            try
            {
                TSBarrivebillData data = arriveBillBB.GetModel(Convert.ToInt32(id));
                this.IdValue =  data.arriveBillNo;
                this.StrWhere = " arriveBillNo='" + data.arriveBillNo + "'";
                txtBillNo.Text = data.arriveBillNo;
                this.DtDetail = arriveDetailBB.GetTSVList(this.StrWhere).Tables[0];
            }
            finally
            {
                arriveDetailBB.Dispose();
            }

            this.BindGrid();
        }

        InitPageData();
    }