Exemplo n.º 1
0
        public LetterSettingForm(ProductCirculation c, string p)
        {
            InitializeComponent();
            cir    = c;
            pieces = p;
            this.textBox_timeFormat.Text = ConfDao.getInstance().Get(12);
            if (string.IsNullOrEmpty(this.textBox_timeFormat.Text) || this.textBox_timeFormat.Text == "0")
            {
                resetTime();
            }

            if (cir.CustomerID != 0)
            {
                Customer customer = CustomerDao.getInstance().FindByID(cir.CustomerID);
                this.textBox_name.Text    = customer.Name;
                this.textBox_address.Text = customer.Address;
                this.textBox_tel.Text     = customer.Contract;

                this.textBox_contractor.Text      = ConfDao.getInstance().Get(5);
                this.textBox_contractorPhone.Text = ConfUtility.getContract();
            }
            this.textBox_pieces.Text = pieces;

            try
            {
                this.textBox_time.Text = cir.CirculationTime.ToString(this.textBox_timeFormat.Text);
            }
            catch {
                resetTime();
                this.textBox_time.Text = cir.CirculationTime.ToString(this.textBox_timeFormat.Text);
            }
            this.textBox_comment.Text = cir.Comment;
        }