コード例 #1
0
        //private List<WIFISSID> ssids=new List<WIFISSID>();
        //private wifiSo wifiso;
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as SocketConnectProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            try
            {
                Socket    socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                IPAddress ip     = IPAddress.Parse(config.Ip);
                socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 2500);
                socket.Connect(ip, Convert.ToInt16(config.Port));
                if (!socket.Connected)
                {
                    throw new Exception(string.Format("Socke连接服务器失败,{0}:{1}\r\n连接状态为false", config.Ip, config.Port));
                }
                log.Info(string.Format("Socke连接服务器连接成功,{0}:{1}", config.Ip, config.Port));
                configGv.Add("ObjSocket", socket);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Socke连接服务器失败,{0}:{1}\r\n详情:{2}", config.Ip, config.Port, ex.Message));
            }
        }
コード例 #2
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as CheckRangeValueProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            string strMoudleBtRssi = configGv.Get(config.GlobalVarible);
            double intMoudleBtRssi;

            try
            {
                intMoudleBtRssi = double.Parse(strMoudleBtRssi);
                if (intMoudleBtRssi > config.MaxValue)
                {
                    //log.Fail(string.Format("{0}:{1},大于设定最大值:{2} FAIL \r\n", config.TestValueName, intMoudleBtRssi, config.MaxValue));
                    throw new BaseException(string.Format("{0}:{1},大于设定最大值:{2} FAIL \r\n", config.TestValueName, intMoudleBtRssi, config.MaxValue));
                }
                else if (intMoudleBtRssi < config.MinValue)
                {
                    //log.Fail(string.Format("{0}:{1},小于设定最小值:{2} FAIL \r\n", config.TestValueName,intMoudleBtRssi, config.MinValue));
                    throw new BaseException(string.Format("{0}:{1},小于设定最小值:{2} FAIL \r\n", config.TestValueName, intMoudleBtRssi, config.MinValue));
                }

                log.Info(string.Format("{0}:{1},在设定范围:{2} ~ {3}之间 PASS \r\n", config.TestValueName, intMoudleBtRssi, config.MinValue, config.MaxValue));
            }
            catch (Exception ex)
            {
                throw new Exception("检查出错," + ex.Message);
            }
        }
コード例 #3
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            //config = properties as CheckBtRssiProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            try
            {
                string labImei = configGv.Get("IMEI");
                string nbImei  = configGv.Get("NBIMEI");
                if (string.IsNullOrEmpty(labImei) && !string.IsNullOrEmpty(nbImei))
                {
                    configGv.Add("IMEI", nbImei);
                }
                else if (!string.IsNullOrEmpty(labImei))//有标签BT MAC,则肯定经过一致性检查
                {
                    configGv.Add("IMEI", nbImei);
                }
                else
                {
                    log.Fail(string.Format("打印标签的IMEI 设置为NB IMEI失败\r\n,NB IMEI:{0} \r\n", nbImei));
                }
                log.Info(string.Format("打印标签的IMEI 设置为NB IMEI:\r\n{0} PASS \r\n", nbImei));
            }
            catch (Exception ex)
            {
                throw new Exception("打印标签的IMEI 设置为NB IMEI出错," + ex.Message);
            }
        }
コード例 #4
0
ファイル: CheckBtRssiExecuter.cs プロジェクト: Hanson0/SKG
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as CheckBtRssiProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            string strMoudleBtRssi = configGv.Get("RSSI");
            int    intMoudleBtRssi;

            try
            {
                intMoudleBtRssi = int.Parse(strMoudleBtRssi);
                if (intMoudleBtRssi > config.MaxValue)
                {
                    log.Fail(string.Format("信号强度检查:\r\n模块信号强度:{0},大于设定最大值:{1} FAIL \r\n", intMoudleBtRssi, config.MaxValue));
                    throw new BaseException(string.Format("信号强度检查:\r\n模块信号强度:{0},大于设定最大值:{1} FAIL \r\n", intMoudleBtRssi, config.MaxValue));
                }
                else if (intMoudleBtRssi < config.MinValue)
                {
                    log.Fail(string.Format("信号强度检查:\r\n模块信号强度:{0},小于设定最小值:{1} FAIL \r\n", intMoudleBtRssi, config.MinValue));
                    throw new BaseException(string.Format("信号强度检查:\r\n模块信号强度:{0},小于设定最小值:{1} FAIL \r\n", intMoudleBtRssi, config.MinValue));
                }

                log.Info(string.Format("信号强度检查:\r\n模块信号强度:{0},在设定范围:{1} ~ {2}之间 PASS \r\n", intMoudleBtRssi, config.MinValue, config.MaxValue));
            }
            catch (Exception ex)
            {
                throw new Exception("信号强度检查出错," + ex.Message);
            }
        }
