Exemple #1
0
 public EmployeeForm(idocEmployee document) : base()
 {
     Document = document;
     InitializeComponent();
     dTP_Birthday.Value  = DateTime.Now;
     dTP_Birthday.Format = DateTimePickerFormat.Long;
 }
Exemple #2
0
        public override void Load()
        {
            if (Key == "")
            {
                isCreated = false;
                Create();
                MainForm.Text = "Нове замовлення";
                Owner         = Program.UserContext;
            }
            else
            {
                DataTable dt = Client.QueryRecordsList(qryCustomersLoad.ToString().Replace(":customerid", Key));
                if (dt != null && dt.Rows.Count > 0)
                {
                    Name  = dt.Rows[0]["Name"].ToString();
                    Phone = dt.Rows[0]["Phone"].ToString();
                    Email = dt.Rows[0]["Email"].ToString();

                    Address    = dt.Rows[0]["Adress"].ToString();
                    City       = dt.Rows[0]["City"].ToString();
                    Region     = dt.Rows[0]["Region"].ToString();
                    District   = dt.Rows[0]["District"].ToString();
                    Country    = dt.Rows[0]["Country"].ToString();
                    PostalCode = dt.Rows[0]["PostalCode"].ToString();
                    WebSite    = dt.Rows[0]["WebSite"].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;
                }
            }
        }
Exemple #3
0
 private void toolStripStatusOwner_Click(object sender, EventArgs e)
 {
     try
     {
         idocEmployee emp = new idocEmployee(Document.Owner.Key, Document.Client);
         emp.Show();
     }
     catch { }
 }
Exemple #4
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();
                }
            }
        }
Exemple #5
0
        public override void Load()
        {
            if (Key == "")
            {
                isCreated = false;
                Create();
                MainForm.Text = "Новий стан";
                Owner         = Program.UserContext;
            }
            else
            {
                DataTable dt = new DataTable();
                try
                {
                    dt = Client.QueryRecordsList(qryOrderStatesLoad.ToString().Replace(":orderstateid", Key));
                }
                catch (Exception e)
                {
                    MessageBox.Show
                    (
                        "Помилка завантаження історії зміни станів замовлення\r" +
                        e.Message
                    );
                }
                if (dt.Rows.Count > 0)
                {
                    Name = dt.Rows[0]["Name"].ToString();
                    Code = dt.Rows[0]["Code"].ToString();
                    try
                    {
                        Level = Convert.ToInt32(dt.Rows[0]["STATELEVEL"].ToString());
                    }
                    catch
                    {
                        Level = 0;
                    }

                    try
                    {
                        StateType = Convert.ToInt32(dt.Rows[0]["STATETYPE"].ToString());
                    }
                    catch
                    {
                        StateType = 0;
                    }

                    try
                    {
                        Index = Convert.ToInt32(dt.Rows[0]["RECINDEX"].ToString());
                    }
                    catch
                    {
                        Index = 0;
                    }

                    Switchover = dt.Rows[0]["ADDORDERSTATEID"].ToString() == "null" ? null : new idocOrderState(dt.Rows[0]["ADDORDERSTATEID"].ToString(), Client);

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

                    Owner = new idocEmployee(dt.Rows[0]["ownerid"].ToString(), Client);
                    MainForm.toolStripStatusOwner.Text = Owner.Title;

                    isCreated = true;
                    isChanged = false;
                }
            }
        }