コード例 #1
0
        /// <summary>
        /// 呼叫车辆
        /// </summary>
        /// <param name="carName">被呼叫的车辆名称</param>
        /// <param name="queuIds">当前车辆的排队号</param>
        private void queueCar(string carName, int sortid)
        {
            try
            {
                //获取车辆排队号
                //根据排队号修改排队信息表中,当前通行状态(待通行),初始为排队中,进行信息校验时,将状态修改为通行中,通行完成,修改为已通行
                //根据门岗编号和通道编号获取车辆类型,显示通过该通道的所有的车辆类型,界面选择通行的车辆类型,开始通行。
                //获取车辆排队号
                string sortNumber = this.lvwUserList.SelectedRows[0].Cells[3].Value.ToString();
                //为管控所需参数赋值
                EMEWE.CarManagement.Commons.CommonClass.CheckProperties.CommonEntity comme = new EMEWE.CarManagement.Commons.CommonClass.CheckProperties.CommonEntity();

                comme.CarTypeKey   = _Driveway.ToString();
                CheckProperties.ce = comme;


                string Queue_State = this.lvwUserList.SelectedRows[0].Cells["Queue_State"].Value.ToString();
                string strsql      = " SortNumberInfo_TongXing ='待通行',SortNumberInfo_CallCount +=1,SortNumberInfo_Number='是'";

                if (Queue_State == "排队中")
                {
                    strsql += ",SortNumberInfo_CallTime ='" + CommonalityEntity.GetServersTime() + "'";
                }
                strsql = "update SortNumberInfo set " + strsql + " where SortNumberInfo_ID=" + sortid;
                LinQBaseDao.Query(strsql);

                if (Queue_State == "排队中")
                {
                    string Queue_Cartype = this.lvwUserList.SelectedRows[0].Cells["Queue_Id"].Value.ToString();
                    if (!string.IsNullOrEmpty(Queue_Cartype))
                    {
                        insertNoteRecord(Queue_Cartype);
                    }
                }
                //得到呼叫的内容
                GetData();
            }
            catch (Exception err)
            {
            }
        }
コード例 #2
0
        /// <summary>
        /// 校验登记
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnChkSAP_Click(object sender, EventArgs e)
        {
            try
            {
                CommonalityEntity.IsUpdatedri        = false;
                CheckProperties.ce.SapSangFeiTable   = null;
                CheckProperties.ce.SapSongHuoTable   = null;
                CheckProperties.ce.SapChengPinTable  = null;
                CheckProperties.ce.SapSangFeiTable2  = null;
                CheckProperties.ce.SapSongHuoTable2  = null;
                CheckProperties.ce.SapChengPinTable2 = null;

                if (comboxCarType.Text.Trim() == "")
                {
                    MessageBox.Show("车辆类型不能为空!");
                    return;
                }
                if (txtNumber.Text.Trim() == "")
                {
                    MessageBox.Show(lblNumber.Text.ToString());
                    return;
                }
                CheckMethod.listMessage.Clear();
                //给需要执行的管控赋值
                EMEWE.CarManagement.Commons.CommonClass.CheckProperties.CommonEntity comm = new EMEWE.CarManagement.Commons.CommonClass.CheckProperties.CommonEntity();
                if (comboxCarType.Text == "送货车辆")
                {
                    comm.SongHuoNumber = txtNumber.Text.Trim();
                }
                else if (comboxCarType.Text == "成品车辆")
                {
                    comm.ChengPinNumber = txtNumber.Text.Trim();
                }
                else if (comboxCarType.Text == "三废车辆")
                {
                    comm.SangFeiNumber = txtNumber.Text.Trim();
                }
                comm.CarType_Name  = comboxCarType.Text.Trim();
                CheckProperties.ce = comm;
                //执行管控
                if (comboxCarType.Text == "送货车辆")
                {
                    CheckMethod.ChkSongHuo();
                    CheckMethod.ChkSongHuoFour();
                }
                else if (comboxCarType.Text == "成品车辆")
                {
                    CheckMethod.ChkChengPin();
                }
                else if (comboxCarType.Text == "三废车辆")
                {
                    CheckMethod.ChkSanFei();
                }
                //执行结果
                if (CheckMethod.listMessage.Count > 0)
                {
                    string strmessage = "";
                    foreach (var item in CheckMethod.listMessage)
                    {
                        strmessage += item;
                    }
                    MessageBox.Show(this, strmessage);;
                    return;
                }
                bool istru = false;
                if (CheckProperties.ce.SapSangFeiTable != null)
                {
                    lvwUserList.DataSource = CheckProperties.ce.SapSangFeiTable;
                    if (CheckProperties.ce.SapSangFeiTable2.Rows[0][0].ToString() == "S" && CheckProperties.ce.SapSangFeiTable.Rows.Count == 1)
                    {
                        istru = CommonalityEntity.AddSAPVBELNInfo(this.lvwUserList.SelectedRows[0].Cells["VBELN"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["NAME1_C"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["MAKTX"].Value.ToString(), 0, CheckProperties.ce.SapSangFeiTable2);
                    }
                }
                if (CheckProperties.ce.SapSongHuoTable != null)
                {
                    lvwUserList.DataSource = CheckProperties.ce.SapSongHuoTable;
                    if (CheckProperties.ce.SapSongHuoTable2.Rows[0][0].ToString() == "S" && CheckProperties.ce.SapSongHuoTable.Rows.Count == 1)
                    {
                        istru = CommonalityEntity.AddPOInfo(this.lvwUserList.SelectedRows[0].Cells["EBELN"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["NAME1_P"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["MAKTX"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["KDATB"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["KDATE"].Value.ToString(), 0, CheckProperties.ce.SapSongHuoTable2);
                    }
                }
                if (CheckProperties.ce.SapChengPinTable != null)
                {
                    lvwUserList.DataSource = CheckProperties.ce.SapChengPinTable;
                    if (CheckProperties.ce.SapChengPinTable2.Rows[0][0].ToString() == "S" && CheckProperties.ce.SapChengPinTable.Rows.Count == 1)
                    {
                        string carName = this.lvwUserList.SelectedRows[0].Cells["CARNO"].Value.ToString();
                        string wtdid   = this.lvwUserList.SelectedRows[0].Cells["WTD_ID"].Value.ToString();
                        if (IsSapNo(carName, wtdid))
                        {
                            MessageBox.Show(this, "该车辆的订单号业务已完成,不能重复登记!");
                            return;
                        }
                        if (this.lvwUserList.SelectedRows[0].Cells["O_FLAG"].Value.ToString() != "X")
                        {
                            MessageBox.Show("没有装货通知单,不能登记!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
                            return;
                        }
                        istru = CommonalityEntity.AddWTDIDInfo(this.lvwUserList.SelectedRows[0].Cells["CARNO"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["WTD_ID"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["O_FLAG"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["TEL_NUMBER"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["HG"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["XZ"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["KDATB"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["KDATE"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["NAME1_C"].Value.ToString(), this.lvwUserList.SelectedRows[0].Cells["NAME1_P"].Value.ToString(), 0, this.lvwUserList.SelectedRows[0].Cells["Prodh"].Value.ToString(), CheckProperties.ce.SapChengPinTable2);
                    }
                }
                if (istru)
                {
                    istru = false;
                    CommonalityEntity.ISsap = true;
                    CarInfoForm cif = new CarInfoForm();
                    cif.Show();
                    this.Close();
                }
            }
            catch
            {
                CommonalityEntity.WriteTextLog("SAPCarInfoForm btnChkSAP_Click()");
            }
        }