Ejemplo n.º 1
0
        internal StationCode CodeGetTest([PexAssumeUnderTest] Station target)
        {
            StationCode result = target.Code;

            return(result);
            // TODO: add assertions to method StationTest.CodeGetTest(Station)
        }
Ejemplo n.º 2
0
        internal Station ConstructorTest(StationCode code)
        {
            Station target = new Station(code);

            return(target);
            // TODO: add assertions to method StationTest.ConstructorTest(StationCode)
        }
Ejemplo n.º 3
0
        protected void cmbScode_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            //
            //string pline = txtPCode.Value.ToString();
            string sql2 = "select a.STATION_CODE,a.STATION_NAME from CODE_STATION a where a.pline_code=(select t.rmes_id from Code_Product_Line t WHERE t.pline_code='" + e.Parameter + "') order by a.STATION_NAME";

            StationCode.SelectCommand = sql2;
            StationCode.DataBind();
            txtSCode.DataBind();
        }
Ejemplo n.º 4
0
        protected void txtSCode_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            string sql2 = "";

            {
                sql2 = "   select STATION_CODE,STATION_NAME from vw_CODE_STATION where pline_code= '" + e.Parameter + "' order by STATION_NAME";
            }
            StationCode.SelectCommand = sql2;
            StationCode.DataBind();
            txtSCode.DataBind();
        }
Ejemplo n.º 5
0
        public IStation GetStation(StationCode code)
        {
            foreach (Station s in stations)
            {
                if (s.Code == code)
                {
                    return(s);
                }
            }

            return(null);
        }
Ejemplo n.º 6
0
    private void initCode()
    {
        //初始化生产线下拉列表
        string sql = "select distinct a.pline_code,b.pline_name from vw_user_role_program a left join code_product_line b on a.pline_code=b.pline_code where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "'";

        SqlCode.SelectCommand = sql;
        SqlCode.DataBind();
        //txtPCode.SelectedIndex = txtPCode.Items.Count >= 0 ? 0 : -1;
        string sql2 = "select STATION_CODE,STATION_NAME from CODE_STATION where pline_code in(select distinct a.pline_code,b.pline_name from vw_user_role_program a left join code_product_line b on a.pline_code=b.pline_code where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "') order by STATION_NAME";

        StationCode.SelectCommand = sql2;
        StationCode.DataBind();
    }
Ejemplo n.º 7
0
        public Form_FindData(GatherData pGatherData, StationCode pStationCode, GatherError pGatherError)
        {
            InitializeComponent();
            mGatherData   = pGatherData;
            mStationCode  = pStationCode;
            mGatherError  = pGatherError;
            mGetParaValue = new GetParaValue(pStationCode.Dictionary,
                                             pGatherData.Dictionary, pGatherError.Dictionary);

            this.labelTime.Text = DateTime.Now.ToString();
            InitData();
            Count++;
        }
        public byte[] WriteMsg2()
        {
            DateTime    dateNow  = DateTime.Now;
            List <byte> list     = new List <byte>();
            List <byte> BodyList = new List <byte>();

            BodyList.Add(ControlField);
            BodyList.AddRange(HexStringUtility.HexStringToByteArray(AddressField));
            BodyList.Add(StationType);
            BodyList.AddRange(HexStringUtility.HexStringToByteArray(StationCode.ToString("X").PadLeft(4, '0')));
            BodyList.Add(AFN);
            BodyList.AddRange(UserDataBytes);
            if (IsPW)
            {
                BodyList.AddRange(HexStringUtility.HexStringToByteArray(PW));
            }
            if (IsTP)
            {
                BodyList.AddRange(HexStringUtility.HexStringToByteArray(TP));
            }

            Length = BodyList.Count;

            CC = FormatHelper.GetXorByte(BodyList.ToArray(), 0, BodyList.ToArray().Length);

            list.Add(BeginChar);
            list.Add(FormatHelper.IntToByte(Length));
            //list.Add(BeginChar);
            byte bState = 0;

            if (IsPW)
            {
                bState += 1;
            }
            if (IsTP)
            {
                bState += 2;
            }
            list.Add(bState);
            list.AddRange(BodyList);
            list.Add(CC);
            list.Add(EndChar);

            return(list.ToArray());
        }
        private void PriceItClick(object sender, RoutedEventArgs e)
        {
            ButtonCopyNote.Content = "Copy";

            var pastedStationLines = StationCode.Split(Environment.NewLine);

            // Entry 5 (index 4) will hold the information how many crafts there are in this station.

            if (pastedStationLines.Length > 10 && Regex.IsMatch(pastedStationLines[4], "Crafts: (1|2|3)/3")) //a valid export of a stationcode
            {
                var craftCount = int.Parse(pastedStationLines[4].Replace("Crafts: ", "").Replace("/3", ""));

                // Entry 8 (Index 7) will hold the first craft.
                FirstCraft = new SavedCraft(SeedCraft.Find(MasterList, pastedStationLines[7]));
                //FirstCraft = new SavedCraft(pastedStationLines[7]);

                if (craftCount >= 2)
                {
                    SecondCraft = new SavedCraft(SeedCraft.Find(MasterList, pastedStationLines[8]));
                }
                else
                {
                    SecondCraft = new SavedCraft();
                }
                if (craftCount == 3)
                {
                    ThirdCraft = new SavedCraft(SeedCraft.Find(MasterList, pastedStationLines[9]));
                }
                else
                {
                    ThirdCraft = new SavedCraft();
                }

                Note = ConverterUtil.GetNoteForCrafts(new SavedCraft[] { FirstCraft, SecondCraft, ThirdCraft });

                OnPropertyChanged("FirstCraft");
                OnPropertyChanged("SecondCraft");
                OnPropertyChanged("ThirdCraft");
                OnPropertyChanged("Note");
            }
            else
            {
                MessageBox.Show("Invalid Station-Code. Please copy / paste again from ingame!");
            }
        }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        userManager theUserManager = (userManager)Session["theUserManager"];

        theCompanyCode = theUserManager.getCompanyCode();
        theUserId      = theUserManager.getUserId();
        theProgramCode = "rept1600";
        //MachineName = System.Net.Dns.GetHostName();
        string hostIPAddress = Page.Request.UserHostAddress;

        //IPHostEntry hostInfo = System.Net.Dns.GetHostByAddress(hostIPAddress);
        MachineName = hostIPAddress;
        string sql2 = "select STATION_CODE,STATION_NAME from CODE_STATION order by STATION_NAME";

        StationCode.SelectCommand = sql2;
        StationCode.DataBind();
        setCondition();
    }
