private bool Convert(CurrencyInfo item, string field, object value) { if (string.Compare(field, "CurrencyImage", true) != 0) return false; item.CurrencyImage = CurrencyStore.Common.Helper.ToBytes(value.ToString()); return true; }
public static CurrencyInfo GetCurrency(byte[] datas, int index, byte key) { CurrencyInfo item = new CurrencyInfo(); DEntry(datas, index, key); item.OperateTime = new DateTime(2000 + datas[index + 0], datas[index + 1], datas[index + 2], datas[index + 3], datas[index + 4], datas[index + 5]); item.OperatorNumber = datas[index + 6]; item.ClientCardNumber = datas.ToHexString(index + 7, 10); item.BusinessType = datas[index + 17]; item.BatchNumber = GetBatchNumber(datas, 18); item.OrderNumber = datas.ReadShort(index + 21); item.CurrencyKindCode = datas[index + 23]; item.FaceAmount = datas.ReadShort(index + 24); item.CurrencyVersion = datas.ReadShort(index + 26); var flag = GetFlag(datas[index + 28]); item.CurrencyType = flag[0]; item.PortNumber = flag[1]; item.IsSuspicious = datas[index + 29] == 0 ? (byte)0 : (byte)1; item.CurrencyNumber = GetCurrencyNo(datas, index + 30); item.CurrencyImageType = datas[index + 43]; item.CurrencyImage = GetPicData(datas, index + 44, item.CurrencyImageType); return item; }
public void Add(CurrencyInfo item) { if (Items.Count >= MAX_LENGTH) { Processor(); } lock (this) { Items.Add(item); ServerInstrumentation.Current.Produce(); } }
public void BatchRegister(CurrencyInfo objCurrencyInfo) { string sql = null; List<DbParameter> parameterList = new List<DbParameter>(); sql = " update tbl_currency_info set OrgId=:OrgId, DeviceKindCode=:DeviceKindCode, DeviceModelCode=:DeviceModelCode " + " where OrgId=0 and DeviceNumber=:DeviceNumber and DeviceKindCode=0 and DeviceModelCode=0 "; parameterList.Add(new OracleParameter(":OrgId", objCurrencyInfo.OrgId)); parameterList.Add(new OracleParameter(":DeviceKindCode", objCurrencyInfo.DeviceKindCode)); parameterList.Add(new OracleParameter(":DeviceModelCode", objCurrencyInfo.DeviceModelCode)); parameterList.Add(new OracleParameter(":DeviceNumber", objCurrencyInfo.DeviceNumber)); DbHelper.ExecuteNonQuery(sql, CommandType.Text, parameterList.ToArray()); }
private void CreateInesrtData(CurrencyInfo sourceData, int currencyCount) { this.Value = new List<CurrencyInfo>(); for (int i = 0; i < currencyCount; i++) { this.Value.Add(new CurrencyInfo() { OrgId = sourceData.OrgId, DeviceNumber = sourceData.DeviceNumber, DeviceKindCode = sourceData.DeviceKindCode, DeviceModelCode = sourceData.DeviceModelCode, OperatorNumber = sourceData.OperatorNumber, OperateTime = sourceData.OperateTime, BusinessType = sourceData.BusinessType, ClientCardNumber = sourceData.ClientCardNumber, BatchNumber = sourceData.BatchNumber, OrderNumber = sourceData.OrderNumber, CurrencyKindCode = sourceData.CurrencyKindCode, FaceAmount = sourceData.FaceAmount, CurrencyVersion = sourceData.CurrencyVersion, CurrencyType = sourceData.CurrencyType, PortNumber = sourceData.PortNumber, IsSuspicious = sourceData.IsSuspicious, CurrencyNumber = sourceData.CurrencyNumber, CurrencyImageType = sourceData.CurrencyImageType, CurrencyImage = sourceData.CurrencyImage }); } }
private CurrencyInfo GetCurrencyInfo(string content) { var match = reg.Match(content); if (!match.Success) return null; var item = new CurrencyInfo(); item.OrgId = Convert.ToInt32(match.Groups["a0"].Value); item.BatchNumber = match.Groups["a1"].Value; item.DeviceNumber = (match.Groups["a2"].Value); item.DeviceKindCode = Convert.ToByte(match.Groups["a3"].Value); item.DeviceModelCode = Convert.ToByte(match.Groups["a4"].Value); item.OperatorNumber = Convert.ToByte(match.Groups["a5"].Value); item.OperateTime = Convert.ToDateTime(match.Groups["a6"].Value); item.BusinessType = Convert.ToByte(match.Groups["a7"].Value); item.ClientCardNumber = Convert.ToString(match.Groups["a8"].Value); item.OrderNumber = Convert.ToInt32(match.Groups["a9"].Value); item.CurrencyKindCode = Convert.ToByte(match.Groups["a10"].Value); item.FaceAmount = Convert.ToInt16(match.Groups["a11"].Value); item.CurrencyVersion = Convert.ToInt16(match.Groups["a12"].Value); item.CurrencyType = Convert.ToByte(match.Groups["a13"].Value); item.PortNumber = Convert.ToByte(match.Groups["a14"].Value); item.IsSuspicious = Convert.ToByte(match.Groups["a15"].Value); item.CurrencyNumber = (match.Groups["a16"].Value); item.CurrencyImageType = Convert.ToByte(match.Groups["a17"].Value); item.CurrencyImageString = (match.Groups["a18"].Value); item.IsDuplicate = Convert.ToByte(match.Groups["a19"].Value); item.IsUpload = Convert.ToByte(match.Groups["a20"].Value); return item; }
public void BatchRegister_Info(CurrencyInfo objCurrencyInfo) { var repository = ServiceFactory.GetService<ICurrencyInfoRepository>(); repository.BatchRegister(objCurrencyInfo); }
private string GetItemValueScript(CurrencyInfo item) { return string.Format("({0},'{1}','{2}',{3},'{4}',{5},'{6}',{7},'{8}',{9},'{10}',{11},{12},{13},{14},{15},'{16}',{17},0x{18},{19},{20})", item.OrgId,//0 item.BatchNumber,//1 item.DeviceNumber,//2 item.DeviceKindCode,//3 item.DeviceModelCode,//4 item.OperatorNumber,//5 item.OperateTime.ToString("yyyy-MM-dd HH-mm-ss"),//6 item.BusinessType,//7 item.ClientCardNumber,//8 item.OrderNumber,//9 item.CurrencyKindCode,//10 item.FaceAmount,//11 item.CurrencyVersion,//12 item.CurrencyType,//13 item.PortNumber,//14 item.IsSuspicious,//15 item.CurrencyNumber,//16 item.CurrencyImageType,//17 item.CurrencyImage.ToHexString(),//18 item.IsDuplicate,//19 item.IsUpload); //20 }
protected void btnSubmit_Click(object sender, EventArgs e) { if (this.IsValid) { IDeviceService service = ServiceFactory.GetService<IDeviceService>(); bool isRegister = false; DeviceInfo entity = null; if (this.IsInsert) { entity = new DeviceInfo() { DeviceNumber = this.txtDeviceNumber.Text.Trim(), SoftwareVersion = this.txtSoftwareVersion.Text.Trim(), RegisterIp = this.txtRegisterIp.Text.Trim(), KindCode = this.ddlDeviceKind.SelectedValue.ToByte(0), ModelCode = this.ddlDeviceModel.SelectedValue.ToByte(0), OrgId = this.hfOrgId.Value.Trim().ToInt(), OnLineTime = this.txtOnLineTime.Text.Trim().ToDateTime(), DeviceStatus = this.ddlDeviceStatus.SelectedValue.ToByte(0) }; if (service.CheckExists_Info(entity)) { this.JscriptMsg("设备号码已存在", null, "Error"); return; } } else { entity = service.GetObject_Info(this.PkId); if (entity != null) { isRegister = (entity.OrgId == 0 && entity.KindCode == 0 && entity.ModelCode == 0); entity.SoftwareVersion = this.txtSoftwareVersion.Text.Trim(); entity.RegisterIp = this.txtRegisterIp.Text.Trim(); entity.KindCode = this.ddlDeviceKind.SelectedValue.ToByte(0); entity.ModelCode = this.ddlDeviceModel.SelectedValue.ToByte(0); entity.OrgId = this.hfOrgId.Value.Trim().ToInt(); entity.OnLineTime = this.txtOnLineTime.Text.Trim().ToDateTime(); entity.DeviceStatus = this.ddlDeviceStatus.SelectedValue.ToByte(0); } } service.Save_Info(entity); if (isRegister) { CurrencyInfo objCurrencyInfo = new CurrencyInfo() { OrgId = entity.OrgId, DeviceNumber = entity.DeviceNumber, DeviceKindCode = entity.KindCode, DeviceModelCode = entity.ModelCode }; ICurrencyService currencyService = ServiceFactory.GetService<ICurrencyService>(); currencyService.BatchRegister_Info(objCurrencyInfo); } if (this.IsInsert && (sender as Button).CommandName == "SubmitContinue") { this.ReturnUrl = this.Request.Url.PathAndQuery; } this.JscriptMsg("数据保存成功", this.ReturnUrl, "Success"); } }