protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.Params["functionNo"] != null && Request.Params["functionNo"].Trim() != "")
            {
                this.FunctionNo = Request.Params["functionNo"];
            }
        }

        if (this.SET_SQL.Value != "")
        {
            this.SET_SQL.Value = this.SET_SQL.Value.Substring(0, this.SET_SQL.Value.Length - 1);
            SCommBB commBB = new SCommBB();
            try
            {
                string[] updateSqls = this.SET_SQL.Value.Split(';');
                foreach (string updateSql in updateSqls)
                {
                    commBB.ExecuteSql(updateSql);
                }
            }
            finally
            {
                commBB.Dispose();
            }
            this.SET_SQL.Value = "";
        }

        this.ShowPullInfo(this.FunctionNo);
    }
    /// <summary>
    /// 获取SAP数据
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnData_Click(object sender, EventArgs e)
    {
        SCommBB commBB = new SCommBB();

        try
        {
            //获取SAP到货单、销售订单
            commBB.ExecuteSql("exec up_SAP_GetNewData");

            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('同步SAP到货\\拣货数据成功!');", true);
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            commBB.Dispose();
        }
    }
    /// <summary>
    /// 修改关联的托盘号
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnChangeBox_Click(object sender, EventArgs e)
    {
        if (txtBoxNo.Text.ToString() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"箱号不能为空!\");", true);
            return;
        }
        if (txtPalletNewNo.Text.ToString()=="")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"托盘号不能为空!\");", true);
            return;
        }
        if (txtBoxNo.Text.ToString().ToUpper().Substring(0, 1) != "X" || txtPalletNewNo.Text.ToString().ToUpper().Substring(0,1)!="T")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"箱号或是托盘号不正确!\");", true);
            return;
        }

        SCommBB comm = new SCommBB();
        try
        {
            comm.ExecuteSql("Update BarrangeBillBox set PalletNo = '" + txtPalletNewNo.Text.Trim().ToUpper() + "' where boxNo = '" + txtBoxNo.Text.Trim().ToUpper() + "'");

            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"更新托盘号成功 箱号 " + txtBoxNo.Text.Trim().ToUpper() + " 更新后的托盘是" + txtPalletNewNo.Text.Trim().ToUpper() + "!\");", true);

        }
        catch (Exception ee)
        {

            this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"更新托盘号失败 " + ee.Message + "!\");", true);

        }
        finally
        {
            txtBoxNo.Text = "";
            txtPalletNewNo.Text = "";
            comm.Dispose();

        }
    }
Beispiel #4
0
    public bool UpdateLBoxNo(int BoxQty, string MaterialNo)
    {
        SCommBB commBB = new SCommBB();
        bool ret = false;
        string command = @"update LMaterial set U_BoxQty =" + BoxQty + " where materialNo ='" + MaterialNo + "'";
        try
        {
            commBB.ExecuteSql(command);
            ret = true;
        }
        catch
        {
            ret = false;
        }

        finally
        {
            commBB.Dispose();

        }
        return ret;
    }
Beispiel #5
0
 public bool UpdateTHBill(string backBillNo)
 {
     bool ret = false;
     string command = "Update BBackBill set instantState = '05' where backBillNo ='" + backBillNo + "' ";
     SCommBB commBB = new SCommBB();
     try
     {
         commBB.ExecuteSql(command);
         ret = true;
     }
     catch
     {
         ret = false;
     }
     commBB.Dispose();
     return ret;
 }
    protected void Button2_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow gvrow in this.grid.Rows)
        {
              CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
              if (chkId.Checked == true)
              {

                  //string str = "update BArriveBill  set instantState='06' where id ='" + this.grid.DataKeys[gvrow.RowIndex]["chkId"].ToString() + "'";

                 // this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"" + this.grid.DataKeys[gvrow.RowIndex]["id"].ToString() + "\");", true);

                  string str = "update BArriveBill  set instantState='06' where id ='" + this.grid.DataKeys[gvrow.RowIndex]["id"].ToString() + "'";

                  SCommBB commBB = new SCommBB();
                  commBB.ExecuteSql(str);

              }

        }
        this.BindGrid();
    }
