示例#1
0
        //删除机构
        public void Delete_Click(object sender, EventArgs e)
        {
            int AgencyID = agen.SelectAgencyID(AgencyName2.Text.Trim());
            int level    = Convert.ToInt32(Session["SecrecyLevel"]);

            if (level == 5)
            {
                agen.Delete(AgencyID);
                BindData();
                Clear();
                BindPeople();
                Delete.Enabled = false;
                Alert.ShowInTop("删除数据成功!");

                return;
            }
            Common.Entities.Agency ag = new Common.Entities.Agency();
            ag = agen.FindByName(AgencyName2.Text.Trim());
            OperationLog op = new OperationLog();

            BLHelper.BLLOperationLog blop = new BLLOperationLog();

            if (ag.EntryPerson != Session["LoginName"].ToString())
            {
                string str = "您无对此机构操作的权限!此机构信息为" + ag.EntryPerson + "录入,请与管理员联系!";
                Alert.ShowInTop(str);
                return;
            }
            else
            {
                agen.UpdatePass(AgencyID, false);
                op.LoginIP          = "";
                op.LoginName        = Session["LoginName"].ToString();
                op.OperationContent = "Agency";
                op.OperationDataID  = AgencyID;
                op.OperationType    = "删除";
                op.OperationTime    = DateTime.Now;
                blop.Insert(op);
                BindData();
                Alert.ShowInTop("数据已提交,请等待管理员确认!");
            }
            Clear();
        }