private string Delete(HttpContext context)
 {
     try
     {
         string str = "删除成功!";
         SysLogBll.Create("上传指标类型", "删除上传指标类型信息操作", adminUser.AdminName);
         string[] idList = context.Request.QueryString["idList"].Split(',');
         for (int i = 0; i < idList.Length; i++)
         {
             int id = int.Parse(idList[i]);
             NCPEP.Bll.T_IndicatorsRelations blldy = new T_IndicatorsRelations();
             DataTable dtdy = new DataTable();
             dtdy = blldy.GetList("FK_TypeIndicatorNameId='" + id + "'").Tables[0];
             if (dtdy.Rows.Count > 0)
             {
                 str = "指标对应关系中编号为[" + id + "]的指标类型已经被使用不能删除,请先删除对应关系再删除。";
                 return(str);
             }
             else
             {
                 //删除操作
                 NCPEP.Bll.T_UploadTypeIndicator blltype = new T_UploadTypeIndicator();
                 blltype.Delete(id);
             }
         }
         return(str);
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord("时间:[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]类名:[" + this.GetType().Name + "],行号:[" + Component.GetLineNum().ToString() + "行],错误信息:[" + ex.Message + "]");
         return("错误代码:500 ");
     }
 }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string            strid    = Request.QueryString["p"];
                NCPEP.Bll.T_Bid   bllbid   = new NCPEP.Bll.T_Bid();
                NCPEP.Model.T_Bid modelbid = new NCPEP.Model.T_Bid();
                modelbid = bllbid.GetModel(int.Parse(strid));
                if (modelbid != null)
                {
                    NCPEP.Bll.T_LiceTran   bllli   = new NCPEP.Bll.T_LiceTran();
                    NCPEP.Model.T_LiceTran modelli = new NCPEP.Model.T_LiceTran();
                    modelli = bllli.GetModel(modelbid.FK_LiceTranId);
                    if (modelli != null)
                    {
                        NCPEP.Bll.T_IndicatorsRelations   bllin   = new NCPEP.Bll.T_IndicatorsRelations();
                        NCPEP.Model.T_IndicatorsRelations modelin = new NCPEP.Model.T_IndicatorsRelations();
                        DataTable dt     = bllin.GetList(" FK_MemberTypeCertificationId='" + modelli.MemberTypeId + "' and ApplicationType='3'").Tables[0];//出让方申请对应关系
                        string    strids = "";
                        foreach (DataRow dr in dt.Rows)
                        {
                            strids += dr["FK_TypeIndicatorNameId"].ToString() + ",";
                        }
                        strids = strids.Trim().TrimEnd(',');
                        NCPEP.Bll.T_UploadTypeIndicator bllup = new NCPEP.Bll.T_UploadTypeIndicator();
                        DataTable ddldt = new DataTable();
                        if (string.IsNullOrEmpty(strids))
                        {
                            MessageBox.Show(this, "没有对应的指标关系,请先设置对应的指标关系再进行上传!");
                            return;
                        }
                        ddldt = bllup.GetList(" id in(" + strids + ")").Tables[0];
                        if (ddldt.Rows.Count > 0)
                        {
                            this.txtFK_UploadTypeIndicatorId.DataSource     = ddldt;
                            this.txtFK_UploadTypeIndicatorId.DataTextField  = "TypeIndicatorName";
                            this.txtFK_UploadTypeIndicatorId.DataValueField = "id";
                            this.txtFK_UploadTypeIndicatorId.DataBind();
                        }
                    }
                }

                BindFujian(strid);
            }
        }