/// <summary> /// 填充用户 /// </summary> /// <param name="info"></param> protected virtual void FillGroupAccounts(UserEntity info) { info.GroupAccounts = new List <GroupAccountEntity>(); foreach (GridViewRow gvr in gvRole.Rows) { if (gvr.RowType != DataControlRowType.DataRow) { continue; } var ckSelect = gvr.FindControl("ckSelect") as System.Web.UI.HtmlControls.HtmlInputCheckBox; if (ckSelect == null || !ckSelect.Checked) { continue; } var groupAccount = new GroupAccountEntity { Group = new GroupEntity { Id = ckSelect.Value.Convert <long>() }, Account = info.Account, SaveType = SaveType.Add, }; info.GroupAccounts.Add(groupAccount); } }
/// <summary> /// 重写 /// </summary> /// <typeparam name="TEntityType"></typeparam> /// <param name="id"></param> /// <param name="saveType"></param> /// <returns></returns> protected override TEntityType CreateSaveEntity <TEntityType>(long id, SaveType saveType) { var info = new GroupAccountEntity { SaveType = saveType, Group = new GroupEntity { Id = id }, Account = new AccountEntity { Id = AccountId } }; return(info as TEntityType); }
public int DeleteGroupAccount(GroupAccountEntity oGroupAccountEntity) { con = oConnectionDatabase.DatabaseConnection(); int i = 0; cmd = new SqlCommand("DELETE FROM tblGroupAccount WHERE GrpAccSL=" + oGroupAccountEntity.GrpAccSL, con); try { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } con.Close(); return(i); }
public int UpdateGroupAccount(GroupAccountEntity oGroupAccountEntity) { con = oConnectionDatabase.DatabaseConnection(); int i = 0; cmd = new SqlCommand("UPDATE tblGroupAccount SET GrpAccNo='" + oGroupAccountEntity.GrpAccNo + "',AccGTSL='" + oGroupAccountEntity.AccGTSL + "',GrpAccName='" + oGroupAccountEntity.GrpAccName + "',Remarks='" + oGroupAccountEntity.Remarks + "', LastModifiedBy ='" + oGroupAccountEntity.LastModifiedBy + "' WHERE GrpAccSL=" + oGroupAccountEntity.GrpAccSL, con); try { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } con.Close(); return(i); }
public int InsertGroupAccount(GroupAccountEntity oGroupAccountEntity) { con = oConnectionDatabase.DatabaseConnection(); int i = 0; cmd = new SqlCommand("INSERT INTO tblGroupAccount (GrpAccNo,AccGTSL,GrpAccName,Remarks,CrateBy,LastModifiedBy) VALUES('" + oGroupAccountEntity.GrpAccNo + "','" + oGroupAccountEntity.AccGTSL + "','" + oGroupAccountEntity.GrpAccName + "','" + oGroupAccountEntity.Remarks + "','" + oGroupAccountEntity.CrateBy + "','" + oGroupAccountEntity.LastModifiedBy + "')", con); try { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } con.Close(); return(i); }