Exemplo n.º 1
0
        public void ShowSoldZedDetails(string buyer_ident_arg, string zed_ident_arg, DateTime dro_arg)
        {
            this.ViewMode              = DetailedListViewMode.SoldZed;
            this.EditingZedIdent       = zed_ident_arg;
            this.EditingZedOperation   = "Sell";
            this.EditingZedClientIdent = buyer_ident_arg;
            LoadEditingZedValues();
            this.SellOrderID = ProductInfo_Main_Form.conn.SellOrderIDByZedCode(buyer_ident_arg, zed_ident_arg);

            string soldzed_buyer_name = (from Buyer b in ProductInfo_Main_Form.conn.AllBuyers() where b.saidentifikacio_kodi == buyer_ident_arg select b.saxeli).ToArray()[0];

            this.Text = soldzed_buyer_name + "-ზე გასული ზედნადები N. " + zed_ident_arg;

            so_details       = ProductInfo_Main_Form.conn.SoldZedDetails(buyer_ident_arg, zed_ident_arg);
            txtZedIdent.Text = zed_ident_arg;
            //populate client list with buyers
            cbZedClient.DataSource    = dt_all_buyers;
            cbZedClient.ValueMember   = "saidentifikacio_kodi";
            cbZedClient.DisplayMember = "saxeli";
            //set client list value to editing zed ident
            cbZedClient.SelectedValue = buyer_ident_arg;
            //
            ProductInfo_Main_Form.DataTableToListView(sold_rem_list, so_details, true);
            attributes_lbl.Text = "გაყიდვის დრო: " + dro_arg.ToString() + "\n"
                                  // + "მყიდველი: " + soldzed_buyer_name
                                  // + "\nზედნადების ნომერი: " + zed_ident_arg
                                  + "\n\n\n\n\n\n";
            SOd_print_btn.Enabled          = true;
            SOd_print_gasavali_btn.Enabled = true;

            CleanUpSensitiveSellOrderInfo();
        }
Exemplo n.º 2
0
        public void ShowBoughtZedDetails(string supplier_ident_arg, string zed_ident_arg, DateTime dro_arg)
        {
            this.ViewMode              = DetailedListViewMode.BoughtZed;
            this.EditingZedIdent       = zed_ident_arg;
            this.EditingZedOperation   = "Buy";
            this.EditingZedClientIdent = supplier_ident_arg;
            LoadEditingZedValues();

            string boughtzed_supplier_name = (from Supplier s in ProductInfo_Main_Form.conn.AllSuppliers() where s.saidentifikacio_kodi == supplier_ident_arg select s.saxeli).ToArray()[0];

            this.Text = boughtzed_supplier_name + "-სგან მიღებული ზედნადები N. " + zed_ident_arg;

            so_details       = ProductInfo_Main_Form.conn.BoughtZedDetails(supplier_ident_arg, zed_ident_arg);
            txtZedIdent.Text = zed_ident_arg;
            //populate client list with suppliers
            cbZedClient.DataSource    = dt_all_suppliers;
            cbZedClient.ValueMember   = "saidentifikacio_kodi";
            cbZedClient.DisplayMember = "saxeli";
            //set client list value to editing zed ident
            cbZedClient.SelectedValue = supplier_ident_arg;
            //
            ProductInfo_Main_Form.DataTableToListView(sold_rem_list, so_details, true);
            attributes_lbl.Text = "მიღების დრო: " + dro_arg.ToString() + "\n"
                                  // + "მომწოდებელი: " + boughtzed_supplier_name// + "\nზედნადების ნომერი: " + zed_ident_arg
                                  + "\n\n\n\n\n\n";
            SOd_print_btn.Enabled          = true;
            SOd_print_gasavali_btn.Enabled = false;
            SOd_print_gasavali_btn.Visible = false;

            CleanUpSensitiveSellOrderInfo();
        }