Beispiel #7
0
    public string SAPConverMaterialOutInStock(string strStockUpBillNo, string MarkText)
    {
        SapOnlineService.SapOnlineService sapService = new SapOnlineService.SapOnlineService();
        CSaleDetailBB saleDetailBB = new CSaleDetailBB();
        SCommBB commBB = new SCommBB();

        try
        {
            SapOnlineService.WebFaHuoModel2[] faHuoList = null;
            SapOnlineService.WebShouHuoModel2[] shouHuoList = null;
            SapOnlineService.IGE1_Return IGEReturn = null;
            SapOnlineService.IGN1_Return IGNReturn = null;
            SapOnlineService.IGE1[] IGEArray = null;
            StringBuilder struFaHuo = new StringBuilder();
            StringBuilder struShouHuo = new StringBuilder();
            DataTable dtPickOutPlan = new DataTable();
            string strResult = "", strError = "";

            //获取所有需要收发货的拣货计划
            dtPickOutPlan = commBB.Query("exec Proc_GetSAPKCSFH '" + strStockUpBillNo + "'").Tables[0];
            if (dtPickOutPlan.Rows.Count == 0)
            {
                strResult = "0&当前拣货单没有需要收发货物料!";
                return strResult;
            }

            #region 库存发货

            foreach (DataRow rowPickOutPlan in dtPickOutPlan.Rows)
            {
                double num = 0;
                string strAbsEntry = "", strDocEntry = "", strMaterialNo_FH = "", strMaterialNo_SH = "";

                strAbsEntry = rowPickOutPlan["absEntry"].ToString();//提货单ID
                strDocEntry = rowPickOutPlan["docEntry"].ToString();//销售订单ID
                strMaterialNo_FH = rowPickOutPlan["materialNo_FH"].ToString();//库存发货物料
                strMaterialNo_SH = rowPickOutPlan["materialNo_SH"].ToString();//库存收货物料
                num = Convert.ToDouble(rowPickOutPlan["num"]);//剩余未SAP库存收发货数量

                //库存发货
                if (Convert.ToBoolean(rowPickOutPlan["isSAPOutStock"]) == false)
                {
                    struFaHuo.Append(strMaterialNo_FH + "," + num + ",01,"
                        + strDocEntry + "," + strAbsEntry + ","
                        + strMaterialNo_SH + ",GHBZ-WMS;");
                }
            }

            if (struFaHuo.ToString() != "")
            {
                string[] array_FaHuo = struFaHuo.ToString().Trim(';').Split(';');

                faHuoList = new SapOnlineService.WebFaHuoModel2[array_FaHuo.Length];

                //发货
                for (int i = 0; i < array_FaHuo.Length; i++)
                {
                    string[] array_FaHuoDetail = array_FaHuo[i].Split(',');
                    SapOnlineService.WebFaHuoModel2 faHuo = new SapOnlineService.WebFaHuoModel2();

                    faHuo.ItemCode = array_FaHuoDetail[0];//ItemCode
                    faHuo.Quantity = Convert.ToDouble(array_FaHuoDetail[1]);//Quantity
                    faHuo.WhsCode = array_FaHuoDetail[2];//WhsCode
                    faHuo.U_ORDR = array_FaHuoDetail[3];//U_ORDR
                    faHuo.U_PKL = array_FaHuoDetail[4];//U_PKL
                    faHuo.U_ItemCode = array_FaHuoDetail[5];//U_ItemCode
                    faHuo.U_YongT = "GHBZ-WMS";//U_YongT

                    faHuoList[i] = faHuo;
                }

                //库存发货
                IGEReturn = sapService.IGE1_Web_Add_ForCangKu(System.DateTime.Now, "由WMS提交-" + MarkText, faHuoList);

                strResult = IGEReturn.ResultSucess;
                strError = IGEReturn.ErrMesg;

                if (strResult == "1")
                {
                    IGEArray = IGEReturn.ListIGE1;

                    for (int i = 0; i < IGEArray.Length; i++)
                    {
                        //更改发货状态
                        commBB.ExecuteSql("update dbo.CPickOutPlan set isSAPOutStock=1,sapStockPrice=" + IGEArray[i].StockPrice
                            + " where absEntry='" + IGEArray[i].U_PKL + "' and docEntry='" + IGEArray[i].U_ORDR
                            + "' and materialNo='" + IGEArray[i].ItemCode + "'");
                    }
                }
                else
                {
                    return "0&" + strError;
                }
            }

            #endregion 库存发货

            #region 库存收货

            //获取所有需要收货的拣货计划
            dtPickOutPlan = commBB.Query("exec Proc_GetSAPKCSFH '" + strStockUpBillNo + "'").Tables[0];

            foreach (DataRow rowPickOutPlan in dtPickOutPlan.Rows)
            {
                double num = 0, price = 0;
                string strAbsEntry = "", strDocEntry = "", strMaterialNo_FH = "", strMaterialNo_SH = "";

                strAbsEntry = rowPickOutPlan["absEntry"].ToString();//提货单ID
                strDocEntry = rowPickOutPlan["docEntry"].ToString();//销售订单ID
                strMaterialNo_FH = rowPickOutPlan["materialNo_FH"].ToString();//库存发货物料
                strMaterialNo_SH = rowPickOutPlan["materialNo_SH"].ToString();//库存收货物料
                num = Convert.ToDouble(rowPickOutPlan["num"]);//剩余未SAP库存收发货数量
                price = Convert.ToDouble(rowPickOutPlan["sapStockPrice"]);//价格

                //库存收货
                if (Convert.ToBoolean(rowPickOutPlan["isSAPInStock"]) == false)
                {
                    struShouHuo.Append(strMaterialNo_SH + "," + num + ",01,"
                        + strDocEntry + "," + strAbsEntry + ","
                        + strMaterialNo_FH + ",GHBZ-WMS," + price.ToString() + ";");
                }
            }

            //组织库存收发货数据
            if (struShouHuo.ToString() != "")
            {
                string[] array_ShouHuo = struShouHuo.ToString().Trim(';').Split(';');

                shouHuoList = new SapOnlineService.WebShouHuoModel2[array_ShouHuo.Length];

                //收货
                for (int i = 0; i < array_ShouHuo.Length; i++)
                {
                    string[] array_ShouHuoDetail = array_ShouHuo[i].Split(',');
                    SapOnlineService.WebShouHuoModel2 shouHuo = new SapOnlineService.WebShouHuoModel2();

                    shouHuo.ItemCode = array_ShouHuoDetail[0];//ItemCode
                    shouHuo.Quantity = Convert.ToDouble(array_ShouHuoDetail[1]);//Quantity
                    shouHuo.WhsCode = array_ShouHuoDetail[2];//WhsCode
                    shouHuo.U_ORDR = array_ShouHuoDetail[3];//U_ORDR
                    shouHuo.U_PKL = array_ShouHuoDetail[4];//U_PKL
                    shouHuo.U_ItemCode = array_ShouHuoDetail[5];//U_ItemCode
                    shouHuo.U_YongT = "GHBZ-WMS";//U_YongT
                    shouHuo.Price = Convert.ToDouble(array_ShouHuoDetail[7]);//Price

                    shouHuoList[i] = shouHuo;
                }

                //库存收货
                IGNReturn = sapService.IGN1_Web_Add_ForCangKu(System.DateTime.Now, "由WMS提交-库存收货", shouHuoList);

                strResult = IGNReturn.ResultSucess;
                strError = IGNReturn.ErrMesg;

                //更改收货状态
                if (IGNReturn.ResultSucess == "1")
                {
                    foreach (SapOnlineService.WebShouHuoModel2 shouHuo in shouHuoList)
                    {
                        commBB.ExecuteSql("update dbo.CPickOutPlan set isSAPInStock=1 where absEntry='" + shouHuo.U_PKL
                            + "' and docEntry='" + shouHuo.U_ORDR + "' and materialNo='" + shouHuo.U_ItemCode + "'");
                    }
                }
                else
                {
                    return "0&" + strError;
                }
            }

            #endregion 库存收货

            return strResult;
        }
        finally
        {
            sapService.Dispose();
            saleDetailBB.Dispose();
            commBB.Dispose();
        }
    }
    /// <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>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        SCommBB commBB = new SCommBB();

        try
        {
            GridViewRow gvRow = (e.CommandSource as LinkButton).NamingContainer as GridViewRow;
            string strArriveBillNo, strPalletIndex = "";

            strArriveBillNo = this.GridView1.DataKeys[gvRow.RowIndex]["arriveBillNo"].ToString();//到货单号
            strPalletIndex = this.GridView1.DataKeys[gvRow.RowIndex]["palletIndex"].ToString();//托盘序号

            #region 重新排托

            if (e.CommandName == "arrange")
            {
                //更改排托收货单状态为“01 收货中”
                commBB.ExecuteSql("update dbo.BArrangeBillFact set instantState='01' where arriveBillNo='"
                    + strArriveBillNo + "' and palletIndex='" + strPalletIndex + "'");

                //更改排托单明细状态为“02 排托中”
                commBB.ExecuteSql("update dbo.BArrangeBillDetail set instantState='02' where arriveBillNo='"
                    + strArriveBillNo + "' and palletIndex='" + strPalletIndex + "'");

                //更改排托单状态为“03 排托中”
                commBB.ExecuteSql("update dbo.BArrangeBill set instantState='03' where arriveBillNo='" + strArriveBillNo + "'");

                //更改到货单状态为“04 排托中”
                commBB.ExecuteSql("update dbo.BArriveBill set instantState='04' where billNo='" + strArriveBillNo + "'");

                return;
            }

            #endregion 重新排托
        }
        finally
        {
            commBB.Dispose();
        }
    }
