Esempio n. 1
0
        public static bool update_elem(records inp)
        {
            if (dataAccess.Remove_Temp(inp.posting_id))
            {
                Remove_elem(inp.posting_id);
                List <string> inpdata = new List <string>();

                inpdata.Add(inp.posting_id);
                inpdata.Add(inp.date);
                inpdata.Add(inp.slno.ToString());
                inpdata.Add(inp.name);
                inpdata.Add(inp.details);
                inpdata.Add(inp.reciept.ToString());
                inpdata.Add(inp.payment.ToString());
                inpdata.Add(inp.interest.ToString());
                inpdata.Add(inp.acc_id);

                Set_InpSend(inpdata);
                return(true);
            }
            else
            {
                MessageBox.Show("Update Failed");
            }
            return(false);
        }
        private void Output_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (Output.SelectedCells.Count <= 0)
            {
                return;
            }
            records record_ = Output.SelectedItem as records;

            slno_post_combo.SelectedItem = record_.slno.ToString();
            name_post_combo.SelectedItem = record_.name;

            edit_slno = record_.slno.ToString();

            pos_id = record_.posting_id;

            acc_id = dataAccess.getAcc_id(edit_slno);

            string[] date_split = record_.date.Split('-');
            date_post.SelectedDate = new DateTime(int.Parse(date_split[2]), int.Parse(date_split[1]), int.Parse(date_split[0]));

            reciept_post.Text = record_.reciept.ToString();
            reciept_b         = record_.reciept;

            payment_post.Text = record_.payment.ToString();
            payment_b         = record_.payment;

            interest_post.Text = record_.interest.ToString();

            description_post.Text   = record_.details;
            edit_btn_post.IsEnabled = true;
            del_btn_post.IsEnabled  = true;
        }
Esempio n. 3
0
        public static void Set_InpSend(List <string> inp)
        {
            records rec = new records(inp[0], inp[1], Int32.Parse(inp[2]), inp[3], inp[4], decimal.Parse(inp[5]), decimal.Parse(inp[6]), decimal.Parse(inp[7]), inp[8]);

            if (dataAccess.Insert_IntoTemp(rec))
            {
                data_inp_send.Add(rec);
            }
            else
            {
                MessageBox.Show("Posting Failed. Please Restart the Application");
            }
        }
Esempio n. 4
0
        private void Output_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (Output.SelectedCells.Count <= 0)
            {
                return;
            }
            records selectedItem = Output.SelectedItem as records;

            Output.IsEnabled = false;

            pos_id = selectedItem.posting_id;

            string[] strArray = selectedItem.date.Split('-');
            date_post.SelectedDate = new DateTime?(new DateTime(int.Parse(strArray[2]), int.Parse(strArray[1]), int.Parse(strArray[0])));

            slno_post_combo.SelectedItem = selectedItem.slno.ToString();

            edit_slno = selectedItem.slno.ToString();

            acc_id = dataAccess.getAcc_id(edit_slno);

            name_post_combo.SelectedItem = selectedItem.name;

            description_post.Text = selectedItem.details;

            reciept_post.Text = selectedItem.reciept.ToString();
            reciept_b         = selectedItem.reciept;

            payment_post.Text = selectedItem.payment.ToString();
            payment_b         = selectedItem.payment;

            interest_post.Text = selectedItem.interest.ToString();

            slno_edit_check.IsChecked = new bool?(true);

            isEditing = true;

            send_btn.IsEnabled = false;
            edit_btn.IsEnabled = true;
            del_btn.IsEnabled  = true;
        }