コード例 #5
0
ファイル: FilterOutCharsExecuter.cs プロジェクト: Hanson0/SKG
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config   = properties as FilterOutCharsProperties;
            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;
            log      = globalDic[typeof(ILog).ToString()] as ILog;

            if (config.GlobalVariblesKey != null)
            {
                for (int i = 0; i < config.GlobalVariblesKey.Length; i++)
                {
                    if (!string.IsNullOrEmpty(config.GlobalVariblesKey[i]))
                    {
                        Match matchKey = Regex.Match(config.GlobalVariblesKey[i], this.pattern);
                        if (!matchKey.Success)
                        {
                            throw new BaseException(string.Format("read info {0} key fail", i));
                        }
                        string key = matchKey.Groups[1].ToString();

                        string value = configGv.Get(key);
                        for (int j = 0; j < config.FilterOutChars.Length; j++)
                        {
                            value = value.Replace(config.FilterOutChars[j], "");
                        }
                        configGv.Add(key, value);
                    }
                }
            }
        }
コード例 #6
0
        bool ServerAuthentication()
        {
            bool IsAvailable = false;

            IsAvailable = GlobalVaribles.PingHost(GlobalVaribles.IpAddress);
            return(IsAvailable);
        }
コード例 #7
0
ファイル: FrmFloor.cs プロジェクト: Shabanpk/TowerFrontEnd
        public void LoadBuildingByFloorID(UltraCombo cbo, int floorID)
        {
            string str = BLLObj_Building.LoadAllBuildingCombo();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            string strr = BLLObj.LoadBuildingIDByFloorID(floorID);

            dt = new DataTable();
            dt = GlobalVaribles.DeserializeDataTable(strr);

            cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"]);


            //cbo.DataSource = dt;
            //cbo.ValueMember = "BuildingID";
            //cbo.DisplayMember = "BuildingName";
            //cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            //cbo.Value = floorID;
            // cbo.ReadOnly = true;
        }
コード例 #8
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as CheckWifiProbeProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            string strNbProbe = configGv.Get("NBWIFIPROBE");
            int    intNbProbe;

            try
            {
                intNbProbe = int.Parse(strNbProbe);
                if (intNbProbe > config.MaxValue)
                {
                    log.Fail(string.Format("WIFI探针-信号强度检查:\r\n信号强度:{0},大于设定最大值:{1} FAIL \r\n", intNbProbe, config.MaxValue));
                    throw new BaseException(string.Format("NB 探针强度检查:\r\n信号强度:{0},大于设定最大值:{1} FAIL \r\n", intNbProbe, config.MaxValue));
                }
                else if (intNbProbe < config.MinValue)
                {
                    log.Fail(string.Format("WIFI探针-信号强度检查:\r\n信号强度:{0},小于设定最小值:{1} FAIL \r\n", intNbProbe, config.MinValue));
                    throw new BaseException(string.Format("WIFI 探针强度检查:\r\n信号强度:{0},小于设定最小值:{1} FAIL \r\n", intNbProbe, config.MinValue));
                }

                log.Info(string.Format("WIFI探针-信号强度检查:\r\n信号强度:{0},在设定范围:{1} ~ {2}之间 PASS \r\n", intNbProbe, config.MinValue, config.MaxValue));
            }
            catch (Exception ex)
            {
                throw new Exception("WIFI探针-信号强度检查出错," + ex.Message);
            }
        }