Beispiel #10
0
 public void updateBForkliftTask(string palletNo)
 {
     string str = "update BForkliftTask set isDeal='1' where palletNo ='" + palletNo + "'and isDeal='0'";
     SCommBB commBB = new SCommBB();
     commBB.ExecuteSql(str);
     commBB.Dispose();
 }
    /// <summary>
    /// 确认发货
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnConfirmSend_Click(object sender, EventArgs e)
    {
        bool isChecked = false;

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

            if (chkId.Checked == true)
            {
                isChecked = true;

                string id = this.grid.DataKeys[gvrow.RowIndex].Values["id"].ToString();
                string stockUpbillNo = this.grid.DataKeys[gvrow.RowIndex].Values["stockUpBillNo"].ToString();

                this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"选择的备货单号是" + stockUpbillNo + "!\");", true);
                string command = "select distinct palletNo,wareNo,wareLocatorNo from BArrangeBillBox where stockUpBillNo = '" + stockUpbillNo + "' and isnull(palletNo,'')<>''";//获取订单下的托盘号码 2015-06-25增加限制条件 排除生成空托盘的时候的bug
                SCommBB bb = new SCommBB();
                DataTable dt = bb.Query(command).Tables[0];
                bb.Dispose();
                BForkliftTaskBC bforkTaskBC = new BForkliftTaskBC();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    bforkTaskBC.SaveForkliftTask(dt.Rows[i][0].ToString(), "CKQ", "CKQ01", "20", this.currentUser.empId);
                }

                SCommBB commBB = new SCommBB();
                string strSql = "update dbo.CStockUpDetail set instantState='04' where stockUpBillNO='" + stockUpbillNo + "'";
                commBB.ExecuteSql(strSql);

                //将备货单属性改为09出库中
                strSql = @"update dbo.CStockUpBill set instantState='09'  where stockUpBillNo = '" + stockUpbillNo + "'";
                commBB.ExecuteSql(strSql);
                //实时获取订单状态
                //using (CStockUpBillBB billBB = new CStockUpBillBB())
                //{
                //    CStockUpBillData data = billBB.GetModel(Convert.ToInt32(id));

                //    data.instantState = "11";//状态更改为“确认发货”

                //    billBB.ModifyRecord(data);
                //}
            }
        }

        if (isChecked)
        {
            this.BindGrid();
            return;
        }

        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"请选择一条记录!\");", true);
        return;
    }
