コード例 #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        EciRequest request = new EciRequest(MESService.MesBdZySave);

        request.IsAdd = this.key.NullOrEmpty();

        MES_BD_ZY saveEntity = new MES_BD_ZY();

        request.Entity = saveEntity;

        saveEntity.Data = this.GetEntityFromUI().Data;

        saveEntity.GUID = this.key;

        if (txtFileUpload.HasFile)
        {
            btnUpload_Click(sender, e);

            saveEntity.PIC1_PATH = this.hidPic1Path.Value;
            saveEntity.PIC1      = this.hidPic1.Value;
        }
        if (txtFileUpload2.HasFile)
        {
            btnUpload2_Click(sender, e);

            saveEntity.PIC2_PATH = this.hidPIC2Path.Value;
            saveEntity.PIC2      = this.hidPIC2.Value;
        }
        EciResponse response = SOA.Execute(request);

        MES_BD_ZY data = response.Entity.Upgrade <MES_BD_ZY>();

        if (request.IsAdd)
        {
            this.key = data.GUID;

            this.btnAdd.Enabled = true;
            HtmlWindow.Onload("eci.open('frmMesBdZyEditTab.aspx?key=" + this.key + "')");
        }
        response.Message.Tip();
    }