コード例 #9
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            //config = properties as FindDeviceProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;
            //int ret = -1;
            //string returnString = "";
            FormScanCode formScanCode = new FormScanCode()
            {
                //DutName = config.DutName,
                //ShowInTaskbar = true,
                //StartPosition = FormStartPosition.CenterScreen
            };
            DialogResult dialogResult = DialogResult.None;

            lock (myLock)
            {
                dialogResult = formScanCode.ShowDialog();
            }
            if (dialogResult != DialogResult.OK)
            {
                //sync.CountDown("ScanCodeExecuter");
                throw new BaseException("user discard scan code");
            }
            configGv.Add(GlobalVaribles.LABEL_SN, formScanCode.LabelSn);
        }
コード例 #10
0
        public void LoadBuildingByOfficeID(UltraCombo cbo, int OfficeID)
        {
            //string str = BLLObj.LoadBuildingfromOfficesEdit(OfficeID);
            //dt = GlobalVaribles.DeserializeDataTable(str);
            //cbo.DataSource = dt;
            //cbo.ValueMember = "BuildingID";
            //cbo.DisplayMember = "BuildingName";
            //cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            //cbo.Value = OfficeID;
            // cbo.ReadOnly = true;


            string str = BLLObj.LoadAllBuildingforOffice();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            string strr = BLLObj.LoadBuildingfromOfficesEdit(OfficeID);

            dt        = new DataTable();
            dt        = GlobalVaribles.DeserializeDataTable(strr);
            cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"].ToString());
            //cbo.Value = 0;
        }
コード例 #11
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            //config = properties as CheckBtRssiProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            try
            {
                string strBtMac       = configGv.Get("MAC_BT");
                string strMoudleBtMac = configGv.Get("MoudleBtMac");
                if (string.IsNullOrEmpty(strBtMac) && !string.IsNullOrEmpty(strMoudleBtMac))
                {
                    configGv.Add("MAC", strMoudleBtMac);
                }
                else if (!string.IsNullOrEmpty(strBtMac) && !string.IsNullOrEmpty(strMoudleBtMac))//有标签BT MAC,则肯定经过一致性检查
                {
                    configGv.Add("MAC", strMoudleBtMac);
                }
                else if (!string.IsNullOrEmpty(strBtMac) && string.IsNullOrEmpty(strMoudleBtMac))//有标签BT MAC,则肯定经过一致性检查
                {
                    configGv.Add("MAC", strBtMac);
                }
                else
                {
                    log.Fail(string.Format("LOG MAC设置为BT MAC失败\r\n,取号BT MAC{0},模块BT MAC:{1} \r\n", strBtMac, strMoudleBtMac));
                }
                log.Info(string.Format("LOG MAC设置为BT MAC:\r\n{0} PASS \r\n", strMoudleBtMac));
            }
            catch (Exception ex)
            {
                throw new Exception("LOG MAC设置为BT MAC出错," + ex.Message);
            }
        }
コード例 #12
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as CheckTempProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            string strNbTemp = configGv.Get("NBTemp");
            float  floatNbTemp;

            try
            {
                floatNbTemp = float.Parse(strNbTemp);
                if (floatNbTemp > config.MaxValue)
                {
                    log.Fail(string.Format("NB 温度传感器检查:\r\n模块温度传感器温度值:{0},大于设定最大值:{1} FAIL \r\n", floatNbTemp, config.MaxValue));
                    throw new BaseException(string.Format("NB 温度传感器检查:\r\n模模块温度传感器温度值:{0},大于设定最大值:{1} FAIL \r\n", floatNbTemp, config.MaxValue));
                }
                else if (floatNbTemp < config.MinValue)
                {
                    log.Fail(string.Format("NB 温度传感器检查:\r\n模模块温度传感器温度值:{0},小于设定最小值:{1} FAIL \r\n", floatNbTemp, config.MinValue));
                    throw new BaseException(string.Format("NB 信号强度检查:\r\n模块温度传感器温度值:{0},小于设定最小值:{1} FAIL \r\n", floatNbTemp, config.MinValue));
                }

                log.Info(string.Format("NB 温度传感器检查:\r\n模模块温度传感器温度值:{0},在设定范围:{1} ~ {2}之间 PASS \r\n", floatNbTemp, config.MinValue, config.MaxValue));
            }
            catch (Exception ex)
            {
                throw new Exception("NB 温度传感器检查出错," + ex.Message);
            }
        }