Beispiel #12
0
 public bool UpdateBarrangeBillBox(string boxNO, string palletNo)
 {
     SCommBB commBB = new SCommBB();
     try
     {
         commBB.ExecuteSql("Update BarrangeBillBox set palletNo = '" + palletNo + "' where boxNo = '" + boxNO + "'");
         return true;
     }
     catch
     {
         return false;
     }
     finally
     {
         commBB.Dispose();
     }
 }
Beispiel #13
0
    public void updateBArrangeBillDetail(string financeBillNo, string arriveBillNo, string palletIndex)
    {
        string sql = "update BArrangeBillDetail set instantState='05' where financeBillNo='" + financeBillNo + "' AND arriveBillNo ='" + arriveBillNo + "' and palletIndex='" + palletIndex + "'";

        SCommBB commBB = new SCommBB();
        commBB.ExecuteSql(sql);
        commBB.Dispose();
    }
Beispiel #14
0
    public void SaveTSArriveBox(int arriveDetailId, string strArriveBillNo, string strFinanceBillNo, string strMaterialNo,
        string strBoxNo, string strPalletNo, int factNum, int isrtEmpId, string strWareLocatorNo)
    {
        TSBarriveDetailBB arriveDetailBB = new TSBarriveDetailBB();
        BArrangeBillBoxBB arrangeBillBoxBB = new BArrangeBillBoxBB();
        SCommBB commBB = new SCommBB();

        try
        {
            TSBarriveDetailData arriveDetailModel = new TSBarriveDetailData();
            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();
        }
    }
Beispiel #15
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();
        }
    }
Beispiel #16
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();
        }
    }
Beispiel #17
0
    public bool InsertBoxNameInfo(string FinanceBillNo, string ArriveBillNo, string MaterialNo, string BoxQty, string materialNm_CH, string InsertEmpId)
    {
        //insert into InsertBoxQty(FinanceBillNo,ArriveBillNo,MaterialNo,BoxQty,materialNm_CH,InsertEmpId,InsertDt)
        //VALUES('123','22','DDD','100',‘#20A内盒’,'1',GETDATE())

        string command = "insert into InsertBoxQty(FinanceBillNo,ArriveBillNo,MaterialNo,BoxQty,materialNm_CH,InsertEmpId,InsertDt) VALUES('" + FinanceBillNo + "','" + ArriveBillNo + "','" + MaterialNo + "','" + BoxQty + "','" + materialNm_CH + "','" + InsertEmpId + "',GETDATE())";
        bool ret = false;
        SCommBB commBB = new SCommBB();
        try
        {
            commBB.ExecuteSql(command);
            ret = true;
        }
        catch
        {
            ret = false;
        }
        finally
        {

            commBB.Dispose();

        }
        return ret;
    }
Beispiel #18
0
 public bool UpdateBoxInfo(string BBbackBillNo)
 {
     bool ret = false;
     string command = @"Update BArrangeBillBox set wareLocatorNo = '',wareNo = '',preWareLocatorNo = 'N01.01',preWareNo = 'YCQ',oldPalletNo = palletNo,palletNo = ''  where boxNo in
     (select boxNo from BBackDetail where backBillNo = '" + BBbackBillNo + "')";
     SCommBB commBB = new SCommBB();
     try
     {
         commBB.ExecuteSql(command);
         ret = true;
     }
     catch
     {
         ret = false;
     }
     commBB.Dispose();
     return ret;
 }
    /// <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();

        }
    }
