Exemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(AMS.Model.AMS_CallBackErrorInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update AMS_CallBackErrorInfo set ");
            strSql.Append("SchoolId=@SchoolId,");
            strSql.Append("FbPerson=@FbPerson,");
            strSql.Append("MarkManID=@MarkManID,");
            strSql.Append("FbTime=@FbTime,");
            strSql.Append("SolveManID=@SolveManID,");
            strSql.Append("SolveTime=@SolveTime,");
            strSql.Append("SolveWay=@SolveWay,");
            strSql.Append("ProblemType=@ProblemType,");
            strSql.Append("FbDescribe=@FbDescribe,");
            strSql.Append("Status=@Status");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SchoolId",    SqlDbType.Int,         4),
                new SqlParameter("@FbPerson",    SqlDbType.NVarChar,   20),
                new SqlParameter("@MarkManID",   SqlDbType.Int,         4),
                new SqlParameter("@FbTime",      SqlDbType.DateTime),
                new SqlParameter("@SolveManID",  SqlDbType.Int,         4),
                new SqlParameter("@SolveTime",   SqlDbType.DateTime),
                new SqlParameter("@SolveWay",    SqlDbType.NVarChar,  500),
                new SqlParameter("@ProblemType", SqlDbType.Int,         4),
                new SqlParameter("@FbDescribe",  SqlDbType.NVarChar,  500),
                new SqlParameter("@Status",      SqlDbType.Int,         4),
                new SqlParameter("@ID",          SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.SchoolId;
            parameters[1].Value  = model.FbPerson;
            parameters[2].Value  = model.MarkManID;
            parameters[3].Value  = model.FbTime;
            parameters[4].Value  = model.SolveManID;
            parameters[5].Value  = model.SolveTime;
            parameters[6].Value  = model.SolveWay;
            parameters[7].Value  = model.ProblemType;
            parameters[8].Value  = model.FbDescribe;
            parameters[9].Value  = model.Solvestatic;
            parameters[10].Value = model.ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(AMS.Model.AMS_CallBackErrorInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into AMS_CallBackErrorInfo(");
            strSql.Append("SchoolId,FbPerson,MarkManID,FbTime,SolveManID,SolveTime,SolveWay,ProblemType,FbDescribe,Status)");
            strSql.Append(" values (");
            strSql.Append("@SchoolId,@FbPerson,@MarkManID,@FbTime,@SolveManID,@SolveTime,@SolveWay,@ProblemType,@FbDescribe,@Status)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SchoolId",    SqlDbType.Int,         4),
                new SqlParameter("@FbPerson",    SqlDbType.NVarChar,   20),
                new SqlParameter("@MarkManID",   SqlDbType.Int,         4),
                new SqlParameter("@FbTime",      SqlDbType.DateTime),
                new SqlParameter("@SolveManID",  SqlDbType.Int,         4),
                new SqlParameter("@SolveTime",   SqlDbType.DateTime),
                new SqlParameter("@SolveWay",    SqlDbType.NVarChar,  500),
                new SqlParameter("@ProblemType", SqlDbType.Int,         4),
                new SqlParameter("@FbDescribe",  SqlDbType.NVarChar,  500),
                new SqlParameter("@Status",      SqlDbType.Int, 4)
            };
            parameters[0].Value = model.SchoolId;
            parameters[1].Value = model.FbPerson;
            parameters[2].Value = model.MarkManID;
            parameters[3].Value = model.FbTime;
            parameters[4].Value = model.SolveManID;
            parameters[5].Value = model.SolveTime;
            parameters[6].Value = model.SolveWay;
            parameters[7].Value = model.ProblemType;
            parameters[8].Value = model.FbDescribe;
            parameters[9].Value = model.Solvestatic;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 添加新的反馈信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static string AddNewCallBackInfo(AMS.Model.AMS_CallBackErrorInfo model)
 {
     AMS.IBllService.IAdvertManageBllService bllService = AMS.ServiceConnectChannel.AdvertManageBllServiceChannel.CreateServiceChannel();
     try
     {
         return(bllService.AddNewCallBackInfo(model));
     }
     catch (EndpointNotFoundException ex)
     {
         throw new AMS.Model.CustomerException("连接服务器失败");
     }
     catch (CommunicationException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         ICommunicationObject ICommObjectService = bllService as ICommunicationObject;
         try
         {
             if (ICommObjectService.State == CommunicationState.Faulted)
             {
                 ICommObjectService.Abort();
             }
             else
             {
                 ICommObjectService.Close();
             }
         }
         catch
         {
             ICommObjectService.Abort();
         }
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public AMS.Model.AMS_CallBackErrorInfo GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,SchoolId,FbPerson,MarkManID,FbTime,SolveManID,SolveTime,SolveWay,ProblemType,FbDescribe from AMS_CallBackErrorInfo ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            AMS.Model.AMS_CallBackErrorInfo model = new AMS.Model.AMS_CallBackErrorInfo();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"] != null && ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SchoolId"] != null && ds.Tables[0].Rows[0]["SchoolId"].ToString() != "")
                {
                    model.SchoolId = int.Parse(ds.Tables[0].Rows[0]["SchoolId"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FbPerson"] != null && ds.Tables[0].Rows[0]["FbPerson"].ToString() != "")
                {
                    model.FbPerson = ds.Tables[0].Rows[0]["FbPerson"].ToString();
                }
                if (ds.Tables[0].Rows[0]["MarkManID"] != null && ds.Tables[0].Rows[0]["MarkManID"].ToString() != "")
                {
                    model.MarkManID = int.Parse(ds.Tables[0].Rows[0]["MarkManID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FbTime"] != null && ds.Tables[0].Rows[0]["FbTime"].ToString() != "")
                {
                    model.FbTime = DateTime.Parse(ds.Tables[0].Rows[0]["FbTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SolveManID"] != null && ds.Tables[0].Rows[0]["SolveManID"].ToString() != "")
                {
                    model.SolveManID = int.Parse(ds.Tables[0].Rows[0]["SolveManID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SolveTime"] != null && ds.Tables[0].Rows[0]["SolveTime"].ToString() != "")
                {
                    model.SolveTime = DateTime.Parse(ds.Tables[0].Rows[0]["SolveTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SolveWay"] != null && ds.Tables[0].Rows[0]["SolveWay"].ToString() != "")
                {
                    model.SolveWay = ds.Tables[0].Rows[0]["SolveWay"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ProblemType"] != null && ds.Tables[0].Rows[0]["ProblemType"].ToString() != "")
                {
                    model.ProblemType = int.Parse(ds.Tables[0].Rows[0]["ProblemType"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FbDescribe"] != null && ds.Tables[0].Rows[0]["FbDescribe"].ToString() != "")
                {
                    model.FbDescribe = ds.Tables[0].Rows[0]["FbDescribe"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }