Esempio n. 1
0
        private ItemPic[] GetItemPic()
        {
            ItemPic[] entity = new ItemPic[1];
            for (int i = 0; i < 1; i++)
            {
                entity[i]        = new ItemPic();
                entity[i].MainID = HTDataID;
                entity[i].Seq    = i + 1;
                entity[i].SelectByID();

                if (i == 0)
                {
                    entity[i].PicImage = TemplatePic.ImageToByte(pictureBox1.Image);
                }
            }

            return(entity);
        }
Esempio n. 2
0
        //private void btnPicNewBrowsing_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        if (m_ID == 0)
        //        {
        //            this.ShowMessage("请先保存数据");
        //            return;
        //        }


        //        openFileDialog1.Filter = "JPG文件(*.jpg)|*.jpg|GIF文件(*.gif)|*.gif|BMP文件(*.bmp)|*.bmp|全部文件(*.*)|*.*";
        //        if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
        //        {
        //            string filenamerount = openFileDialog1.FileName;
        //            img1.Image = Image.FromFile(filenamerount);
        //        }
        //    }
        //    catch (Exception E)
        //    {
        //        this.ShowMessage(E.Message);
        //    }
        //}


        private ItemGB GetItemGB()
        {
            ItemGB entity = new ItemGB();

            entity.ID = m_DID;
            entity.SelectByID();
            entity.MainID = m_ID;
            if (entity.Seq == 0)
            {
                entity.Seq = GetMaxSeq(m_ID);
            }
            entity.ColorName  = txtColorName.Text.Trim();
            entity.ColorNum   = txtColorNum.Text.Trim();
            entity.GBCode     = txtGBCode.Text.Trim();
            entity.XY         = SysConvert.ToInt32(drpXY.EditValue);
            entity.GBStatusID = SysConvert.ToInt32(drpGBStatusID.EditValue);


            if (ucPictureInput1.UCDataLstImage.Count > 0)
            {
                entity.GBPic = TemplatePic.ImageToByte(ucPictureInput1.UCDataLstImage[0]);
                if (ucPictureInput1.UCDataLstSmallImage.Count > 0)
                {
                    entity.GBPic2 = TemplatePic.ImageToByte(ucPictureInput1.UCDataLstSmallImage[0]);
                }
            }
            else
            {
                entity.GBPic  = new byte[2];
                entity.GBPic2 = new byte[2];
            }
            entity.Remark   = txtDRemark.Text.Trim();
            entity.GBDate   = drpGBDate.DateTime.Date;
            entity.MWidth   = txtGMWidth.Text.Trim();
            entity.MWeight  = txtGMWeight.Text.Trim();
            entity.ItemName = txtGBItemName.Text.Trim();
            return(entity);
        }
Esempio n. 3
0
        private VendorFile GetSVendorFile()
        {
            VendorFile entity = new VendorFile();
            int        picNum = SysConvert.ToInt32(drpPicNum.EditValue);

            switch (picNum)
            {
            case 1:
                if (img1.Image != null)
                {
                    entity.Context    = TemplatePic.ImageToByte(img1.Image);
                    entity.FileTypeID = picNum;
                    entity.FileLength = SysConvert.ToDecimal(img1.Image.Width);
                    entity.UploadOPID = FParamConfig.LoginID;
                    entity.UploadTime = DateTime.Now.Date;
                    entity.Remark     = txtRemark1.Text.Trim();
                }
                break;

            case 2:
                if (img2.Image != null)
                {
                    entity.Context    = TemplatePic.ImageToByte(img2.Image);
                    entity.FileTypeID = picNum;
                    entity.FileLength = SysConvert.ToDecimal(img2.Image.Width);
                    entity.UploadOPID = FParamConfig.LoginID;
                    entity.UploadTime = DateTime.Now.Date;
                    entity.Remark     = txtRemark2.Text.Trim();
                }
                break;

            case 3:
                if (img3.Image != null)
                {
                    entity.Context    = TemplatePic.ImageToByte(img3.Image);
                    entity.FileTypeID = picNum;
                    entity.FileLength = SysConvert.ToDecimal(img3.Image.Width);
                    entity.UploadOPID = FParamConfig.LoginID;
                    entity.UploadTime = DateTime.Now.Date;
                    entity.Remark     = txtRemark3.Text.Trim();
                }
                break;

            case 4:
                if (img4.Image != null)
                {
                    entity.Context    = TemplatePic.ImageToByte(img4.Image);
                    entity.FileTypeID = picNum;
                    entity.FileLength = SysConvert.ToDecimal(img4.Image.Width);
                    entity.UploadOPID = FParamConfig.LoginID;
                    entity.UploadTime = DateTime.Now.Date;
                    entity.Remark     = txtRemark4.Text.Trim();
                }
                break;

            case 5:
                if (img5.Image != null)
                {
                    entity.Context    = TemplatePic.ImageToByte(img5.Image);
                    entity.FileTypeID = picNum;
                    entity.FileLength = SysConvert.ToDecimal(img5.Image.Width);
                    entity.UploadOPID = FParamConfig.LoginID;
                    entity.UploadTime = DateTime.Now.Date;
                    entity.Remark     = txtRemark5.Text.Trim();
                }
                break;

            default:
                break;
            }
            return(entity);
        }
