Exemple #1
0
        private bool ReadMoDetails()
        {
            if (cbxMoDetails.DataSource == null || cbxMoDetails.Items.Count < 1 || string.IsNullOrEmpty(cbxMoDetails.SelectedValue.ToString()))
            {
                return(false);
            }
            string strMoDID = cbxMoDetails.SelectedValue.ToString();

            if (tempSIO != null && tempSIO.U8Details != null && tempSIO.U8Details.Count > 0)
            {
                StockInDetail sdl;
                sdl = tempSIO.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.Nquantity > 0 && sdd.cMoDetailsID == strMoDID); });
                if (sdl != null)
                {
                    return(true);
                }
            }
            tempSDL = null;
            tempSDL = StockInBusiness.GetOMMOBody(strMoDID);
            if (tempSDL == null || tempSDL.Count < 1)
            {
                return(false);
            }
            tempSIO.U8Details.Concat(tempSDL);

            return(true);
        }
Exemple #2
0
        private bool verifyArrive(string cCode)
        {
            cCode = cCode.ToUpper();
            try
            {
                DataSet ds;
                tempSIO = StockInBusiness.GetOMMOHead(cCode, out MODetails, out ds);
                if (MODetails == null || MODetails.Count < 1)
                {
                    return(false);
                }

                if (string.IsNullOrEmpty(tempSIO.Whcode))
                {
                    MessageBox.Show("对不起,该单据尚未指明入库仓库!");
                    return(false);
                }
                Warehouse stock = null;
                stock = Common.s_Warehouse.Find(delegate(Warehouse wh) { return(wh.cwhcode.Trim() == tempSIO.Whcode.Trim()); });
                if (stock == null)
                {
                    MessageBox.Show("对不起,您没有该单据仓库的操作权限!");
                    return(false);
                }

                if (string.IsNullOrEmpty(tempSIO.Whname))
                {
                    tempSIO.Whname = stock.cwhname;
                    tempSIO.WhPos  = stock.bwhpos == 1 ? true : false;
                }

                tempSIO.U8Details = StockInBusiness.GetOMMOBody(MODetails[0].MoDetailsID);
                //Clear();
                return(true);
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message);
                Init();
                return(false);
            }
        }