Exemple #1
0
        /// <summary>
        /// �����ϴ��ļ���Ϣ���������ݿ⣩
        /// </summary>
        /// <param name="id">��ϢId</param>
        private static void SavaUploadFile(Int64 id)
        {
            string DelIDs = XYECOM.Core.XYRequest.GetFormString("_Upload_DelIDs");
            string UpIDs = XYECOM.Core.XYRequest.GetFormString("_Upload_UpIDs");
            string TableName = XYECOM.Core.XYRequest.GetFormString("_Upload_TabName");

            XYECOM.Business.Attachment obj = new XYECOM.Business.Attachment();
            //ɾ����Ϣ
            if ("" != DelIDs)
            {
                obj.Delete(DelIDs);

                //ɾ������ʱͬʱ���¸�����Ӧ����Ϣ�� IsHasImage �ֶε�ֵ
                //IsHasImage �ֶα�ʾ��Ϣ�Ƿ����ͼƬ
                if (id > 0)
                    obj.UpdateInfoIsHasImage(TableName, id);
            }
            //������Ϣ
            if ("" != UpIDs)
            {
                obj.Update(UpIDs, id);
            }
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            XYECOM.Business.Attachment bll = new XYECOM.Business.Attachment();

            string ids = "";

            foreach (GridViewRow GR in this.gvList.Rows)
            {
                if (((CheckBox)(GR.FindControl("chkExport"))).Checked == true)
                {
                    ids += "," + this.gvList.DataKeys[GR.DataItemIndex].Value.ToString();
                }
            }

            if (ids.IndexOf(",") == 0)
            {
                ids = ids.Substring(1);
                int i = bll.Delete(ids);
                if (i >= 0)
                {
                    BindData();
                }
                else
                {
                    this.ClientScript.RegisterClientScriptBlock(GetType(), "01", "<script>sAlert(\"ɾ��ʧ�ܣ�\")</script>");
                }
            }
        }