|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select * from Gy_SourceRelationSet where HSourceID='" + HSourceID + "' and HUserName='"+ HSourceName + "'", "Gy_SourceRelationSet"); | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select * from Gy_SourceRelationSet where HSourceID='" + HSourceID + "' and HUserName='" + HUserName + "'", "Gy_SourceRelationSet"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (ds.Tables[0].Rows.Count > 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "当前人员创建此生产资源,不允许重复创建!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | oCN.BeginTran(); | 
|---|
|  |  |  | //写入产线绑定 | 
|---|
|  |  |  | string sql = string.Format(@"insert into Gy_SourceRelationSet (HSourceID,HUserName,HGroupID,HManagerID,HRemark,HCreateDate,HCreator,HNowFlag,HCheckManID) | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | oCN.BeginTran(); | 
|---|
|  |  |  | //写入产线绑定 | 
|---|
|  |  |  | string sql = string.Format(@"insert into Gy_SourceRelationSet (HSourceID,HUserName,HGroupID,HManagerID,HRemark,HCreateDate,HCreator,HNowFlag,HCheckManID) | 
|---|
|  |  |  | values('" + HSourceID + "','" + HUserName + "','" + HGroupID + "','" + HManagerID + "','" + HRemark + "','" + DateTime.Parse(HCreateDate).ToShortDateString() + "','" + HUserName + "','0','')"); | 
|---|
|  |  |  | oCN.RunProc(sql); | 
|---|
|  |  |  | oCN.Commit(); | 
|---|
|  |  |  | oCN.RunProc(sql); | 
|---|
|  |  |  | oCN.Commit(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "保存成功!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "保存成功!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|