Ejemplo n.º 11
0
    private void initCode()
    {
        //初始化生产线下拉列表
        string sql = "select distinct a.pline_code,b.pline_name,a.pline_id from vw_user_role_program a left join code_product_line b on a.pline_code=b.pline_code where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "'";

        SqlCode.SelectCommand = sql;
        SqlCode.DataBind();
        //txtPCode.SelectedIndex = txtPCode.Items.Count >= 0 ? 0 : -1;
        DataTable dt   = dc.GetTable(sql);
        string    sql2 = "";

        if (dt.Rows.Count > 0)
        {
            sql2 = "select STATION_CODE,STATION_NAME from CODE_STATION where pline_code ='" + dt.Rows[0][2].ToString() + "'order by STATION_NAME";
        }
        else
        {
            sql2 = "select STATION_CODE,STATION_NAME from CODE_STATION where pline_code in(select distinct a.pline_id from vw_user_role_program a  where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "') order by STATION_NAME";
        }
        StationCode.SelectCommand = sql2;
        StationCode.DataBind();
    }
Ejemplo n.º 12
0
        public string FindStationCode(List <StationCode> pStationCodes)
        {
            try
            {
                command            = new SqlCommand();
                command.Connection = con;
                //command.CommandType = CommandType.Text;
                command.CommandText = "SELECT * FROM [dbo].[code_stations]";
                var abc = command.ExecuteNonQuery();
                if (abc != -1)
                {
                    return("");
                }
                SqlDataReader dataReader = command.ExecuteReader();
                string        str        = "";

                pStationCodes.Clear();
                while (dataReader.Read())
                {
                    var stationCode = new StationCode();

                    foreach (var name in StationCode.ParaNames)
                    {
                        string temp = dataReader[name].ToString();
                        stationCode.Dictionary[name] = temp;
                        str += temp + " ";
                    }
                    pStationCodes.Add(stationCode);
                    str += "\r\n";
                }
                dataReader.Close();
                return(str);
            }
            catch
            {
                throw;
                return("Error");
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            try
            {
                if (this.RelationCode == "")
                {
                    throw new Exception("相关编号不能为空");
                }
                if (this.ClassCode == "")
                {
                    throw new Exception("大类编号不能为空");
                }
                if (this.OperationCodes == "")
                {
                    throw new Exception("操作编号不能为空");
                }

                string[] arrUserCode    = this.ucPerson.UserCodes.Split(","[0]);
                string[] arrStationCode = this.ucPerson.StationCodes.Split(","[0]);

                ArrayList alOperation      = new ArrayList();
                string[]  arrOperationCode = this.OperationCodes.Split(","[0]);
                foreach (string OperationCode in arrOperationCode)
                {
                    foreach (string UserCode in arrUserCode)
                    {
                        if (UserCode.Trim() == "")
                        {
                            continue;
                        }

                        BLL.AccessRange acRang = new BLL.AccessRange();
                        acRang.AccessRangeType = 0;
                        acRang.RelationCode    = UserCode;
                        acRang.Operations      = OperationCode;
                        alOperation.Add(acRang);
                    }

                    foreach (string StationCode in arrStationCode)
                    {
                        if (StationCode.Trim() == "")
                        {
                            continue;
                        }

                        BLL.AccessRange acRang = new BLL.AccessRange();
                        acRang.AccessRangeType = 1;
                        acRang.RelationCode    = StationCode;
                        acRang.Operations      = OperationCode;
                        alOperation.Add(acRang);
                    }
                }

                BLL.ResourceRule.SetResourceAccessRange(this.RelationCode, this.ClassCode, "", alOperation, true);

                this.divSave.Style["display"] = "none";
            }
            catch (Exception ex)
            {
                LogHelper.Error("保存失败", ex);
                Response.Write(Rms.Web.JavaScript.Alert(true, "保存失败:" + ex.Message));
            }
        }
Ejemplo n.º 14
0
 private DepartureRequest(StationCode stationCode)
 {
     _stationCode = stationCode ?? throw new ArgumentNullException(nameof(stationCode));
 }
Ejemplo n.º 15
0
 public static DepartureRequest Create(StationCode stationCode)
 => new DepartureRequest(stationCode);
Ejemplo n.º 16
0
        public IStation GetStationTest([PexAssumeUnderTest] global::BarkNPark.System target, StationCode code)
        {
            IStation result = target.GetStation(code);

            return(result);
            // TODO: add assertions to method SystemTest.GetStationTest(System, StationCode)
        }
Ejemplo n.º 17
0
 public Station(string stationCd, string stationName)
 {
     this.stationName = stationName;
     StationCode.Add(stationCd);
 }
Ejemplo n.º 18
0
 public Station(string stationCd, string stationName) //Station constructor with parameters
 {
     this.stationName = stationName;
     StationCode.Add(stationCd);
 }
Ejemplo n.º 19
0
 public Station(StationCode code)
 {
     station_code = code;
 }