Example #1
0
        public string seltype = string.Empty; //是否单选

        protected void Page_Load(object sender, EventArgs e)
        {
            string Id = this.RequestData.Get <string>("Id");

            IntegratedManage.Model.LeaderBusinessTrip ent = null;
            seltype = string.IsNullOrEmpty(RequestData.Get <string>("id")) ? "seltype='multi'" : "";

            switch (this.RequestActionString)
            {
            case "update":
                ent = this.GetMergedData <IntegratedManage.Model.LeaderBusinessTrip>();
                ent.DoUpdate();
                this.PageState.Add("Id", ent.Id);
                break;

            case "create":

                ent = this.GetPostedData <IntegratedManage.Model.LeaderBusinessTrip>();
                if (string.IsNullOrEmpty(ent.LeaderId))
                {
                    ent.LeaderId   = UserInfo.UserID;
                    ent.LeaderName = UserInfo.Name;
                }
                ent.State = "0";
                DoCreteMutiPerson(ent);
                this.PageState.Add("Id", ent.Id);
                this.PageState.Add("StartDate", ent.TripStartTime);
                this.PageState.Add("EndDate", ent.TripEndTime);
                break;

            case "delete":     //删除
                if (!string.IsNullOrEmpty(Id))
                {
                    ent = IntegratedManage.Model.LeaderBusinessTrip.Find(Id);
                    ent.DoDelete();
                }
                break;

            case "endTrip":
                ent       = this.GetMergedData <IntegratedManage.Model.LeaderBusinessTrip>();
                ent.State = "1";
                ent.DoUpdate();
                break;

            case "checkDate":
                CheckDate();
                break;

            default:
                DoSelect();
                break;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            IntegratedManage.Model.LeaderBusinessTrip ent = null;
            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <IntegratedManage.Model.LeaderBusinessTrip>();
                ent.DoDelete();
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    DoBatchDelete();
                }
                else
                {
                    DoSelect();
                }
                break;
            }
        }