Esempio n. 4
0
        private VDsignerFile[] GetVDsignerFile()
        {
            int Num = 0;

            byte[] pic;
            for (int i = 1; i < 6; i++)
            {
                switch (i)
                {
                case 1:
                    if (img1.Image != null)
                    {
                        Num++;
                    }
                    break;

                case 2:
                    if (img2.Image != null)
                    {
                        Num++;
                    }
                    break;

                case 3:
                    if (img3.Image != null)
                    {
                        Num++;
                    }
                    break;

                case 4:
                    if (img4.Image != null)
                    {
                        Num++;
                    }
                    break;

                case 5:
                    if (img5.Image != null)
                    {
                        Num++;
                    }
                    break;

                default:
                    break;
                }
            }
            VDsignerFile[] entityDts = new VDsignerFile[Num];
            int            index     = 0;

            for (int i = 1; i < 6; i++)
            {
                switch (i)
                {
                case 1:
                    if (img1.Image != null)
                    {
                        entityDts[index]        = new VDsignerFile();
                        entityDts[index].MainID = HTDataID;
                        entityDts[index].Seq    = i;
                        entityDts[index].SelectByID();
                        entityDts[index].Context    = TemplatePic.ImageToByte(img1.Image);
                        entityDts[index].FileTypeID = i;
                        entityDts[index].FileLength = SysConvert.ToDecimal(img1.Image.Width);
                        entityDts[index].UploadOPID = FParamConfig.LoginID;
                        entityDts[index].UploadTime = DateTime.Now.Date;
                        index++;
                    }
                    break;

                case 2:
                    if (img2.Image != null)
                    {
                        entityDts[index]        = new VDsignerFile();
                        entityDts[index].MainID = HTDataID;
                        entityDts[index].Seq    = i;
                        entityDts[index].SelectByID();
                        entityDts[index].Context    = TemplatePic.ImageToByte(img2.Image);
                        entityDts[index].FileTypeID = i;
                        entityDts[index].FileLength = SysConvert.ToDecimal(img2.Image.Width);
                        entityDts[index].UploadOPID = FParamConfig.LoginID;
                        entityDts[index].UploadTime = DateTime.Now.Date;
                        index++;
                    }
                    break;

                case 3:
                    if (img3.Image != null)
                    {
                        entityDts[index]        = new VDsignerFile();
                        entityDts[index].MainID = HTDataID;
                        entityDts[index].Seq    = i;
                        entityDts[index].SelectByID();
                        entityDts[index].Context    = TemplatePic.ImageToByte(img3.Image);
                        entityDts[index].FileTypeID = i;
                        entityDts[index].FileLength = SysConvert.ToDecimal(img3.Image.Width);
                        entityDts[index].UploadOPID = FParamConfig.LoginID;
                        entityDts[index].UploadTime = DateTime.Now.Date;
                        index++;
                    }
                    break;

                case 4:
                    if (img4.Image != null)
                    {
                        entityDts[index]        = new VDsignerFile();
                        entityDts[index].MainID = HTDataID;
                        entityDts[index].Seq    = i;
                        entityDts[index].SelectByID();
                        entityDts[index].Context    = TemplatePic.ImageToByte(img4.Image);
                        entityDts[index].FileTypeID = i;
                        entityDts[index].FileLength = SysConvert.ToDecimal(img4.Image.Width);
                        entityDts[index].UploadOPID = FParamConfig.LoginID;
                        entityDts[index].UploadTime = DateTime.Now.Date;
                        index++;
                    }
                    break;

                case 5:
                    if (img5.Image != null)
                    {
                        entityDts[index]        = new VDsignerFile();
                        entityDts[index].MainID = HTDataID;
                        entityDts[index].Seq    = i;
                        entityDts[index].SelectByID();
                        entityDts[index].Context    = TemplatePic.ImageToByte(img5.Image);
                        entityDts[index].FileTypeID = i;
                        entityDts[index].FileLength = SysConvert.ToDecimal(img5.Image.Width);
                        entityDts[index].UploadOPID = FParamConfig.LoginID;
                        entityDts[index].UploadTime = DateTime.Now.Date;
                        index++;
                    }
                    break;

                default:
                    break;
                }
            }

            return(entityDts);
        }