FlowDataContext DCDC = new FlowDataContext();
Config ce = new Config();
try
{
ce = DCDC.Config.Single(p => p.ID.Equals(ConfigID.Text));
ce.FlowType = DDl1.SelectedValue;
ce.FlowName = TFlowName.Text;
ce.FlowCode=TFlowCode.Text;
ce.Remark = TRemark.Text;
DCDC.SubmitChanges();
Window1.Hidden = true;
BindGrid1();
}
catch
{
System.Guid guid = new Guid();
guid = Guid.NewGuid();
Config c = new Config();
c.ID = guid.ToString();
c.FlowName = TFlowName.Text;
c.FlowType = DDl1.SelectedValue;
c.FlowCode = TFlowCode.Text;
c.Remark = TRemark.Text;
DCDC.Config.InsertOnSubmit(c);
DCDC.SubmitChanges();
Window1.Hidden = true;
BindGrid1();
}