示例#1
0
        private void btEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            if (gridView1.GetFocusedRow() == null)
                return;
            sd_tsqy tsqy = gridView1.GetFocusedRow() as sd_tsqy;
            frmsd_tsqyEdit frmtsqy = new frmsd_tsqyEdit();
            frmtsqy.sdxl = this.parentObj;
            frmtsqy.tsqyzl = this.parentType;
            frmtsqy.RowData = tsqy;
            if (frmtsqy.ShowDialog() == DialogResult.OK) {
                Client.ClientHelper.PlatformSqlMap.Update<sd_tsqy>(tsqy);
                if (frmtsqy.ispicChange) {
                    sd_tsqyimage tsqyImage = frmtsqy.GetPS_Image();
                    if (tsqyImage == null) {
                        tsqyImage = new sd_tsqyimage();
                        tsqyImage.ParentID = tsqy.ID;
                        //tsqyImage.data = (byte[])frmtsqy.GetImage();
                        Client.ClientHelper.PlatformSqlMap.Create<sd_tsqyimage>(tsqyImage);
                    } else {
                        tsqyImage.ParentID = tsqy.ID;
                        //tsqyImage.data = (byte[])frmtsqy.GetImage();
                        if (tsqyImage.data == null)
                            tsqyImage.data = new byte[] { 0 };

                        Client.ClientHelper.PlatformSqlMap.Update<sd_tsqyimage>(tsqyImage);
                    }
                }
                //RefreshData();
            }
        }
示例#2
0
        private void btAdds_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {

            frmsd_tsqyEdit frmtsqy = new frmsd_tsqyEdit();
            sd_tsqy tsqy = new sd_tsqy();
            tsqy.OrgCode = parentObj.OrgCode;
            tsqy.LineID = parentObj.LineID;
            tsqy.zldm = parentType.zldm;
            tsqy.createdate = DateTime.Now;
            tsqy.createman = MainHelper.User.UserName;
            frmtsqy.sdxl = this.parentObj;
            frmtsqy.tsqyzl = this.parentType;
            frmtsqy.RowData = tsqy;
            if (frmtsqy.ShowDialog() == DialogResult.OK) {
                Client.ClientHelper.PlatformSqlMap.Create<sd_tsqy>(frmtsqy.RowData);
                if (frmtsqy.GetImage() != null) {
                    sd_tsqyimage tsqyImage = new sd_tsqyimage();
                    tsqyImage.ParentID = tsqy.ID;
                    tsqyImage.data = (byte[])frmtsqy.GetImage();
                    Client.ClientHelper.PlatformSqlMap.Create<sd_tsqyimage>(tsqyImage);

                }
                RefreshData();
            }
        }