public void UpdateUserFriends(GGUser t) { using (TransactionScope scope = this.transactionScopeFactory.NewTransactionScope()) { IOrmAccesser <GGUser> accesser = scope.NewOrmAccesser <GGUser>(); accesser.Update(new ColumnUpdating(GGUser._Friends, t.Friends), new Filter(GGUser._UserID, t.UserID)); scope.Commit(); } }
public void UpdateUser(GGUser t) { using (TransactionScope scope = this.transactionScopeFactory.NewTransactionScope()) { IOrmAccesser <GGUser> accesser = scope.NewOrmAccesser <GGUser>(); accesser.Update(t); scope.Commit(); } }
public void ChangeUserGroups(string userID, string groups) { using (TransactionScope scope = this.transactionScopeFactory.NewTransactionScope()) { IOrmAccesser <GGUser> accesser = scope.NewOrmAccesser <GGUser>(); accesser.Update(new ColumnUpdating(GGUser._Groups, groups), new Filter(GGUser._UserID, userID)); scope.Commit(); } }
public void ChangeUserPassword(string userID, string newPasswordMD5) { using (TransactionScope scope = this.transactionScopeFactory.NewTransactionScope()) { IOrmAccesser <GGUser> accesser = scope.NewOrmAccesser <GGUser>(); accesser.Update(new ColumnUpdating(GGUser._PasswordMD5, newPasswordMD5), new Filter(GGUser._UserID, userID)); scope.Commit(); } }
public void UpdateGroup(GGGroup t) { using (TransactionScope scope = this.transactionScopeFactory.NewTransactionScope()) { IOrmAccesser <GGGroup> accesser = scope.NewOrmAccesser <GGGroup>(); t.Version += 1; //2018.09.25 accesser.Update(t); scope.Commit(); } }
public static void getdata() { IList <ELDB2.Sy_ShowInfo> list = null; IList <ELDB2.Storages> list1 = null; using (TransactionScope scope = ELDB2.DBFactory.NewTransactionScope(false)) { IOrmAccesser <ELDB2.Sy_ShowInfo> ShowInfo = ELDB2.DBFactory.NewOrmAccesser <ELDB2.Sy_ShowInfo>(scope); Filter filter = new Filter(ELDB2.Sy_ShowInfo._ReadState, 0, ComparisonOperators.Equal); list = ShowInfo.GetMuch(filter); foreach (ELDB2.Sy_ShowInfo showinfo in list) { IOrmAccesser <ELDB2.Storages> storages = ELDB2.DBFactory.NewOrmAccesser <ELDB2.Storages>(scope); Filter filter1 = new Filter(ELDB2.Storages._StorageID, showinfo.StorageID, ComparisonOperators.Equal); foreach (ELDB2.Storages storage in list1) { if (storage.Sign == 0) { switch (showinfo.OperateType) { case 1: storage.Act = "入库"; break; case 2: storage.Act = "出库"; break; case 3: storage.Act = "库存"; break; case 4: storage.Act = "移入"; break; case 5: storage.Act = "移出"; break; case 6: storage.Act = "移库"; break; default: break; } storage.ProductName = showinfo.TobaccoName; storage.Contents = (showinfo.OperatePiece > 0 ? showinfo.OperatePiece.ToString() + "件" : "") + (showinfo.OperateItem > 0 ? showinfo.OperateItem + "条" : ""); storage.Sign = 1; showinfo.ReadState = 1; storages.Update(storage); ShowInfo.Update(showinfo); } } } scope.Commit(); } }
public void Run1() { IList <ELDB2.Storages> list = null; using (TransactionScope scope = ELDB2.DBFactory.NewTransactionScope(false)) { IOrmAccesser <ELDB2.Storages> storages = ELDB2.DBFactory.NewOrmAccesser <ELDB2.Storages>(scope); Filter filter = new Filter(ELDB2.Storages._Sign, 1, ComparisonOperators.Equal); ELDB2.Storages storage1 = storages.GetOne(filter); if (storage1 != null) { Filter filter1 = new Filter(ELDB2.Storages._Address, storage1.Address, ComparisonOperators.Equal); list = storages.GetMuch(filter1); string[] data = new string[5]; for (int i = 0; i < 5; i++) { data[i] = ""; } foreach (ELDB2.Storages storage in list) { string s1, s2, s3, s4; switch ("mode1") { case "mode1": s1 = storage.StorageName.Trim() + " " + storage.Act.Trim() + " " + storage.Contents.Trim() + storage.ProductName.Trim() + "".PadRight(56, " "[0]); s1 = StrHandle.GetStringWith(s1, 56); if (storage.Row == "3") { data[0] = s1; } if (storage.Row == "2") { data[1] = s1; } if (storage.Row == "1") { data[2] = s1; } break; case "mode2": s1 = "储位:" + storage.StorageName.Trim(); s1 = StrHandle.GetStringWith(s1, 24); s2 = "操作:" + storage.Act.Trim(); s2 = StrHandle.GetStringWith(s2, 24); s3 = "品牌:" + storage.ProductName.Trim(); s3 = StrHandle.GetStringWith(s3, 24); s4 = "数量:" + storage.Contents.Trim(); s4 = StrHandle.GetStringWith(s4, 20); data[0] = s1; data[0] = data[0] + s2; data[0] = data[0] + s3; data[0] = data[0] + s4; break; default: break; } storage.Sign = 2; storages.Update(storage); IRelationAccesser ra = scope.NewRelationAccesser(); ra.DoCommand("Update [Sy_ShowInfo] set [HardwareReadState] = 1 where ReadState =1 and [StorageID] = '" + storage.StorageID + "'"); } //this.elOpertor.SendData(int.Parse(storage1.Address.Substring(storage1.Address.Length - 2, 2)), data); } scope.Commit(); } }