前台传来明细 ,判断是否修改,在把前台 的数据组成新的类保存

 public class tt
{
public string id { get; set; }
public string e_id { get; set; }
public string name { get; set; }
public int age { get; set; }
public bool sex { get; set; } }
public class t
{
public string id { get; set; }
public string name { get; set; }
public List<tt> dd { get; set; }
}
class Program
{ static void Main(string[] args)
{
var q = new List<tt> { new tt { id = "",e_id="", name = "pg", age = , sex = true }, new tt { id = "",e_id="", name = "pp", age = , sex = true } }; //后台数据
var w = new List<tt> { new tt { name = "pg", e_id = "", age = , sex = true }, new ConsoleApplication2.tt { name = "pp", e_id = "", age = , sex = true }, new tt { name = "ppd", e_id = "", age = , sex = true } }; //前台数据 var e = new t { id = "", name = "pg", dd = q }; //父行 var ischange1 = false;
var ischange2 = false;
foreach (var item in w)
{
item.e_id = e.id; //父ID
tt ex = q.Where(d => d.name == item.name).FirstOrDefault();
if (ex == null)
{
ischange2 = true;
}
else
{
if (ex.age != item.age || ex.sex != item.sex)
{
ischange2 = true;
}
}
} if (q.Count != w.Count)
{
ischange2 = true;
}
if (ischange1 == true || ischange2 == true)
{
if (ischange2 == true)
{
e.dd = w;
}
}
Console.WriteLine(ischange2); Console.ReadKey(true);
} }

C# 后台获取前台交互判断的更多相关文章

  1. 【ADO.NET基础】后台获取前台控件

    C# 后台获取前台 input 文本框值.string aa=Request.Form[headself]; 那么要是后台给前台input文本框赋值呢? 后台 public string Headse ...

  2. asp.net后台获取前台页面大小

    前台代码如下:<input type="hidden" runat="server" value="0" id="txBod ...

  3. MVC后台与前台交互的问题。。。

    后台: viewbag.sb/*这是一个sb路径*/=@"\gao\shou"; 前台js: var sb='@viewbag.sb'; alert(sb); 结果就是gaocon ...

  4. asp.net后台获取前台的样式和后台给前台设置样式

    //获取到textbox1 的top值 Response.Write(textbox1.Style["top"]); //设置textbox1的style textbox1.Sty ...

  5. .net core 中后台获取前台 数据(post)的方法

    [HttpPost] public async Task<JsonResult> EditPoint() { Stream reqStream = Request.Body; string ...

  6. 后台获取前台runat=server的select的值

    <li> <asp:Label ID="Lpro" runat="server" Text="省份:" CssClass= ...

  7. 关于通用的C#后台获取前台页面的标签的正则表达式

    Regex   reg = new Regex("<div[^>]*?class=\"类属性名称\"[^>]*>(.*?) </div> ...

  8. iOS App 获取从后台返回前台时的页面

    产品美美的给小伙伴提了一个需求,当程序从后台进入前台时,如果是指定的页面,则弹出提示框. 大家首先想到的方法就是通过 AppDelegate.h 进行控制,相对复杂的步骤就是 在程序进入后台时对当前页 ...

  9. asp.net后台获取html控件的值

    1.asp.net后台获取前台type=text控件的值 前台:<input name="txtName" class="username" type=& ...

随机推荐

  1. Win10系列:C#应用控件基础3

    CheckBox控件 在应用程序的开发过程中开发者经常使用一组CheckBox控件来显示多个复选框,让用户从中选择一个或多个.当用户勾选复选框后,被选中的复选框会被标记为勾选状态,再次点击此复选框可取 ...

  2. js数组及常用数学方法

    数组方法 清空数组   1: arr.length=0;   2: arr=[]; arr.push()          //往数组最后一个添加元素,会待会一个返回值,就是新的数组长度arr.uns ...

  3. Python pycharm 引入需要使用的包

    第一步 第二步 第三步

  4. 【转载】java对象和byte数组互转,直接拿去用

    //加了了Optional防止空指针异常,加入了泛型,省去了强制转化 import java.io.*; import java.util.Optional; /** * Created by Jas ...

  5. 十二. Python基础(12)--生成器

    十二. Python基础(12)--生成器 1 ● 可迭代对象(iterable) An object capable of returning its members one at a time. ...

  6. Linux关闭防火墙步骤

    1   先查询防火墙状态 [root@old-09 ~]# /etc/init.d/iptables status Table: filter Chain INPUT (policy ACCEPT) ...

  7. SQL3-查找各个部门当前(to_date='9999-01-01')领导当前薪水详情以及其对应部门编号dept_no

    题目描述 查找各个部门当前(to_date='9999-01-01')领导当前薪水详情以及其对应部门编号dept_noCREATE TABLE `dept_manager` (`dept_no` ch ...

  8. Python如何操作redis

    做UI自动化时,遇到一个问题,需要在后台操作完成后,产生结果才能在前端进行操作,但是用自动化在后台操作又很麻烦,就想直接操作数据库,然后再 在前端进行操作:这时遇到一个问题,在后台操作时,会写入到数据 ...

  9. github咋用昂

    github-trend:https://github.com/trending github-usingway:https://zhuanlan.zhihu.com/p/41899093 githu ...

  10. L313 珊瑚裸鼠灭绝

    This week the Australian government declared the extinction of a tiny rodent called Bramble Cay melo ...