コード例 #13
0
        private void btnOfficeID_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                string str = BLLObj.LoadAllOffices();
                GlobalVaribles.dtGSearch = GlobalVaribles.DeserializeDataTable(str);
                rValue = FrmGSearch.Show("Select", false, "All Office");
                if (rValue == null)
                {
                    return;
                }
                Moffice = long.Parse(rValue.ToString());
                DataTable dt   = new DataTable();
                string    strs = BLLObj.GetOfficeByID(Convert.ToInt32(Moffice));
                dt = GlobalVaribles.DeserializeDataTable(strs);

                if (dt != null && dt.Rows.Count > 0)
                {
                    UpdateRecord = true;
                    GetRecord    = true;
                    // LoadBuildingByFloorID(cboBuildingName, Convert.ToInt32(Moffice));
                    LoadBuildingByOfficeID(cboBuildingName, Convert.ToInt32(Moffice));
                    LoadfloorByOfficeIDinEdit(cboFloorName, Convert.ToInt32(Moffice));
                    //string strr = BLLObj.LoadBuildingfromOfficesEdit(Convert.ToInt32(Moffice));
                    //dt = new DataTable();
                    //dt = GlobalVaribles.DeserializeDataTable(strr);
                    //LoadfloorByBuildingIDinEdit(cboFloorName,Convert.ToInt32(dt.Rows[0]["BuildingID"].ToString()));
                    //  cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"].ToString());

                    //LoadfloorByBuildingID(cboFloorName, BuildingID);

                    //  LoadfloorByBuildingID(cboFloorName, BuildingID);
                    txtOfficeID.Text           = dt.Rows[0]["OfficeID"].ToString();
                    txtofficeName.Text         = dt.Rows[0]["OfficeName"].ToString();
                    txttenantName.Text         = dt.Rows[0]["TenantName"].ToString();
                    txtRent.Text               = dt.Rows[0]["OfficeRent"].ToString();
                    txtOfficeArea.Text         = dt.Rows[0]["OfficeAreaSquareFoot"].ToString();
                    txtElectricityPerUnit.Text = dt.Rows[0]["ElectricityPerUnit"].ToString();
                    txtGeneratorPerUnit.Text   = dt.Rows[0]["GeneratorPerUnit"].ToString();
                    txtMaintence.Text          = dt.Rows[0]["Maintenance"].ToString();
                    txtwater.Text              = dt.Rows[0]["Water"].ToString();
                    txtOther.Text              = dt.Rows[0]["Other"].ToString();
                    txtDescription.Text        = dt.Rows[0]["Description"].ToString();

                    chkIsActive.CheckedValue = bool.Parse(dt.Rows[0]["Status"].ToString());
                    btnEdit.Enabled          = true;
                    btnOK.Enabled            = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, GlobalVaribles.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
コード例 #14
0
 public void GetMaxOfficeID()
 {
     MOfficeID = BLLObj.GetMaxOfficeID();
     dt        = GlobalVaribles.DeserializeDataTable(MOfficeID);
     if (dt.Rows.Count > 0)
     {
         Moffice          = long.Parse(dt.Rows[0]["OfficeID"].ToString());
         txtOfficeID.Text = Moffice.ToString();
     }
 }
コード例 #15
0
ファイル: FrmCity.cs プロジェクト: Shabanpk/TowerFrontEnd
 public void GetMaxCityID()
 {
     MCityID = BLLObj.GetMaxCityID();
     dt      = GlobalVaribles.DeserializeDataTable(MCityID);
     if (dt.Rows.Count > 0)
     {
         MCity          = long.Parse(dt.Rows[0]["CityID"].ToString());
         txtCityID.Text = MCity.ToString();
     }
 }
コード例 #16
0
ファイル: FrmFloor.cs プロジェクト: Shabanpk/TowerFrontEnd
 public void GetMaxFloorID()
 {
     MFloorID = BLLObj.GetMaxFloorID();
     dt       = GlobalVaribles.DeserializeDataTable(MFloorID);
     if (dt.Rows.Count > 0)
     {
         Mfloor          = long.Parse(dt.Rows[0]["FloorID"].ToString());
         txtFloorID.Text = Mfloor.ToString();
     }
 }
コード例 #17
0
ファイル: FrmBuilding.cs プロジェクト: Shabanpk/TowerFrontEnd
 public void GetMaxBuildingID()
 {
     MBuildingID = BLLObj.GetMaxBuildingID();
     dt          = GlobalVaribles.DeserializeDataTable(MBuildingID);
     if (dt.Rows.Count > 0)
     {
         MBuilding          = long.Parse(dt.Rows[0]["BuildingID"].ToString());
         txtBuildingID.Text = MBuilding.ToString();
     }
 }
コード例 #18
0
        //private long GetMaxUserId()
        //{
        //    long MaxID;
        //    try
        //    {
        //        MaxID = DataAccess.GetMaxNO("UserID", "Users");
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    return MaxID;
        //}

        public void GetMaxUserID()
        {
            MUserID = BLLObj.GetMaxUserID();
            dt      = GlobalVaribles.DeserializeDataTable(MUserID);
            if (dt.Rows.Count > 0)
            {
                MUser          = long.Parse(dt.Rows[0]["UserID"].ToString());
                lblUserID.Text = MUser.ToString();
                // txtCityID.Text = MUser.ToString();
            }
        }
コード例 #19
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as ReadMapProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            //int ret = -1;
            string mapFileString = "";

            try
            {
                mapFileString = Read(config.MapFilePath);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("读取MAP文件失败,异常:{0}", ex.Message));
            }

            log.Info(string.Format("读取MAP文件成功:\r\n{0}", mapFileString));
            //更新MAP内存中的MAC地址
            string[] splits             = { "\r\n" };
            string[] mapFileStringLines = mapFileString.Split(splits, StringSplitOptions.RemoveEmptyEntries);

            //IMES获取的MAC***************
            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;
            string macFromImes = configGv.Get("MAC");

            //更新MAP
            //byte[] bytesMac = strToToHexByte(macFromImes);
            //byte[] bytesReverseMac = bytesConvert(bytesMac);
            //string stringReverseMac = byteToHexStr(bytesReverseMac);
            //string reverseMacAddSpace = AddSpaceEachTwoBtye(stringReverseMac);


            string reverseMacAddSpace = AddSpaceEachTwoBtye(macFromImes);

            string mapFileStringMacUpdate = "";

            for (int i = 0; i < mapFileStringLines.Length; i++)
            {
                if (i == 17)
                {
                    //前面固定部分+反转并添加空格的MAC
                    mapFileStringLines[i] = mapFileStringLines[i].Substring(0, 25) + reverseMacAddSpace;
                }
                mapFileStringMacUpdate += mapFileStringLines[i] + "\r\n";
            }

            //存为byte数组应该会好些,这样可以定位地址,当MAC的偏移地址发生变化时,只需改地址值
            log.Info(string.Format("更新MAP文件中的MAC成功:\r\n{0}", mapFileStringMacUpdate));
            GlobalVaribles configGv1 = globalDic.Get <GlobalVaribles>();

            configGv1.Add("MapFileStringMacUpdate", mapFileStringMacUpdate);
            //globalDic.Add(typeof(OpenPhoneProperties).ToString(), config);
        }
