/// <summary> /// 开始一次测试 /// </summary> /// <param name="ProductCalID"></param> /// <returns></returns> public string InsertOneTest(string ProductCalID) { string sql = string.Format(" select * from dbo.ProductCalDetail where State='进行中' and ProductCalID='{0}' ", ProductCalID); DataTable dt = ProductCalre.FindTableBySql(sql); if (dt.Rows.Count > 0) { //表示已经有在进行中的检测,当前状态不允许再新开一条检测 return("0"); } else { ProductCal maine = ProductCalre.FindEntity(ProductCalID); ProductCalDetail entity = new ProductCalDetail(); entity.ProductCalDID = CommonHelper.GetGuid; entity.ProductCalID = ProductCalID; entity.StartDate = DateTime.Now; entity.State = "进行中"; entity.UpdateMan = ManageProvider.Provider.Current().UserName; ProductCalDetailre.Insert(entity); //插入一条新的检测记录 //循环插入5条空的检测录入记录,取消每次录入的按钮,改为一次性录入5条数据 for (int i = 0; i < maine.GroupNum; i++) { ProductCalData entityData = new ProductCalData(); entityData.ProductDataID = CommonHelper.GetGuid; entityData.ProductCalDID = entity.ProductCalDID; entityData.ProductCalID = ProductCalID; ProductCalDatare.Insert(entityData); } return("1"); } }
public ActionResult SetForm(string ProductCalID) { ProductCal entity = ProductCalre.FindEntity(ProductCalID); if (entity == null) { return(Content("")); } string strJson = entity.ToJson(); return(Content(strJson)); }