Пример #1
0
        public override void Load()
        {
            if (Key == "")
            {
                isCreated = false;
                Create();

                AgreementDate = DateTime.Now;
                ProdDate      = DateTime.MinValue;
                DateOrder     = DateTime.MinValue;

                MainForm.Text = "Нове замовлення";
                Currency      = "грн.";
                Owner         = Program.UserContext;
            }
            else
            {
                DataTable dt = Client.QueryRecordsList(qryOrderLoad.ToString().Replace(":orderid", Key));
                if (dt != null && dt.Rows.Count > 0)
                {
                    AgreementDate = dt.Rows[0]["AgreementDate"].ToString() == "" ? DateTime.MinValue : (DateTime)dt.Rows[0]["AgreementDate"];
                    ProdDate      = dt.Rows[0]["ProdDate"].ToString() == "" ? DateTime.MinValue : (DateTime)dt.Rows[0]["ProdDate"];
                    DateOrder     = dt.Rows[0]["dateorder"].ToString() == "" ? DateTime.MinValue : (DateTime)dt.Rows[0]["dateorder"];
                    OrderState    = dt.Rows[0]["orderstateid"].ToString() == "" ?
                                    null :
                                    new idocOrderState
                                    (
                        dt.Rows[0]["orderstateid"].ToString(), Client
                                    );

                    OrderNo = dt.Rows[0]["orderno"].ToString();

                    AgreementNo = dt.Rows[0]["AgreementNo"].ToString();
                    Customer    = new idocCustomer(dt.Rows[0]["CUSTOMERID"].ToString(), Client);
                    MainForm.tB_Customer.Text = dt.Rows[0]["VCUSTOMERNAME"].ToString();
                    TotalCost  = 0;
                    TotalPrice = (decimal)dt.Rows[0]["TOTALPRICE"];
                    Currency   = dt.Rows[0]["VCURRENCYNAME"].ToString();
                    RComment   = dt.Rows[0]["RCOMMENT"].ToString();
                    Owner      = new idocEmployee(dt.Rows[0]["ownerid"].ToString(), Client);
                    MainForm.toolStripStatusOwner.Text = Owner.Title;

                    isCreated = true;
                    isChanged = false;

                    MainForm.OrderStatesLoad();
                }
            }
        }
Пример #2
0
 public CustomerForm(idocCustomer document) : base()
 {
     Document = document;
     InitializeComponent();
 }