예제 #1
0
 public void initData()
 {
     company = new CompanyInfo();
     company.load();
     this.txtCompanyName.Text = company.name;
     this.txtTradeName.Text = company.tradeName;
     this.txtRepresentative.Text = company.representative;
     this.mmeAddress.Text = company.address;
     this.txtPhone.Text = company.phone;
     this.txtFax.Text = company.fax;
     this.txtEmail.Text = company.email;
     this.txtWebsite.Text = company.website;
     this.txtAccountNo.Text = company.accountNo;
     this.txtBankName.Text = company.bankName;
     this.txtTaxCode.Text = company.taxCode;
     this.pictureEdit1.Image = CompanyInfo.displayImageLogo(company.logo);
     this.headerLetter.Image = CompanyInfo.displayImageLogo(company.headerletter);
     HelpImage.LoadImage(this.pictureEdit1, company.logo);
     HelpImage.LoadImage(this.headerLetter, company.headerletter);
     if (FrameworkParams.option==null){
         FrameworkParams.option = new Option();
         FrameworkParams.option.load();
     }
     configOption = FrameworkParams.option;
 }
예제 #2
0
        public void initData()
        {
            company = new CompanyInfo();
            company.load();
            this.txtCompanyName.Text = company.name;
            this.txtTradeName.Text = company.tradeName;
            this.txtRepresentative.Text = company.representative;
            this.mmeAddress.Text = company.address;
            this.txtPhone.Text = company.phone;
            this.txtFax.Text = company.fax;
            this.txtEmail.Text = company.email;
            this.txtWebsite.Text = company.website;
            this.txtAccountNo.Text = company.accountNo;
            this.txtBankName.Text = company.bankName;
            this.txtTaxCode.Text = company.taxCode;
            //this.pictureEdit1.Image = CompanyInfo.displayImageLogo(company.logo);
            HelpImage.LoadImage(this.pictureEdit1, company.logo);
            if (FrameworkParams.option==null){
                FrameworkParams.option = new Option();
                FrameworkParams.option.load();
            }
            configOption = FrameworkParams.option;

            seRound.Value = HelpNumber.ParseInt32(configOption.round);
            rgSperactorThousand.SelectedIndex = (configOption.thousandSeparator.Equals(".") ? 0 : 1);
            rgSperactorDec.SelectedIndex = (configOption.decSeparator.Equals(".") ? 1 : 0);
            cbFormatDay.EditValue = configOption.dateFormat;
            cbFormatHour.EditValue = configOption.timeFormat;
            cbSkin.SelectedIndex = HelpNumber.ParseInt32(configOption.Skin);

            for (int i = 0; i < cbInstalledPrinters.Properties.Items.Count ; i++)
            {
                if (cbInstalledPrinters.Properties.Items[i].ToString() == configOption.printerName)
                    cbInstalledPrinters.SelectedItem = configOption.printerName;
                else
                {
                    //cbInstalledPrinters.Text = "";
                }
            }
        }
예제 #3
0
 //private void pictureEdit1_DoubleClick(object sender, EventArgs e)
 //{
 //    DialogResult dialogResult = this.openFileDialog1.ShowDialog();
 //    if (dialogResult == DialogResult.Cancel || openFileDialog1.FileName == "")
 //        return;
 //    try
 //    {
 //        byte[] logoByte = CompanyInfo.readBitmap2ByteArray(openFileDialog1.FileName);
 //        company.logo = logoByte;
 //        HelpImage.LoadImage(this.pictureEdit1, logoByte);
 //    }
 //    catch (Exception ex)
 //    {
 //        PLException.AddException(ex);
 //        FWMsgBox.showErrorImage();
 //    }
 //}
 private void initData()
 {
     company = new CompanyInfo();
     company.load();
     this.txtCompanyName.Text = company.name;
     this.txtTradeName.Text = company.tradeName;
     this.txtRepresentative.Text = company.representative;
     this.mmeAddress.Text = company.address;
     this.txtPhone.Text = company.phone;
     this.txtFax.Text = company.fax;
     this.txtEmail.Text = company.email;
     this.txtWebsite.Text = company.website;
     this.txtAccountNo.Text = company.accountNo;
     this.txtBankName.Text = company.bankName;
     this.txtTaxCode.Text = company.taxCode;
     HelpImage.LoadImage(this.pictureEdit1, company.logo);
 }
예제 #4
0
        public static object kickCommerce()
        {
            CompanyInfo company = new CompanyInfo();
            company.load();
            try
            {
                if (company.headerletter != null)
                {
                    MemoryStream stream = new MemoryStream(company.headerletter);
                    Bitmap image = new Bitmap(stream);
                    FrameworkParams.headerLetter = new ImageHeaderStartTitleGridEndFooter(image);
                }
                FrameworkParams.LoginCompanyInfo = company;
            }
            catch (Exception ex)
            {
                PLException.AddException(ex);
            }

            return null;
        }
예제 #5
0
 //PHUOC OK
 public CompanyInfo load()
 {
     CompanyInfo company = new CompanyInfo();
     DatabaseFB db = DABase.getDatabase();
     DbCommand dbSelect = db.GetSQLStringCommand("SELECT NAME,TRADENAME,REPRESENTATIVE,ADDRESS,PHONE,FAX,EMAIL,WEBSITE,LOGO,ACCOUNTNO,BANKNAME,TAXCODE,HEADER_LETTER" +
                                                 " FROM COMPANY_INFO WHERE ID=@ID");
     db.AddInParameter(dbSelect, "@ID", DbType.Int64, FrameworkParams.LoginCompanyID);
     IDataReader reader = db.ExecuteReader(dbSelect);
     if (reader.Read())
     {
         byte[] logo = null;
         byte[] headerletter = null;
         if (!reader["LOGO"].ToString().Equals(""))
         {
             logo = (byte[])reader["LOGO"];
         }
         if (!reader["HEADER_LETTER"].ToString().Equals(""))
         {
             headerletter = (byte[])reader["HEADER_LETTER"];
         }
         company = new CompanyInfo(reader["NAME"].ToString(), reader["TRADENAME"].ToString(), reader["REPRESENTATIVE"].ToString(),
             reader["ADDRESS"].ToString(), reader["PHONE"].ToString(), reader["FAX"].ToString(), reader["EMAIL"].ToString(),
             reader["WEBSITE"].ToString(), logo, reader["ACCOUNTNO"].ToString(), reader["BANKNAME"].ToString(), reader["TAXCODE"].ToString(), headerletter);
     }
     reader.Close();
     return company;
 }