Пример #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //保存
            Workflow_ReportMainEntity _rm = new Workflow_ReportMainEntity();
            _rm.ReportID = 0;
            _rm.ReportName = txtReportName.Text.Trim();
            _rm.ReportTypeID = Convert.ToInt32(ddlReportType.SelectedValue);
            _rm.FormID = Convert.ToInt32(txtFormID.Value.Trim());
            _rm.WorkflowID = txtWorkflowID.Value.Trim();

            string sResult = DbHelper.GetInstance().AddWorkflow_ReportMain(_rm);

            if (sResult == " -1")
                {
                string strScript = "<script type='text/javascript'  lanuage='javascript'> alert('" + ResourceManager.GetString("Operation_RECORD") + "'); </script>";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", strScript, false);

                }
            else
                {
                string strScript = "<script type='text/javascript'  lanuage='javascript'> alert('" + ResourceManager.GetString("Button_GoComplete") + "'); </script>";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", strScript, false);

                }
            divWF.Visible = true;

            System.Web.UI.ScriptManager.RegisterStartupScript(btnSubmit, this.GetType(), "ButtonHideScript", strButtonHideScript, false);
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Workflow_ReportMainEntity rm = new Workflow_ReportMainEntity();
            rm.ReportID = Int32.Parse(txtReportID.Value);
            rm.ReportTypeID = Int32.Parse(ddlReportType.SelectedValue.Trim());
            string strR = DbHelper.GetInstance().UpdateWorkflow_ReportMainReportType(rm);
            if (Int32.Parse(strR) > 0)
            {
                lblmsg.InnerText = ResourceManager.GetString("Button_GoComplete");
            }
            else
            {
                lblmsg.InnerText = ResourceManager.GetString("Operation_RECORD");
            }

            System.Web.UI.ScriptManager.RegisterStartupScript(btnSave, this.GetType(), "ButtonHideScript", strButtonHideScript, false);
        }
Пример #3
0
 private Workflow_ReportMainEntity GetWorkflow_ReportMainFromIDataReader(DbDataReader dr)
 {
     Workflow_ReportMainEntity dt = new Workflow_ReportMainEntity();
     if (dr.FieldCount > 0)
     {
         if (dr["ReportID"].ToString() != "" || dr["ReportID"] != null) dt.ReportID = Int32.Parse(dr["ReportID"].ToString());
         if (dr["ReportTypeID"].ToString() != "" || dr["ReportTypeID"] != null) dt.ReportTypeID = Int32.Parse(dr["ReportTypeID"].ToString());
         dt.ReportName = dr["ReportName"].ToString();
         if (dr["FormID"].ToString() != "" || dr["FormID"] != null) dt.FormID = Int32.Parse(dr["FormID"].ToString());
         dt.WorkflowID = dr["WorkflowID"].ToString();
         dr.Close();
         return dt;
     }
     dr.Close();
     return null;
 }
Пример #4
0
 /// <summary>
 /// 修改报表类型信息
 /// </summary>
 /// <param name="_Workflow_ReportMainEntity"></param>
 /// <returns>返回string "-1"表示该已经存在,否则成功 </returns>
 public string UpdateWorkflow_ReportMainReportType(Workflow_ReportMainEntity _Workflow_ReportMainEntity)
 {
     DbParameter[] pramsUpdate = {
                                MakeInParam("@ReportID",(DbType)SqlDbType.Int,4,_Workflow_ReportMainEntity.ReportID ),
                                MakeInParam("@ReportTypeID",(DbType)SqlDbType.Int,4,_Workflow_ReportMainEntity.ReportTypeID )
                                      };
     StringBuilder sb = new StringBuilder();
     sb.Append("Update [dbo].[Workflow_ReportMain]");
     sb.Append(" set ");
     sb.Append(" [ReportTypeID]=@ReportTypeID");
     sb.Append(" where [ReportID]=@ReportID");
     return ExecuteNonQuery(CommandType.Text, sb.ToString(), pramsUpdate).ToString();
 }
Пример #5
0
        /// <summary>
        /// 新增信息
        /// </summary>
        /// <param name="_Workflow_ReportMainEntity"></param>
        /// <returns>返回string "-1"表示该已经存在,否则成功 </returns>
        public string AddWorkflow_ReportMain(Workflow_ReportMainEntity _Workflow_ReportMainEntity)
        {
            //判断该记录是否已经存在

            DbParameter[] prams = {   MakeInParam("@ReportTypeID",(DbType)SqlDbType.Int,4,_Workflow_ReportMainEntity.ReportTypeID ),
                                       MakeInParam("@ReportName",(DbType)SqlDbType.VarChar,200,_Workflow_ReportMainEntity.ReportName )
                                  };
            string sql = " select * from  Workflow_ReportMain where ReportTypeID=@ReportTypeID and ReportName=@ReportName";
            if (ExecuteDataset(CommandType.Text, sql, prams).Tables[0].Rows.Count > 0)
            {
                return "-1";//该记录已经存在

            }
            else
            {
                DbParameter[] pramsInsert = {
                                       MakeInParam("@ReportTypeID",(DbType)SqlDbType.Int,4,_Workflow_ReportMainEntity.ReportTypeID ),
                                       MakeInParam("@ReportName",(DbType)SqlDbType.VarChar,200,_Workflow_ReportMainEntity.ReportName ),
                                       MakeInParam("@FormID",(DbType)SqlDbType.Int,4,_Workflow_ReportMainEntity.FormID ),
                                       MakeInParam("@WorkflowID",(DbType)SqlDbType.VarChar,2000,_Workflow_ReportMainEntity.WorkflowID )
                                             };
                StringBuilder sb = new StringBuilder();
                sb.Append("INSERT INTO [dbo].[Workflow_ReportMain]");
                sb.Append("(");
                sb.Append("[ReportTypeID]");
                sb.Append(",[ReportName]");
                sb.Append(",[FormID]");
                sb.Append(",[WorkflowID]");
                sb.Append(") ");
                sb.Append(" VALUES (");
                sb.Append("@ReportTypeID,");
                sb.Append("@ReportName,");
                sb.Append("@FormID,");
                sb.Append("@WorkflowID);");
                sb.Append("select @@identity;");
                return ExecuteScalar(CommandType.Text, sb.ToString(), pramsInsert).ToString();
            }
        }