Exemplo n.º 3
0
        public void ShowSellOrderDetails(int SellOrderID_arg, string zed_ident_arg, string using_check_arg)
        {
            this.ViewMode    = DetailedListViewMode.SellOrder;
            this.Text        = "გაყიდვის დეტალები";
            this.SellOrderID = SellOrderID_arg;

            lblZedIdent.Visible = false;
            txtZedIdent.Visible = false;
            btnEnableEditingZedIdent.Visible = false;
            lblZedClient.Visible             = false;
            cbZedClient.Visible = false;
            btnEnableEditingZedClient.Visible = false;
            datetime_zed_tarigi.Visible       = false;
            txt_af_seria.Visible        = false;
            txt_af_nomeri.Visible       = false;
            btn_zed_update.Visible      = false;
            lbl_edit_af_seria.Visible   = false;
            lbl_edit_af_nomeri.Visible  = false;
            lbl_editzed_af_date.Visible = false;
            datepicker_af_date.Visible  = false;
            btn_add_soldrems.Location   = new Point(btn_add_soldrems.Location.X, sold_rem_list.Location.Y - 16 - btn_add_soldrems.Height);

            so_details = ProductInfo_Main_Form.conn.SellOrderDetails(SellOrderID_arg);
            ProductInfo_Main_Form.DataTableToListView(sold_rem_list, so_details, true);
            attributes_lbl.Text            = /*"გაყიდვის დრო: " + SellOrderDate.ToString() +*/ "\nზედნადების ნომერი: " + (("" != zed_ident_arg) ? zed_ident_arg : "გაყიდულია უზედნადებოდ") + "\n" + (("1" == using_check_arg | "ჩეკით" == using_check_arg) ? "გაყიდულია ჩეკით" : "გაყიდულია უჩეკოდ") + "\n\n\n";
            SOd_print_btn.Enabled          = true;
            SOd_print_gasavali_btn.Enabled = true;

            CleanUpSensitiveSellOrderInfo();
        }
Exemplo n.º 4
0
        void add_list_Control_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (add_rem_name_col.Index == add_remainders_list.CurrentCell.ColumnIndex)
            {
                Control ctl = (Control)sender;
                //e.SuppressKeyPress = false;
                //e.Handled = true;
                //string pressedKey = ((char)e.KeyCode).ToString();
                string pressedKey = e.KeyChar.ToString();
                //if (!e.Shift)
                //{
                //    pressedKey = pressedKey.ToLower();
                //}
                //if (e.KeyData != Keys.Shift)
                //{
                if (pressed_name_keystrokes != ProductInfo_Main_Form.UTF8String(pressedKey))
                {
                    pressed_name_keystrokes += ProductInfo_Main_Form.UTF8String(pressedKey);
                }
                //}

                status_bar_lbl.Text = pressed_name_keystrokes;
                if ("" != pressed_name_keystrokes)
                {
                    try
                    {
                        Product[] prod_suggestions = ProductInfo_Main_Form.conn.GetProductSuggestions(pressed_name_keystrokes);
                        if (prod_suggestions.Length > 0)
                        {
                            add_remainders_list.CurrentRow.Cells[add_rem_barcode_col.Index].Value = prod_suggestions[0].barcode;
                            foreach (object nextItem in add_rem_name_col.Items)
                            {
                                if (nextItem.ToString() == prod_suggestions[0].name)
                                {
                                    add_remainders_list.CurrentRow.Cells[add_rem_name_col.Index].Value = nextItem.ToString();//prod_suggestions[0].name;
                                    break;
                                }
                            }

                            /*
                             * add_rem_name_col.Items.Clear();
                             * foreach (Product nprod in prod_suggestions)
                             * {
                             *  add_rem_name_col.Items.Add(nprod.name);
                             * }
                             * that's if product name is a combobox
                             * */
                        }
                    }
                    catch (NullReferenceException)
                    {
                        MessageBox.Show("null ref");
                    }
                }
            }//AutoComplete Product Name
        }
Exemplo n.º 5
0
        private void SOd_print_gasavali_btn_Click(object sender, EventArgs e)
        {
            DataTable so_gasavali_print = ProductInfo_Main_Form.conn.Gasavali(SellOrderID);

            so_gasavali_print = ProductInfo_Main_Form.DataTable_AddSum(so_gasavali_print);

            PrintPreview_Form prevw_frm = new PrintPreview_Form();

            prevw_frm.Show();
            prevw_frm.DrawData(so_gasavali_print, false);
        }
Exemplo n.º 6
0
        private void btn_exportCSV_SOd_Click(object sender, EventArgs e)
        {
            string csv_output = ProductInfo_Main_Form.ListViewToCSV(sold_rem_list);

            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "csv files (*.csv)|*.csv|All files (*.*)|*.*";

            try
            {
                switch (this.ViewMode)
                {
                case DetailedListViewMode.SellOrder:
                    sfd.FileName = "გაყიდვა #" + SellOrderID + " - " + DateTime.Now.Day + " " + BitmapGenerator.GeorgianMonths[DateTime.Now.Month] + " " + DateTime.Now.Year + " " + DateTime.Now.Hour + "-" + DateTime.Now.Minute;
                    break;

                case DetailedListViewMode.BoughtZed:
                    sfd.FileName = "" + EditingZedClientIdent + "–სგან შემოსული ზედნადები #" + EditingZedIdent + " - " + DateTime.Now.Day + " " + BitmapGenerator.GeorgianMonths[DateTime.Now.Month] + " " + DateTime.Now.Year + " " + DateTime.Now.Hour + "-" + DateTime.Now.Minute;
                    break;

                case DetailedListViewMode.SoldZed:
                    sfd.FileName = "" + EditingZedClientIdent + "–ზე გასული ზედნადები #" + EditingZedIdent + " - " + DateTime.Now.Day + " " + BitmapGenerator.GeorgianMonths[DateTime.Now.Month] + " " + DateTime.Now.Year + " " + DateTime.Now.Hour + "-" + DateTime.Now.Minute;
                    break;
                }
            }
            catch
            {
            }

            DialogResult sfd_ShowDialogResult = DialogResult.Cancel;

            try
            {
                sfd_ShowDialogResult = sfd.ShowDialog();
            }
            catch
            {
                sfd.FileName         = "";
                sfd_ShowDialogResult = sfd.ShowDialog();
            }
            if (DialogResult.OK == sfd_ShowDialogResult)
            {
                info savefile_info = Utilities.Externals.SaveCSV(sfd.FileName, csv_output);
                if (0 != savefile_info.errcode)
                {
                    MessageBox.Show(savefile_info.details, savefile_info.errcode.ToString());
                }
                //
            }
        }
