Ejemplo n.º 1
0
        /// <summary>
        ///上传表井图片
        /// </summary>
        public string InsertIntoWellImage(string base64Photo, int id, string TableName, string desc)
        {
            string result = "";

            try
            {
                if (base64Photo != "")//有图片上传图片后更新描述
                {
                    if (Data_dal.ReceiveWellImage(base64Photo, id, TableName) > 0)
                    {
                        //更新设施描述
                        Data_dal.UpdateDescription(TableName, id, desc);
                        result = @"[{""result"":成功}]";
                    }
                    else
                    {
                        result = @"[{""result"":失败}]";
                    }
                }
                else//无图片直接更新描述
                {
                    //更新设施描述
                    int i = Data_dal.UpdateDescription(TableName, id, desc);
                    if (i > 0)
                    {
                        result = @"[{""result"":成功}]";
                    }
                    else
                    {
                        result = @"[{""result"":失败}]";
                    }
                }
            }
            catch (Exception)
            {
                System.Web.HttpContext.Current.Response.Write("<script>alert(" + err + ")</script>");
            }
            return(result);
        }