Exemplo n.º 1
0
        /// <summary>
        /// 添加投诉信息
        /// </summary>
        /// <param name="com"></param>
        /// <returns></returns>
        public bool AddComplaints(HCQ2_Model.AppModel.Complaints com)
        {
            T_Complaints aCom = new T_Complaints();
            T_User       user = new T_UserBLL().Select(o => o.user_guid == com.userid).FirstOrDefault();

            aCom.c_title   = com.title;
            aCom.c_content = com.content;
            if (com.image != null)
            {
                aCom.c_image = Convert.FromBase64String(com.image);
            }
            aCom.create_date = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            aCom.create_guid = com.userid;
            A01 data = new A01BLL().Select(o => o.A0177 == user.user_identify)[0];

            aCom.create_identifycode = user.user_identify;
            aCom.create_personid     = data.A0101;

            StringBuilder sbSql = new StringBuilder();

            sbSql.AppendFormat("select top 1 * from a01 where a0177='{0}'", user.user_identify);
            DataTable dt = HCQ2_Common.SQL.SqlHelper.ExecuteDataTable(sbSql.ToString());

            if (dt != null)
            {
                sbSql = new StringBuilder();
                if (!string.IsNullOrEmpty(dt.Rows[0]["B0002"].ToString()))
                {
                    sbSql.AppendFormat("select UnitName from B01 where UnitID='{0}'", dt.Rows[0]["B0002"]);
                }
                else
                {
                    sbSql.AppendFormat("select UnitName from B01 where UnitID='{0}'", dt.Rows[0]["B0001"]);
                }
                aCom.unit_name = HCQ2_Common.SQL.SqlHelper.ExecuteScalar(sbSql.ToString()).ToString();
            }

            return(Add(aCom) > 0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据guid获取投诉信息
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public List <T_Complaints> GetByGuid(string guid)
        {
            T_User user = new T_UserBLL().Select(o => o.user_guid == guid).FirstOrDefault();

            return(Select(o => o.create_identifycode == user.user_identify));
        }