コード例 #20
0
        private void btnBillID_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                string str = BLLObj.LoadAllBillgSearchOnClickButton();
                GlobalVaribles.dtGSearch = GlobalVaribles.DeserializeDataTable(str);
                rValue = FrmGSearch.Show("Select", false, "All Billing");
                if (rValue == null)
                {
                    return;
                }
                MBilling = long.Parse(rValue.ToString());
                DataTable dt   = new DataTable();
                string    strs = BLLObj.GetBillingByID(Convert.ToInt32(MBilling));
                dt = GlobalVaribles.DeserializeDataTable(strs);

                if (dt != null && dt.Rows.Count > 0)
                {
                    UpdateRecord                  = true;
                    GetRecord                     = true;
                    txtBillingID.Text             = dt.Rows[0]["BillingID"].ToString();
                    txtBillNo.Text                = dt.Rows[0]["BillNumber"].ToString();
                    dtpBillDate.Value             = Convert.ToDateTime(dt.Rows[0]["BillDate"].ToString());
                    cboOfficeName.Value           = Convert.ToInt32(dt.Rows[0]["OfficeID"].ToString());
                    txtPrevElectUnit.Text         = dt.Rows[0]["PrevElectricityUnit"].ToString();
                    TxtCurrElecUnit.Text          = dt.Rows[0]["CurrentElectricityUnit"].ToString();
                    txtthisMonthElectricUnit.Text = dt.Rows[0]["ThisMonthElectricityUnit"].ToString();
                    txtPrevGenetorUnit.Text       = dt.Rows[0]["PrevGeneratorUnit"].ToString();
                    txtCurrGeneratorUnit.Text     = dt.Rows[0]["CurrentGeneratorUnit"].ToString();
                    txtThisMonthGenetorUnit.Text  = dt.Rows[0]["ThisMonthGeneratorUnit"].ToString();
                    txtElectricityBill.Text       = dt.Rows[0]["ElectricityBill"].ToString();
                    txtGenetorBill.Text           = dt.Rows[0]["GenetorBill"].ToString();
                    txtWithOutTaxBill.Text        = dt.Rows[0]["BillWithOutTax"].ToString();
                    txtTax.Text                   = dt.Rows[0]["Tax"].ToString();
                    txtTotalBillWithTax.Text      = dt.Rows[0]["TotalBillWithTax"].ToString();
                    txtDiscount.Text              = dt.Rows[0]["Discount"].ToString();
                    txtReceivedAmount.Text        = dt.Rows[0]["RecievedAmount"].ToString();
                    txtArears.Text                = dt.Rows[0]["Arears"].ToString();
                    //LoadBuildingByOfficeID(cboBuildingName, Convert.ToInt32(Moffice));
                    //LoadfloorByOfficeIDinEdit(cboFloorName, Convert.ToInt32(Moffice));

                    chkIsActive.CheckedValue = bool.Parse(dt.Rows[0]["Status"].ToString());
                    btnEdit.Enabled          = true;
                    btnOK.Enabled            = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, GlobalVaribles.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
コード例 #21
0
 public void GetMaxBillingID()
 {
     MOfficeID = BLLObj.GetMaxBillID();
     dt        = GlobalVaribles.DeserializeDataTable(MOfficeID);
     if (dt.Rows.Count > 0)
     {
         MBilling          = long.Parse(dt.Rows[0]["BillingID"].ToString());
         txtBillingID.Text = MBilling.ToString();
         BillingID         = Convert.ToInt32(dt.Rows[0]["BillingID"].ToString());
         txtBillNo.Text    = Convert.ToString("Invoice Number " + BillingID);
     }
 }
コード例 #22
0
ファイル: FrmFloor.cs プロジェクト: Shabanpk/TowerFrontEnd
        public void LoadAllBuilding(UltraCombo cbo)
        {
            string str = BLLObj_Building.LoadAllBuilding();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            cbo.Value = 0;
        }
コード例 #23
0
ファイル: FrmCity.cs プロジェクト: Shabanpk/TowerFrontEnd
        bool SaveRecord()
        {
            bool IsSave   = false;
            bool IsString = false;

            IsString = GlobalVaribles.IsString(txtCityName.Text);
            BLL.NewWebServices.BE_City NewBEObj = new BLL.NewWebServices.BE_City();
            NewBEObj.CityName = txtCityName.Text;
            //NewBEObj.Created_Id = Convert.ToInt32(GlobalVaribles.dtSession.Rows[0]["UserID"]);
            NewBEObj.Created_Id = GlobalVaribles.UserID;
            NewBEObj.Status     = chkIsActive.Checked;
            NewBEObj.Created_At = GlobalVaribles.CurrentServerTime;
            NewBEObj.Modify_At  = GlobalVaribles.CurrentServerTime;
            IsSave = BLLObj.SaveRecord(NewBEObj);
            return(IsSave);
        }
コード例 #24
0
ファイル: CheckNbVersionExecuter.cs プロジェクト: Hanson0/SKG
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as CheckNbVersionProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;


            string devVersion = configGv.Get(config.GlobalVarible);

            if (devVersion != config.Version)
            {
                throw new BaseException(string.Format("关键字检查:{0},配置关键字:{1}不一致", devVersion, config.Version));
            }
            log.Info(string.Format("关键字检查:{0},配置关键字:{1}一致", devVersion, config.Version));
        }
