Exemplo n.º 1
0
        public static Int64 CreateBlankDictID(string frmID, string userNo, Hashtable htParas)
        {
            FrmBill fb = new FrmBill(frmID);

            //创建rpt.
            BP.WF.Data.GERpt rpt = new BP.WF.Data.GERpt(frmID);

            //int i= rpt.Retrieve("Starter", WebUser.No, "BillState", 0);
            //if (i >= 1)
            //{
            //    rpt.SetValByKey("RDT", DataType.CurrentData);
            //    return rpt.OID;
            //}

            //更新基础的数据到表单表.
            rpt.SetValByKey("BillState", 0);
            rpt.SetValByKey("Starter", WebUser.No);
            rpt.SetValByKey("StarterName", WebUser.Name);
            rpt.SetValByKey("RDT", DataType.CurrentData);

            rpt.EnMap.CodeStruct = fb.EnMap.CodeStruct;

            //rpt.SetValByKey("Title", gb.Title);
            rpt.SetValByKey("BillNo", rpt.GenerNewNoByKey("BillNo"));
            rpt.OID = DBAccess.GenerOID(frmID);
            rpt.InsertAsOID(rpt.OID);
            return(rpt.OID);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 创建工作ID
        /// </summary>
        /// <param name="frmID">表单ID</param>
        /// <param name="userNo">用户编号</param>
        /// <param name="htParas">参数</param>
        /// <returns>一个新的WorkID</returns>
        public static Int64 CreateBlankBillID(string frmID, string userNo, Hashtable htParas)
        {
            GenerBill gb = new GenerBill();
            int       i  = gb.Retrieve(GenerBillAttr.FrmID, frmID, GenerBillAttr.Starter, userNo, GenerBillAttr.BillState, 0);

            if (i == 1)
            {
                return(gb.WorkID);
            }

            FrmBill fb = new FrmBill(frmID);

            gb.WorkID      = BP.DA.DBAccess.GenerOID("WorkID");
            gb.BillState   = BillState.None; //初始化状态.
            gb.Starter     = BP.Web.WebUser.No;
            gb.StarterName = BP.Web.WebUser.Name;
            gb.FrmName     = fb.Name;       //单据名称.
            gb.FrmID       = fb.No;         //单据ID

            gb.FK_FrmTree = fb.FK_FormTree; //单据类别.
            gb.RDT        = BP.DA.DataType.CurrentDataTime;
            gb.NDStep     = 1;
            gb.NDStepName = "启动";

            //创建rpt.
            BP.WF.Data.GERpt rpt = new BP.WF.Data.GERpt(frmID);

            //设置标题.
            if (fb.EntityType == EntityType.FrmBill)
            {
                gb.Title  = Dev2Interface.GenerTitle(fb.TitleRole, rpt);
                gb.BillNo = BP.Frm.Dev2Interface.GenerBillNo(fb.BillNoFormat, gb.WorkID, null, frmID);
            }

            if (fb.EntityType == EntityType.EntityTree || fb.EntityType == EntityType.FrmDict)
            {
                rpt.EnMap.CodeStruct = fb.EnMap.CodeStruct;
                gb.BillNo            = rpt.GenerNewNoByKey("BillNo");
                // BP.Frm.Dev2Interface.GenerBillNo(fb.BillNoFormat, gb.WorkID, null, frmID);
                gb.Title = "";
            }

            gb.DirectInsert(); //执行插入.

            //更新基础的数据到表单表.
            // rpt = new BP.WF.Data.GERpt(frmID);
            rpt.SetValByKey("BillState", (int)gb.BillState);
            rpt.SetValByKey("Starter", gb.Starter);
            rpt.SetValByKey("StarterName", gb.StarterName);
            rpt.SetValByKey("RDT", gb.RDT);
            rpt.SetValByKey("Title", gb.Title);
            rpt.SetValByKey("BillNo", gb.BillNo);
            rpt.OID = gb.WorkID;
            rpt.InsertAsOID(gb.WorkID);

            return(gb.WorkID);
        }