Beispiel #1
0
        protected void Btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.FK_MapData.Replace("ND", "") == this.FK_Node.ToString())
                {
                    this.SaveNode();
                    return;
                }

                MapData  md = new MapData(this.FK_MapData);
                GEEntity en = md.HisGEEn;
                en.SetValByKey("OID", this.OIDPKVal);
                int i = en.RetrieveFromDBSources();
                en = this.UCEn1.Copy(en) as GEEntity;
                FrmEvents fes = md.FrmEvents;
                //new FrmEvents(this.FK_MapData);
                fes.DoEventNode(FrmEventList.SaveBefore, en);
                if (i == 0)
                {
                    en.Insert();
                }
                else
                {
                    en.Update();
                }
                fes.DoEventNode(FrmEventList.SaveAfter, en);
                //this.Response.Redirect("Frm.aspx?OID=" + en.GetValStringByKey("OID") + "&FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&FK_MapData=" + this.FK_MapData, true);
            }
            catch (Exception ex)
            {
                this.UCEn1.AddMsgOfWarning("error:", ex.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 执行保存
        /// </summary>
        /// <returns></returns>
        public string MyDict_SaveIt()
        {
            //执行保存.
            GEEntity rpt = new GEEntity(this.FrmID, this.WorkID);

            rpt = BP.Sys.PubClass.CopyFromRequest(rpt, context.Request) as GEEntity;

            Hashtable ht = GetMainTableHT();

            foreach (string item in ht.Keys)
            {
                rpt.SetValByKey(item, ht[item]);
            }

            rpt.OID = this.WorkID;
            rpt.SetValByKey("BillState", (int)BillState.Editing);
            rpt.Update();

            string str = BP.Frm.Dev2Interface.SaveWork(this.FrmID, this.WorkID);

            return(str);
        }
Beispiel #3
0
        protected void Btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                MapData md = new MapData(this.FK_MapData);
                //判断与节点编号相同,并且是节点表单类型才可以保存
                if (this.FK_MapData.Replace("ND", "") == this.FK_Node.ToString() && md.AppType == "1")
                {
                    this.SaveNode();
                    return;
                }

                GEEntity en = md.HisGEEn;
                en.SetValByKey("OID", this.OIDPKVal);
                int i = en.RetrieveFromDBSources();
                en = this.UCEn1.Copy(en) as GEEntity;
                FrmEvents fes = md.FrmEvents;
                //new FrmEvents(this.FK_MapData);
                fes.DoEventNode(FrmEventList.SaveBefore, en);

                //#region 检查是否有ca签名.
                //if (md.IsHaveCA == true)
                //{
                //    if (!string.IsNullOrEmpty(this.TB_SealData.Text))
                //    {
                //        BP.Tools.WFSealData sealData = new BP.Tools.WFSealData();
                //        sealData.RetrieveByAttrAnd(BP.Tools.WFSealDataAttr.OID, WorkID, BP.Tools.WFSealDataAttr.FK_Node, FK_Node);


                //        if (string.IsNullOrEmpty(sealData.OID))
                //        {
                //            sealData.MyPK = DBAccess.GenerGUID();
                //            sealData.OID = WorkID;
                //            sealData.FK_Node = FK_Node.ToString();
                //            sealData.SealData = this.TB_SealData.Text;
                //            sealData.RDT = DataType.CurrentDataTime;
                //            sealData.FK_MapData = this.FK_MapData;
                //            sealData.Insert();
                //        }
                //        else
                //        {
                //            sealData.SealData = this.TB_SealData.Text;
                //            sealData.RDT = DataType.CurrentDataTime;
                //            sealData.Update();
                //        }


                //        byte[] data = System.Convert.FromBase64String(TB_SingData.Text);

                //        if (data.Length != 0)
                //        {
                //            System.IO.MemoryStream MS = new System.IO.MemoryStream(data);
                //            System.Drawing.Bitmap image = new System.Drawing.Bitmap(MS);
                //            image.Save(TB_SealFile.Text, System.Drawing.Imaging.ImageFormat.Jpeg);
                //        }
                //    }
                //}
                //#endregion 检查是否有ca签名.

                if (i == 0)
                {
                    en.Insert();
                }
                else
                {
                    en.Update();
                }

                fes.DoEventNode(FrmEventList.SaveAfter, en);

                //this.Response.Redirect("Frm.aspx?OID=" + en.GetValStringByKey("OID") + "&FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&FK_MapData=" + this.FK_MapData, true);
            }
            catch (Exception ex)
            {
                this.UCEn1.AddMsgOfWarning("error:", ex.Message);
            }
        }