コード例 #25
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config = properties as LabelGetAndCheckProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            string[] data   = configGv.Get(GlobalVaribles.LABEL_SN).Split(new[] { ',' });
            string   gimiSn = data[0];

            CheckSn(gimiSn);

            gimiSn = gimiSn.Insert(config.InsertIndex, config.Value);
            configGv.Add("GimiSn", gimiSn);

            log.Info(string.Format("标签:{0}\r\n插入内容后:{1}", data[0], gimiSn));

            //try
            //{

            //    string strBtMac = configGv.Get("MAC_BT");
            //    string strMoudleBtMac = configGv.Get("MoudleBtMac");
            //    if (string.IsNullOrEmpty(strBtMac) && !string.IsNullOrEmpty(strMoudleBtMac))
            //    {
            //        configGv.Add("MAC", strMoudleBtMac);
            //    }
            //    else if (!string.IsNullOrEmpty(strBtMac) && !string.IsNullOrEmpty(strMoudleBtMac))//有标签BT MAC,则肯定经过一致性检查
            //    {
            //        configGv.Add("MAC", strMoudleBtMac);
            //    }
            //    else if (!string.IsNullOrEmpty(strBtMac) && string.IsNullOrEmpty(strMoudleBtMac))//有标签BT MAC,则肯定经过一致性检查
            //    {
            //        configGv.Add("MAC", strBtMac);
            //    }
            //    else
            //    {
            //        log.Fail(string.Format("LOG MAC设置为BT MAC失败\r\n,取号BT MAC{0},模块BT MAC:{1} \r\n", strBtMac, strMoudleBtMac));
            //    }
            //    log.Info(string.Format("LOG MAC设置为BT MAC:\r\n{0} PASS \r\n", strMoudleBtMac));


            //}
            //catch (Exception ex)
            //{
            //    throw new Exception("LOG MAC设置为BT MAC出错," + ex.Message);
            //}
        }