Beispiel #20
0
    public bool UpdateCheck(string checkNo)
    {
        SCommBB commBB = new SCommBB();
        bool ret = false;
        try
        {
            commBB.ExecuteSql(@"exec [dbo].[pro_UpdateCheck] '" + checkNo + "'");
            ret = true;
        }
        catch
        {
            ret = false;
        }
        finally
        {
            commBB.Dispose();

        }
        return ret;
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        PRolePermissionsData rolePermissionsData = new PRolePermissionsData();
        SCommBB commBB = new SCommBB();
        PRolePermissionsBB rolePermissionsBB = new PRolePermissionsBB();
        try
        {
            //删除当前角色所有权限
            rolePermissionsBB.DeleteRecordByRole(this.RoleId, 2);

            //保存权限
            string strPermissions = "";
            CheckBox checkBox = new CheckBox();
            foreach (DataListItem item in this.DataList1.Items)
            {
                //获取ItemoNo
                Label label = (Label)item.FindControl("itemNo");
                string itemNo = label.Text;
                if (itemNo.IndexOf('-') >= 0)
                {
                    itemNo = itemNo.Substring(itemNo.LastIndexOf('-') + 1);
                }

                foreach (System.Web.UI.Control control in item.Controls)
                {
                    if (control.GetType() == checkBox.GetType())
                    {
                        if (((CheckBox)control).Checked == true)
                        {
                            strPermissions += itemNo + "," + ((CheckBox)control).ToolTip + ",0|";
                        }
                    }
                }
            }
            //保存权限
            commBB.ExecuteSql("exec sys_BatchSavePermissions " + this.RoleId.ToString() + ",'" + strPermissions.Remove(strPermissions.Length - 1) + "'");
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            commBB.Dispose();
            rolePermissionsBB.Dispose();
        }

        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('保存成功!');", true);
    }
Beispiel #22
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();
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow gvrow in this.grid.Rows)
        {
              CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
              if (chkId.Checked == true)
              {

                  string str = "update BArriveBill  set instantState='06' where id ='" + this.grid.DataKeys[gvrow.RowIndex]["id"].ToString() + "'";

                  SCommBB commBB = new SCommBB();
                  commBB.ExecuteSql(str);

              }

        }
        this.BindGrid();
    }
    /// <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();
        }
    }
