Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            isoneself = "1" == Request.QueryString["isoneself"];
            if (isoneself)
            {
                this.S_UserID.Disabled = true;
                this.S_UserID.Value    = FoWoSoft.Platform.Users.PREFIX + FoWoSoft.Platform.Users.CurrentUserID.ToString();
            }
            FoWoSoft.Platform.WorkFlowDelegation bworkFlowDelegation = new FoWoSoft.Platform.WorkFlowDelegation();
            FoWoSoft.Platform.Organize           borganize           = new FoWoSoft.Platform.Organize();
            FoWoSoft.Platform.Users    busers    = new FoWoSoft.Platform.Users();
            FoWoSoft.Platform.WorkFlow bworkFlow = new FoWoSoft.Platform.WorkFlow();

            string startTime = string.Empty;
            string endTime   = string.Empty;
            string suserid   = string.Empty;
            string Query1    = string.Format("&appid={0}&tabid={1}&isoneself={2}", Request.QueryString["appid"],
                                             Request.QueryString["tabid"], Request.QueryString["isoneself"]);

            if (IsPostBack)
            {
                if (!Request.Form["DeleteBut"].IsNullOrEmpty())
                {
                    string ids = Request.Form["checkbox_app"];
                    foreach (string id in ids.Split(','))
                    {
                        Guid bid;
                        if (!id.IsGuid(out bid))
                        {
                            continue;
                        }
                        var comment = bworkFlowDelegation.Get(bid);
                        if (comment != null)
                        {
                            bworkFlowDelegation.Delete(bid);
                            FoWoSoft.Platform.Log.Add("删除了流程意见", comment.Serialize(), FoWoSoft.Platform.Log.Types.流程相关);
                        }
                    }
                    bworkFlowDelegation.RefreshCache();
                }
                startTime = Request.Form["S_StartTime"];
                endTime   = Request.Form["S_EndTime"];
                suserid   = Request.Form["S_UserID"];
            }
            else
            {
                startTime = Request.QueryString["S_StartTime"];
                endTime   = Request.QueryString["S_EndTime"];
                suserid   = Request.QueryString["S_UserID"];
            }
            Query1 += "&S_StartTime=" + startTime + "&S_EndTime=" + endTime + "&S_UserID=" + suserid;
            string pager;
            bool   isOneSelf = "1" == Request.QueryString["isoneself"];

            if (isOneSelf)
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, Query1, FoWoSoft.Platform.Users.CurrentUserID.ToString(), startTime, endTime);
            }
            else
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, Query1, FoWoSoft.Platform.Users.RemovePrefix(suserid), startTime, endTime);
            }
            this.Pager.Text = pager;
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];

            string UserID    = string.Empty;
            string ToUserID  = string.Empty;
            string StartTime = string.Empty;
            string EndTime   = string.Empty;
            string FlowID    = string.Empty;
            string Note      = string.Empty;

            isOneSelf = "1" == Request.QueryString["isoneself"];

            Guid delegationID;

            if (id.IsGuid(out delegationID))
            {
                workFlowDelegation = bworkFlowDelegation.Get(delegationID);
                if (workFlowDelegation != null)
                {
                    FlowID = workFlowDelegation.FlowID.ToString();
                }
            }
            string oldXML = workFlowDelegation.Serialize();

            if (IsPostBack)
            {
                UserID    = Request.Form["UserID"];
                ToUserID  = Request.Form["ToUserID"];
                StartTime = Request.Form["StartTime"];
                EndTime   = Request.Form["EndTime"];
                FlowID    = Request.Form["FlowID"];
                Note      = Request.Form["Note"];

                bool isAdd = !id.IsGuid();
                if (workFlowDelegation == null)
                {
                    workFlowDelegation    = new FoWoSoft.Data.Model.WorkFlowDelegation();
                    workFlowDelegation.ID = Guid.NewGuid();
                }
                workFlowDelegation.UserID  = isOneSelf ? FoWoSoft.Platform.Users.CurrentUserID : FoWoSoft.Platform.Users.RemovePrefix(UserID).ToGuid();
                workFlowDelegation.EndTime = EndTime.ToDateTime();
                if (FlowID.IsGuid())
                {
                    workFlowDelegation.FlowID = FlowID.ToGuid();
                }
                workFlowDelegation.Note      = Note.IsNullOrEmpty() ? null : Note;
                workFlowDelegation.StartTime = StartTime.ToDateTime();
                workFlowDelegation.ToUserID  = FoWoSoft.Platform.Users.RemovePrefix(ToUserID).ToGuid();
                workFlowDelegation.WriteTime = FoWoSoft.Utility.DateTimeNew.Now;

                if (isAdd)
                {
                    bworkFlowDelegation.Add(workFlowDelegation);
                    FoWoSoft.Platform.Log.Add("添加了工作委托", workFlowDelegation.Serialize(), FoWoSoft.Platform.Log.Types.流程相关);
                }
                else
                {
                    bworkFlowDelegation.Update(workFlowDelegation);
                    FoWoSoft.Platform.Log.Add("修改了工作委托", "", FoWoSoft.Platform.Log.Types.流程相关, oldXML, workFlowDelegation.Serialize());
                }
                bworkFlowDelegation.RefreshCache();
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('保存成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true);
            }
            FlowOptions = new FoWoSoft.Platform.WorkFlow().GetOptions(FlowID);
            if (workFlowDelegation == null)
            {
                workFlowDelegation = new FoWoSoft.Data.Model.WorkFlowDelegation();
            }
        }