Пример #1
0
        private void Delete()
        {
            string ids = Request["Jarray"];

            string[] array = ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < array.Length; i++)
            {
                ProjectUser.DeleteAll("ProjectId='" + array[i] + "'");
                sql = "delete NCRL_SP..ExamineMeeting where Id='" + array[i] + "'";
                DataHelper.ExecSql(sql);
            }
        }
        string type = String.Empty; // 对象类型
        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");
            IList <string> projectUser = RequestData.GetList <string>("projectUser");

            Project ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                ent        = this.GetMergedData <Project>();
                ent.Status = "已提交";
                ent.DoUpdate();
                ///专家
                ProjectUser.DeleteAll("ProjectId='" + ent.Id + "'");


                ProjectUserDetail(projectUser, ent);

                this.SetMessage("修改成功!");
                break;

            case RequestActionEnum.Insert:
            case RequestActionEnum.Create:
                ent = this.GetPostedData <Project>();
                ent.DoCreate();

                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <Project>();
                ent.DoDelete();

                break;

            default:
                DoSelect();
                break;
            }

            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = Project.Find(id);
                }
                this.SetFormData(ent);
            }
        }
        private void Delete()
        {
            string Id = Request["Id"];

            if (!string.IsNullOrEmpty(Id))
            {
                ProjectUser.DeleteAll("ProjectId='" + Id + "'");
                SubProject.DeleteAll("ProjectId='" + Id + "'");
                KanChaSheJi.DeleteAll("ProjectId='" + Id + "'");
                sql = "delete NCRL_SP..Project where Id='" + Id + "'";
                DataHelper.ExecSql(sql);
            }
        }