private string DoAction() { string DataList = this.txtDataList.InnerText; string Anguage = this.txtAnguage.InnerText; string Environmental = this.txtEnvironmental.InnerText; string LineCount = this.txtLineCount.InnerText; string LineHand = this.txtLineHand.InnerText; if (DataList == "") { return("请添加验收资料清单"); } if (Anguage == "") { return("请添加源语言/开发环境"); } if (Environmental == "") { return("请添加运行环境/系统配置"); } if (LineCount == "") { return("请添加总代码行数/字节数(KB)"); } if (LineHand == "") { return("请添加手工编写代码行数"); } long Topic_relation_id = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + UserID).Topic_relation_id; var software_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + Topic_relation_id); if (software_model != null) { software_model.Data_list = DataList; software_model.anguage = Anguage; software_model.Environmental = Environmental; software_model.Line_count = LineCount; software_model.Line_hand = LineHand; if (!new BLL.CCOM.Software_accept().Update(software_model)) { return("更新软件验收表异常"); } } else { Model.CCOM.Software_accept soft_model = new Model.CCOM.Software_accept(); soft_model.Data_list = DataList; soft_model.anguage = Anguage; soft_model.Environmental = Environmental; soft_model.Line_count = LineCount; soft_model.Line_hand = LineHand; soft_model.Topic_relation_id = Topic_relation_id; if (new BLL.CCOM.Software_accept().Add(soft_model) == 0) { return("添加软件验收表异常"); } } return(""); }
private string DoAction() { string RunStatus = this.txtRunStatus.InnerText; string Feature = this.txtFeature.InnerText; string Score = this.txtScore.Value; if (RunStatus == "") { return("请添加软件运行状况"); } if (Feature == "") { return("请添加软件特点及应用情况"); } if (Score == "") { return("请添加验收结论(最后须给出定量的百分制结论)"); } int sc = int.Parse(Score); long Topic_relation_id = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + UserID).Topic_relation_id; var software_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + Topic_relation_id); if (software_model != null) { software_model.Run_status = RunStatus; software_model.Feature = Feature; software_model.Conclusion = sc; software_model.Time = DateTime.Now; if (!new BLL.CCOM.Software_accept().Update(software_model)) { return("更新验收结果异常"); } } else { Model.CCOM.Software_accept soft_model = new Model.CCOM.Software_accept(); soft_model.Run_status = RunStatus; soft_model.Feature = Feature; soft_model.Conclusion = sc; soft_model.Topic_relation_id = Topic_relation_id; soft_model.Time = DateTime.Now; if (new BLL.CCOM.Software_accept().Add(soft_model) == 0) { return("添加验收结果异常"); } } return(""); }