Exemplo n.º 7
0
        private void buyer_chooser_KeyPress(object sender, KeyPressEventArgs e)
        {
            Control ctl = (Control)sender;

            //e.SuppressKeyPress = false;
            e.Handled = true;
            //string pressedKey = ((char)e.KeyValue).ToString();

            /*
             * if (!e.Shift)
             * {
             *  pressedKey = pressedKey.ToLower();
             * }
             * else
             * {
             *  return;//shift was pressed
             *  pressed_buyer_name_keystrokes += ProductInfo_Main_Form.UTF8String(ProductInfo_Main_Form.EngFromUTF8String(pressedKey).ToUpper());
             * }*/
            string pressedKey = e.KeyChar.ToString();

            pressed_buyer_name_keystrokes += ProductInfo_Main_Form.UTF8String(pressedKey);

            status_bar_lbl.Text = pressed_buyer_name_keystrokes;
            if ("" != pressed_buyer_name_keystrokes)
            {
                try
                {
                    Buyer[] matched_buyers = (from Buyer b in all_buyers
                                              where b.saxeli.Contains(pressed_buyer_name_keystrokes)
                                              select b).ToArray();
                    if (matched_buyers.Length > 0)
                    {
                        buyer_chooser.SelectedItem = matched_buyers[0].saxeli;
                        buyer_chooser.Text         = matched_buyers[0].saxeli;
                    }
                    else
                    {
                        status_bar.Text = "მსგავსი მყიდველი არ მოიძებნა!";
                    }
                }
                catch (NullReferenceException)
                {
                    MessageBox.Show("null ref");
                }
            }
        }
Exemplo n.º 8
0
        private void supplier_chooser_KeyPress(object sender, KeyPressEventArgs e)
        {
            Control ctl = (Control)sender;

            //e.SuppressKeyPress = false;
            e.Handled = true;
            //string pressedKey = ((char)e.KeyValue).ToString();

            /*if (!e.Shift)
             * {
             *  pressedKey = pressedKey.ToLower();
             * }
             * if (e.KeyData != Keys.Shift)
             * {
             *  pressed_supp_name_keystrokes += ProductInfo_Main_Form.UTF8String(pressedKey);
             * }*/
            string pressedKey = e.KeyChar.ToString();

            pressed_supp_name_keystrokes += ProductInfo_Main_Form.UTF8String(pressedKey);

            status_bar_lbl.Text = pressed_supp_name_keystrokes;
            if ("" != pressed_supp_name_keystrokes)
            {
                try
                {
                    Supplier[] matched_supps = (from Supplier s in all_suppliers
                                                where s.saxeli.Contains(pressed_supp_name_keystrokes)
                                                select s).ToArray();
                    if (matched_supps.Length > 0)
                    {
                        supplier_chooser.SelectedItem = matched_supps[0].saxeli;
                        supplier_chooser.Text         = matched_supps[0].saxeli;
                    }
                    else
                    {
                        status_bar.Text = "მსგავსი მომწოდებელი არ მოიძებნა!";
                    }
                }
                catch (NullReferenceException)
                {
                    MessageBox.Show("null ref");
                }
            }
        }
Exemplo n.º 9
0
        private void prod_add_btn_Click(object sender, EventArgs e)
        {
            ProductInfo_Main_Form main_frm = new ProductInfo_Main_Form();

            main_frm.Enabled = true;

            if ("" == barcode_txt.Text | "" == name_txt.Text)
            {
                return;
            }

            Product prod2add      = new Product(barcode_txt.Text, name_txt.Text, vat_ckb.Checked);
            info    prod_add_info = ProductInfo_Main_Form.conn.AddProductName(prod2add);

            MessageBox.Show(prod_add_info.details, prod_add_info.errcode.ToString());
            if (0 == prod_add_info.errcode)
            {
                //success
                this.Close();
            }
        }