示例#1
0
        private void update()
        {
            string querry = "select  namestaff from [staff] where idstaff > 1 and rolestaff='Doctor'";

            c.fill_CB(doctors_CB, querry, "namestaff");
            querry = "select  idstaff, namestaff from [staff] where idstaff = 1 and rolestaff='Doctor'";
            c.fill_txt(principaliddoctor_txt, querry, "idstaff");
            c.fill_txt(principalnamedoctor_txt, querry, "namestaff");
        }
示例#2
0
        private void addprocedure_Load(object sender, EventArgs e)
        {
            ptype_txt.BackColor = Color.White;
            ptype_txt.ForeColor = Color.Red;

            code_rbtn.PerformClick();
            spname_rbtn.PerformClick();
            sdname_rbtn.PerformClick();
            DBManager c     = new DBManager();
            string    ptype = "select ptype from [procedure] where idprocedure = '" + idprocedure_txt.Text + "'";

            c.fill_txt(ptype_txt, ptype, "ptype");
            string pacients = "Select idpatient as ID, name as Nombre, sex as Sexo, idperson as Cedula, insurance as Seguro, affiliate as Afiliado from patient where name is not null";

            c.load_dgv(dataGridView1, pacients);
            string doctors = "Select idstaff as ID, namestaff as Nombre, sexstaff as Sexo, idpersonstaff as Cedula from staff where rolestaff like 'Doctor'";

            c.load_dgv(dataGridView2, doctors);
            string sprocedure = "Select id as ID, idprocedure as IDProcedimiento, codeinsurance as Codigo, subprocedure as Procedimiento, tariff as Tarifa, coverage as Cobertura, difference as Diferencia, tooth as Diente, status as Estado, insurance as Seguro from subprocedure where idprocedure = '" + idprocedure_txt.Text + "'";

            c.load_dgv(dataGridView3, sprocedure);
            if (string.IsNullOrEmpty(pidpatient_txt.Text))
            {
            }
            else
            {
                string query = "select insurance from patient where idpatient = '" + pidpatient_txt.Text + "'";
                c.fill_txt(insurance_txt, query, "insurance");
                string query2 = "select affiliate from patient where idpatient = '" + pidpatient_txt.Text + "'";
                c.fill_txt(affiliate_txt, query2, "affiliate");
            }

            if (ptype_txt.Text == "Regular")
            {
                turnregular_btn.Hide();
            }
            else if (ptype_txt.Text == "Cotizacion")
            {
            }
            string querry8   = "select gaindoctor from [procedure] where idprocedure = '" + idprocedure_txt.Text + "'";
            string condition = "gaindoctor";

            c.fill_txt(gaindoctor_txt, querry8, condition);
        }
示例#3
0
        private void enterinvoice_Load(object sender, EventArgs e)
        {
            if (idonsys.Text == "")
            {
                processinvoice.Text = "Insertar";
            }
            else
            {
                string query = "select idtransactions, ref, madebytran, reasontran, datetran, origin, expenses from [transaction] where idtransactions = '" + idonsys.Text + "'";
                c.fill_txt(nameprovider, query, "madebytran");
                c.fill_txt(nobill, query, "ref");
                c.fill_txt(reasonbill, query, "reasontran");
                c.fill_txt(qty, query, "expenses");


                nameprovider.Enabled = false;
                processinvoice.Text  = "Actualizar";
                searchprovider.Hide();
            }
        }
示例#4
0
        private void addsubprocedure_Load(object sender, EventArgs e)
        {
            cargarDGV();
            DBManager c         = new DBManager();
            string    query     = "SELECT sum(entry) as qty FROM [SysPandemic].[dbo].[transaction] where ref = '" + idsubprocedure_txt.Text + "'";
            string    condition = "qty";

            c.fill_txt(nowpay_txt, query, condition);

            string querry2    = "select idDoctor from [procedure] where idprocedure = '" + idsubprocedure_txt.Text + "'";
            string condition2 = "idDoctor";

            c.fill_txt(iddoctor_txt, querry2, condition2);

            if (string.IsNullOrEmpty(nowpay_txt.Text))
            {
                decimal ppay = Convert.ToDecimal(sppricepay_txt.Text);
                balancepay_txt.Text = Convert.ToString(ppay);
            }
            else
            {
                decimal ppay   = Convert.ToDecimal(sppricepay_txt.Text);
                decimal nowpay = Convert.ToDecimal(nowpay_txt.Text);
                balancepay_txt.Text = Convert.ToString(ppay - nowpay);
            }
            if (string.IsNullOrEmpty(idsubprocedure_txt.Text))
            {
            }
            else
            {
                string query5 = "select tooth from [procedure] where idprocedure = '" + idsubprocedure_txt.Text + "'";
                c.fill_txt(stooth_txt, query5, "tooth");
            }
            query     = "select gaindoctor from [procedure] where idprocedure = '" + idsubprocedure_txt.Text + "'";
            condition = "gaindoctor";
            c.fill_txt(gaindoctor_txt, query, condition);
        }
示例#5
0
        private void loadbill()
        {
            cargarDGV();
            DBManager c         = new DBManager();
            string    query     = "SELECT sum(entry) as qty FROM [SysPandemic].[dbo].[transaction] where ref = '" + idsubprocedure_txt.Text + "'";
            string    condition = "qty";

            c.fill_txt(nowpay_txt, query, condition);

            if (string.IsNullOrEmpty(nowpay_txt.Text))
            {
                decimal ppay = Convert.ToDecimal(sppricepay_txt.Text);
                balancepay_txt.Text = Convert.ToString(ppay);
            }
            else
            {
                decimal ppay   = Convert.ToDecimal(sppricepay_txt.Text);
                decimal nowpay = Convert.ToDecimal(nowpay_txt.Text);
                balancepay_txt.Text = Convert.ToString(ppay - nowpay);
            }
        }