コード例 #26
0
        public void LoadfloorByBuildingID(UltraCombo cbo, int BuildingID)
        {
            string str = BLLObj.LoadfloorByBuildingID(BuildingID);

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                cbo.DataSource    = dt;
                cbo.ValueMember   = "FloorID";
                cbo.DisplayMember = "FloorName";
                cbo.DisplayLayout.Bands[0].Columns["FloorID"].Hidden = true;
                cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
                cbo.Value = BuildingID;
            }

            // cbo.ReadOnly = true;
        }
コード例 #27
0
ファイル: CheckWifiMacExecuter.cs プロジェクト: Hanson0/SKG
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            //config = properties as FindDeviceProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;
            //取存储的关键字为MoudleBtMac的value值
            string DevWifi_MAC = configGv.Get("DevWifi_MAC");

            DevWifi_MAC = DevWifi_MAC.Replace(":", "").Replace(":", "");
            string labelMAC = configGv.Get(GlobalVaribles.MAC);

            if (DevWifi_MAC != labelMAC)
            {
                throw new BaseException(string.Format("WIFI MAC:{0},与标签MAC:{1} 不一致 FAIL\r\n", DevWifi_MAC, labelMAC));
            }
            log.Info(string.Format(string.Format("WIFI MAC:{0},与标签MAC:{1} 一致 PASS\r\n", DevWifi_MAC, labelMAC)));
        }
