Esempio n. 1
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        IntendanceMasterAction    intendanceMasterAction    = new IntendanceMasterAction();
        IntendancePhotoListAction intendancePhotoListAction = new IntendancePhotoListAction();
        DataTable photoInfoList = intendancePhotoListAction.GetPhotoInfoList(this.hdnIntendanceGuid.Value);
        string    text;

        if (photoInfoList.Rows.Count > 0)
        {
            for (int i = 0; i < photoInfoList.Rows.Count; i++)
            {
                MakeThumbnail makeThumbnail = new MakeThumbnail();
                if (makeThumbnail.DelThumbnai(photoInfoList.Rows[i]["NoteId"].ToString()))
                {
                }
            }
            if (intendancePhotoListAction.ClearPhotosList(this.hdnIntendanceGuid.Value) > 0)
            {
                text = "1";
            }
            else
            {
                text = "删除失败";
            }
        }
        else
        {
            text = "1";
        }
        if (!(text == "1"))
        {
            this.js.Text = "alert('" + text + "!');";
            return;
        }
        if (intendanceMasterAction.Del(this.hdnIntendanceGuid.Value) > 0)
        {
            this.js.Text = "alert('删除成功!');";
            this.DataBindToPage("");
            return;
        }
        this.js.Text = "alert('删除失败!');";
    }
Esempio n. 2
0
    public static string DelPhotosItem(string noteId)
    {
        IntendancePhotoListAction intendancePhotoListAction = new IntendancePhotoListAction();
        IntendancePhotoList       singlePhotoInfo           = intendancePhotoListAction.GetSinglePhotoInfo(new Guid(noteId));
        string result = "";

        if (singlePhotoInfo != null && intendancePhotoListAction.DelAnnex(singlePhotoInfo) > 0)
        {
            MakeThumbnail makeThumbnail = new MakeThumbnail();
            if (makeThumbnail.DelThumbnai(singlePhotoInfo.NoteId.ToString()))
            {
                result = "1";
            }
            else
            {
                result = "删除失败";
            }
        }
        return(result);
    }