Beispiel #26
0
    public string GetSuggestWareLocator_ForkliftTask(int forkliftTaskId)
    {
        string strSuggestWareLocator = "";
        BForkliftTaskBB forkliftTaskBB = new BForkliftTaskBB();
        LWareLocatorBB wareLocatorBB = new LWareLocatorBB();
        SCommBB commBB = new SCommBB();
        LWareLocatorRelationBB wareLocatorRelation = new LWareLocatorRelationBB();

        try
        {
            vBForkliftTaskData vForkliftTaskModel = new vBForkliftTaskData();
            BForkliftTaskData forkliftTaskModel = new BForkliftTaskData();
            DataTable dtWareLocator = new DataTable();

            //获取叉车任务实例
            forkliftTaskModel = forkliftTaskBB.GetModel(forkliftTaskId);
            vForkliftTaskModel = forkliftTaskBB.GetVModel(forkliftTaskId);

            if (forkliftTaskModel.taskType == "01" || forkliftTaskModel.taskType == "04"
                || forkliftTaskModel.taskType == "10")
            {
                #region 01 从排托区到质检区、04 从理货区返回质检区、10 从收货区到质检区

                //获取没有使用的质检区的所有库位
                //2015-08-04 修改增加相应的对应关系 与表LwareLocator之间产生关系
                if (!string.IsNullOrEmpty(forkliftTaskModel.nextLocatorNo))//已有目的库位
                {
                    strSuggestWareLocator = vForkliftTaskModel.nextWareNo
                        + "," + vForkliftTaskModel.nextWareNm
                        + "," + vForkliftTaskModel.nextLocatorNo
                        + "," + vForkliftTaskModel.nextWareLocatorNm;
                }
                else//没有目的库位
                {
                    //只有原来的库区是在收货区的时候 才进行处理
                    //if (vForkliftTaskModel.preWareNo == "SHQ")
                    //{
                    //    //首先是查找出所有的可以进行入库的库位
                    //    DataTable dtNew = new DataTable();
                    //    if (vForkliftTaskModel.preLocatorNo.Contains("SH"))
                    //        dtNew = wareLocatorRelation.GetList("wareLocatorStartPrefix = 'SH' and isdel = 0").Tables[0];
                    //    else
                    //        dtNew = wareLocatorRelation.GetList("wareLocatorStartPrefix = 'S' and isdel = 0").Tables[0];
                    //    for (int i = 0; i < dtNew.Rows.Count; i++)
                    //    {
                    //      //2015-08-04 数据库实现后发现只能通过程序来进行实现
                    //        dtWareLocator = wareLocatorBB.GetVList("wareType='01' and isUsing=0 and isDel=0 and wareLocatorNo like '" + dtNew.Rows[i]["wareLocatorEndPrefix"] + "%'").Tables[0];
                    //        if(dtWareLocator.Rows.Count>0)
                    //        {
                    //            break;//如果大于0的话则进行退出操作
                    //        }

                    //    }
                    //       // dtWareLocator = wareLocatorBB.GetVList("wareType='01' and isUsing=0 and isDel=0").Tables[0];
                    //}
                    //else
                    //{
                    //首先要通过叉车能够获取获取托盘上此时有的信息
                    string palletNO = vForkliftTaskModel.palletNo;
                    DataTable dtPallet = GetBoxByPalletNo(palletNO);
                    string checkMaterial = "";
                    if (dtPallet != null)
                    {
                        if (dtPallet.Rows.Count > 0 && dtPallet.Rows[0]["materialNO"] != "")
                        {
                            checkMaterial = dtPallet.Rows[0]["materialNO"].ToString();
                        }

                    }

                    //dtWareLocator = wareLocatorBB.GetVList("wareType='01' and isUsing=0 and isDel=0").Tables[0];
                    dtWareLocator = wareLocatorBB.GetVListJoey(checkMaterial).Tables[0];
                    //}
                    if (dtWareLocator.Rows.Count > 0)
                    {
                        //获取推荐库位信息
                        strSuggestWareLocator = dtWareLocator.Rows[0]["wareNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareNm"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNm"].ToString();

                        //更改叉车任务的目的库位信息
                        forkliftTaskModel.nextWareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//目的库区
                        forkliftTaskModel.nextLocatorNo = dtWareLocator.Rows[0]["wareLocatorNo"].ToString();//目的库位

                        forkliftTaskBB.ModifyRecord(forkliftTaskModel);

                        //更改目的库位的使用状态
                        commBB.ExecuteSql("update dbo.LWareLocator set isUsing=1 where wareLocatorNo='"
                            + dtWareLocator.Rows[0]["wareLocatorNo"].ToString() + "'");
                    }
                }

                #endregion 01 从排托区到质检区、04 从理货区返回质检区、10 从收货区到质检区
            }
            else if (forkliftTaskModel.taskType == "08" || forkliftTaskModel.taskType == "02"
                || forkliftTaskModel.taskType == "03" || forkliftTaskModel.taskType == "05"
                || forkliftTaskModel.taskType == "06" || forkliftTaskModel.taskType == "11"
                || forkliftTaskModel.taskType == "12")
            {
                #region 08 从收货区到收货排托区,02 从质检区到理货区,03 从理货区到正式库区,05 从正式库区到拣货区,06 从拣货区返回正式库区,11 从质检区到正式区,12 托盘移库

                strSuggestWareLocator = vForkliftTaskModel.nextWareNo
                    + "," + vForkliftTaskModel.nextWareNm
                    + "," + vForkliftTaskModel.nextLocatorNo
                    + "," + vForkliftTaskModel.nextWareLocatorNm;

                #endregion 08 从收货区到收货排托区,02 从质检区到理货区,03 从理货区到正式库区,05 从正式库区到拣货区,06 从拣货区返回正式库区,11 从质检区到正式区,12 托盘移库
            }
            else if (forkliftTaskModel.taskType == "07")
            {
                #region 07 拣货区发货

                strSuggestWareLocator = ",发货区,,发货区";

                #endregion 07 拣货区发货
            }
            else if (forkliftTaskModel.taskType == "09")
            {
                #region 09 从收货排托区返回收货区

                if (!string.IsNullOrEmpty(forkliftTaskModel.nextLocatorNo))//已有目的库位
                {
                    strSuggestWareLocator = vForkliftTaskModel.nextWareNo
                        + "," + vForkliftTaskModel.nextWareNm
                        + "," + vForkliftTaskModel.nextLocatorNo
                        + "," + vForkliftTaskModel.nextWareLocatorNm;
                }
                else
                {
                    //获取收货区的所有库位
                    dtWareLocator = wareLocatorBB.GetVList("wareType='05' and isUsing=0").Tables[0];

                    if (dtWareLocator.Rows.Count > 0)
                    {
                        strSuggestWareLocator = dtWareLocator.Rows[0]["wareNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareNm"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNm"].ToString();

                        //更改叉车任务的目的库位信息
                        forkliftTaskModel.nextWareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//目的库区
                        forkliftTaskModel.nextLocatorNo = dtWareLocator.Rows[0]["wareLocatorNo"].ToString();//目的库位

                        forkliftTaskBB.ModifyRecord(forkliftTaskModel);

                        //更改目的库位的使用状态
                        commBB.ExecuteSql("update dbo.LWareLocator set isUsing=1 where wareLocatorNo='"
                            + dtWareLocator.Rows[0]["wareLocatorNo"].ToString() + "'");
                    }
                }

                #endregion 09 从收货排托区返回收货区
            }
            else if (forkliftTaskModel.taskType == "13" || forkliftTaskModel.taskType == "30")
            {
                #region 13 从理货区到异常区

                //获取没有使用的异常区的所有库位
                //if (!string.IsNullOrEmpty(forkliftTaskModel.nextLocatorNo))//已有目的库位
                //{
                //    strSuggestWareLocator = vForkliftTaskModel.nextWareNo
                //    + "," + vForkliftTaskModel.nextWareNm
                //    + "," + vForkliftTaskModel.nextLocatorNo
                //    + "," + vForkliftTaskModel.nextWareLocatorNm;
                //}
                //else
                //{
                //}

                //dtWareLocator = wareLocatorBB.GetVList("wareType='09' and isUsing=0 and isDel=0").Tables[0];
                dtWareLocator = wareLocatorBB.GetVList("wareType='09' and isDel=0").Tables[0];//临时不限制是否正在使用
                if (dtWareLocator.Rows.Count > 0)
                {
                    //获取推荐库位信息
                    strSuggestWareLocator = dtWareLocator.Rows[0]["wareNo"].ToString()
                        + "," + dtWareLocator.Rows[0]["wareNm"].ToString()
                        + "," + dtWareLocator.Rows[0]["wareLocatorNo"].ToString()
                        + "," + dtWareLocator.Rows[0]["wareLocatorNm"].ToString();

                    //更改叉车任务的目的库位信息
                    forkliftTaskModel.nextWareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//目的库区
                    forkliftTaskModel.nextLocatorNo = dtWareLocator.Rows[0]["wareLocatorNo"].ToString();//目的库位
                    forkliftTaskBB.ModifyRecord(forkliftTaskModel);

                    ////更改目的库位的使用状态
                    //commBB.ExecuteSql("update dbo.LWareLocator set isUsing=1 where wareLocatorNo='"
                    //    + dtWareLocator.Rows[0]["wareLocatorNo"].ToString() + "'");
                }

                #endregion 13 从理货区到异常区
            }
            else if (forkliftTaskModel.taskType == "14")
            {
                #region 14 从拣货区到打托区

                if (!string.IsNullOrEmpty(forkliftTaskModel.nextLocatorNo))//已有目的库位
                {
                    strSuggestWareLocator = vForkliftTaskModel.nextWareNo
                        + "," + vForkliftTaskModel.nextWareNm
                        + "," + vForkliftTaskModel.nextLocatorNo
                        + "," + vForkliftTaskModel.nextWareLocatorNm;
                }
                else
                {
                    //获取打托区的所有库位
                    dtWareLocator = wareLocatorBB.GetVList("wareType='10' and isUsing=0 and isDel=0").Tables[0];

                    if (dtWareLocator.Rows.Count > 0)
                    {
                        strSuggestWareLocator = dtWareLocator.Rows[0]["wareNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareNm"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNm"].ToString();

                        //更改叉车任务的目的库位信息
                        forkliftTaskModel.nextWareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//目的库区
                        forkliftTaskModel.nextLocatorNo = dtWareLocator.Rows[0]["wareLocatorNo"].ToString();//目的库位

                        forkliftTaskBB.ModifyRecord(forkliftTaskModel);

                        //更改目的库位的使用状态
                        //日期 2014-07-22 将打托区占用取消掉 打托区当中可以有多个被占用
                        //commBB.ExecuteSql("update dbo.LWareLocator set isUsing=1 where wareLocatorNo='"
                        //    + dtWareLocator.Rows[0]["wareLocatorNo"].ToString() + "'");
                    }
                }

                #endregion 14 从拣货区到打托区
            }
            else if (forkliftTaskModel.taskType == "15")
            {
                #region 15 从打托区到发货区

                if (!string.IsNullOrEmpty(forkliftTaskModel.nextLocatorNo))//已有目的库位
                {
                    strSuggestWareLocator = vForkliftTaskModel.nextWareNo
                        + "," + vForkliftTaskModel.nextWareNm
                        + "," + vForkliftTaskModel.nextLocatorNo
                        + "," + vForkliftTaskModel.nextWareLocatorNm;
                }
                else
                {
                    //获取发货区的所有库位
                    dtWareLocator = wareLocatorBB.GetVList("wareType='08' and isUsing=0 and isDel=0").Tables[0];

                    if (dtWareLocator.Rows.Count > 0)
                    {
                        strSuggestWareLocator = dtWareLocator.Rows[0]["wareNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareNm"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNm"].ToString();

                        //更改叉车任务的目的库位信息
                        forkliftTaskModel.nextWareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//目的库区
                        forkliftTaskModel.nextLocatorNo = dtWareLocator.Rows[0]["wareLocatorNo"].ToString();//目的库位

                        forkliftTaskBB.ModifyRecord(forkliftTaskModel);

                        //更改目的库位的使用状态
                        commBB.ExecuteSql("update dbo.LWareLocator set isUsing=1 where wareLocatorNo='"
                            + dtWareLocator.Rows[0]["wareLocatorNo"].ToString() + "'");
                    }
                }

                #endregion 15 从打托区到发货区
            }
            else if (forkliftTaskModel.taskType == "20")
            {
                #region 20的时候 正式出库

                if (!string.IsNullOrEmpty(forkliftTaskModel.nextLocatorNo))//已有目的库位
                {
                    strSuggestWareLocator = vForkliftTaskModel.nextWareNo
                        + "," + vForkliftTaskModel.nextWareNm
                        + "," + vForkliftTaskModel.nextLocatorNo
                        + "," + vForkliftTaskModel.nextWareLocatorNm;
                }
                else
                {
                    //获取发货区的所有库位
                    dtWareLocator = wareLocatorBB.GetVList("wareType='11' and isUsing=0 and isDel=0").Tables[0];

                    if (dtWareLocator.Rows.Count > 0)
                    {
                        strSuggestWareLocator = dtWareLocator.Rows[0]["wareNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareNm"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNo"].ToString()
                            + "," + dtWareLocator.Rows[0]["wareLocatorNm"].ToString();

                        //更改叉车任务的目的库位信息
                        forkliftTaskModel.nextWareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//目的库区
                        forkliftTaskModel.nextLocatorNo = dtWareLocator.Rows[0]["wareLocatorNo"].ToString();//目的库位

                        forkliftTaskBB.ModifyRecord(forkliftTaskModel);

                        //更改目的库位的使用状态
                        //commBB.ExecuteSql("update dbo.LWareLocator set isUsing=1 where wareLocatorNo='"
                        //    + dtWareLocator.Rows[0]["wareLocatorNo"].ToString() + "'");
                    }
                }

                #endregion 20 正式库区发货

            }
            else if (forkliftTaskModel.taskType == "30")
            {
                //2015-08-07进行修改
                #region 退货区生成叉车任务获取相应的库位
                dtWareLocator = wareLocatorBB.GetVList("wareType='09' and isUsing=0 and isDel=0 and wareNO = 'YCQ'").Tables[0];
                if (dtWareLocator.Rows.Count > 0)
                {
                    strSuggestWareLocator = dtWareLocator.Rows[0]["wareNo"].ToString()
                        + "," + dtWareLocator.Rows[0]["wareNm"].ToString()
                        + "," + dtWareLocator.Rows[0]["wareLocatorNo"].ToString()
                        + "," + dtWareLocator.Rows[0]["wareLocatorNm"].ToString();
                    //更改叉车任务的目的库位信息
                    forkliftTaskModel.nextWareNo = dtWareLocator.Rows[0]["wareNo"].ToString();//目的库区
                    forkliftTaskModel.nextLocatorNo = dtWareLocator.Rows[0]["wareLocatorNo"].ToString();//目的库位
                    forkliftTaskBB.ModifyRecord(forkliftTaskModel);
                #endregion

                }
            }

        }
        finally
        {
            forkliftTaskBB.Dispose();
            wareLocatorBB.Dispose();
            commBB.Dispose();
        }

        return strSuggestWareLocator;
    }
Beispiel #27
0
 public bool UpdateCheckBillState(string checkBillId)
 {
     SCommBB commBB = new SCommBB();
     try
     {
         commBB.ExecuteSql("Update BCheckBill set instantState = '04' where id = '" + checkBillId + "'");
         return true;
     }
     catch
     {
         return false;
     }
     finally
     {
         commBB.Dispose();
     }
 }
Beispiel #28
0
    public bool InsertSAPNOBoxNO(string FinanceBillNo, string ArriveBillNo, string MaterialNo, int BoxQty, int InsertEmpId)
    {
        SCommBB commBB = new SCommBB();
        bool ret = false;
        string command = @"insert into InsertBoxQty(FinanceBillNo,ArriveBillNo,MaterialNo,BoxQty,InsertEmpId,InsertDt)
        VALUES('" + FinanceBillNo + "','" + ArriveBillNo + "','" + MaterialNo + "'," + BoxQty + "," + InsertEmpId + ",GETDATE())";
        try
        {
            commBB.ExecuteSql(command);
            ret = true;
        }
        catch
        {
            ret = false;
        }

        finally
        {
            commBB.Dispose();

        }
        return ret;
    }
    /// <summary>
    /// 保存分配线体
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_GZT_Click(object sender, EventArgs e)
    {
        SCommBB commBB = new SCommBB();

        try
        {
            if (this.ddlWareLocator.SelectedValue == "")
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('请首先选择分配线体!');", true);
                return;
            }

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

                if (chkId.Checked == true)
                {
                    string strPalletIndex = this.gridStockUpDetail.DataKeys[gvrow.RowIndex].Values["palletIndex"].ToString();

                    commBB.ExecuteSql("update dbo.CStockUpDetail set GZT='" + this.ddlWareLocator.SelectedValue
                        + "' where stockUpBillNo='" + this.stockUpBillNo.Text.Trim() + "' and palletIndex='" + strPalletIndex + "'");
                }
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            commBB.Dispose();
        }
    }
Beispiel #30
0
    public bool UpdateCheckDetailMaterial(string checkNo, string wareLocatorNo,string material)
    {
        SCommBB commBB = new SCommBB();
        bool ret = false;
        try
        {
            commBB.ExecuteSql(@" exec  [pro_UpdateCheckDetailMaterial] '" + checkNo + "','" + wareLocatorNo + "','" + material+"'");
            ret = true;
        }
        catch
        {
            ret = false;
        }
        finally
        {
            commBB.Dispose();

        }
        return ret;
    }