コード例 #28
0
ファイル: CheckNbImeiExecuter.cs プロジェクト: Hanson0/SKG
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            //config = properties as FindDeviceProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            //取存储的关键字为MoudleBtMac的value值
            string labelImei  = configGv.Get("IMEI");
            string moudleImei = configGv.Get("NBIMEI");

            if (labelImei != moudleImei)
            {
                log.Fail(string.Format("NB IMEI检查:\r\n模块IMEI:{0},与标签IMEI:{1} 不一致 \r\n", moudleImei, labelImei));
                throw new BaseException(string.Format("NB IMEI检查:\r\n模块IMEI:{0},与标签IMEI:{1} 不一致 \r\n", moudleImei, labelImei));
            }
            log.Info(string.Format("NB IMEI检查:\r\n模块IMEI:{0},与标签IMEI:{1} 一致 \r\n", moudleImei, labelImei));
        }
コード例 #29
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            //config = properties as CheckBtRssiProperties;
            ILog log = globalDic[typeof(ILog).ToString()] as ILog;

            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;

            //string[] data = configGv.Get(GlobalVaribles.LABEL_SN).Split(new[] { ',' });
            //configGv.Add("GimiSn", data[0]);
            //log.Info(string.Format("Sn={0}", configGv.Get("GimiSn")));
            configGv.Add("MAC", configGv.Get("GimiSn"));
            log.Info(string.Format("设置LOG的Mac={0}成功", configGv.Get("GimiSn")));

            //try
            //{

            //    string strBtMac = configGv.Get("MAC_BT");
            //    string strMoudleBtMac = configGv.Get("MoudleBtMac");
            //    if (string.IsNullOrEmpty(strBtMac) && !string.IsNullOrEmpty(strMoudleBtMac))
            //    {
            //        configGv.Add("MAC", strMoudleBtMac);
            //    }
            //    else if (!string.IsNullOrEmpty(strBtMac) && !string.IsNullOrEmpty(strMoudleBtMac))//有标签BT MAC,则肯定经过一致性检查
            //    {
            //        configGv.Add("MAC", strMoudleBtMac);
            //    }
            //    else if (!string.IsNullOrEmpty(strBtMac) && string.IsNullOrEmpty(strMoudleBtMac))//有标签BT MAC,则肯定经过一致性检查
            //    {
            //        configGv.Add("MAC", strBtMac);
            //    }
            //    else
            //    {
            //        log.Fail(string.Format("LOG MAC设置为BT MAC失败\r\n,取号BT MAC{0},模块BT MAC:{1} \r\n", strBtMac, strMoudleBtMac));
            //    }
            //    log.Info(string.Format("LOG MAC设置为BT MAC:\r\n{0} PASS \r\n", strMoudleBtMac));


            //}
            //catch (Exception ex)
            //{
            //    throw new Exception("LOG MAC设置为BT MAC出错," + ex.Message);
            //}
        }
コード例 #30
0
        public void Run(IProperties properties, GlobalDic <string, object> globalDic)//virtual
        {
            config   = properties as ToggleCaseProperties;
            configGv = globalDic[typeof(GlobalVaribles).ToString()] as GlobalVaribles;
            log      = globalDic[typeof(ILog).ToString()] as ILog;
            string preGlobalVaribles = configGv.Get(config.PreGlobalVaribles);
            string value             = "";

            if (config.ToggleCase == ToggleCaseProperties.CaseEnum.ToLower)
            {
                value = preGlobalVaribles.ToLower();
            }
            else if (config.ToggleCase == ToggleCaseProperties.CaseEnum.ToUper)
            {
                value = preGlobalVaribles.ToUpper();
            }

            configGv.Add(config.AfterGlobalVaribles, value);
        }