示例#1
0
        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");
            StockCheck     scEnt   = null;
            IList <String> strList = RequestData.GetList <string>("data");

            switch (RequestActionString)
            {
            case "update":
                scEnt = this.GetMergedData <StockCheck>();
                scEnt.DoUpdate();
                ProcessDetail(strList, scEnt);
                break;

            case "create":
                scEnt       = this.GetPostedData <StockCheck>();
                scEnt.State = "未结束";
                scEnt.DoCreate();
                ProcessDetail(strList, scEnt);
                break;

            case "delete":
                scEnt = this.GetTargetData <StockCheck>();
                scEnt.DoDelete();
                return;

            default:
                if (op != "c" && op != "cs")
                {
                    if (!String.IsNullOrEmpty(id))
                    {
                        scEnt = StockCheck.Find(id);
                        SetFormData(scEnt);
                        IList <StockCheckDetail> scdEnts = StockCheckDetail.FindAllByProperty("StockCheckId", id);
                        PageState.Add("DataList", scdEnts);
                    }
                }
                else
                {
                    PageState.Add("StockCheckNo", DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_getStockCheckNo()"));
                    this.PageState.Add("FlowEnum", SysEnumeration.GetEnumDictList("WorkFlow.Simple"));
                    if (RequestActionString == "submitfinish")
                    {
                        StockCheck pc = StockCheck.Find(this.RequestData.Get <string>("id"));
                        pc.State = "End";
                        // pc.InventoryState = this.RequestData.Get<string>("ApprovalState");
                        pc.Save();
                    }
                }
                break;
            }
        }
        public void StartFlow()
        {
            string     state = this.RequestData.Get <string>("state");
            string     id    = this.RequestData.Get <string>("Id");
            StockCheck pb    = StockCheck.Find(id);

            pb.State = state;
            pb.Save();
            string code = this.RequestData.Get <string>("FlowKey");

            //启动流程
            //表单路径,后面加上参数传入
            string formUrl = "/StockManagement/FrmInventoryView.aspx?op=u&&id=" + id;
            Guid   guid    = Aim.WorkFlow.WorkFlow.StartWorkFlow(id, formUrl, "仓库盘点异常审批(" + pb.StockCheckNo + ")[" + pb.CreateName + "]", code, this.UserInfo.UserID, this.UserInfo.Name);

            this.PageState.Add("FlowId", guid.ToString());
        }