Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            int tempn;

            int.TryParse(txtQuan.Text, out tempn);
            if (lvwSerial.Items.Count < tempn)
            {
                MessageBox.Show("Not enough serial numbers for the appropriate amount of quantity! Please add more serial numbers!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                String sertemp;
                if (tempn == 1)
                {
                    if (inpc.EmptyCheck(groupBox1.Controls))
                    {
                        sertemp = txtSerial.Text;
                        con.invadd(txtInven.Text, txtName.Text, cboUnit.Text, cboType.Text, txtRemarks.Text, txtArticle.Text, txtCost.Text, txtDesc.Text, cbLoc.Text.Substring(0, 1), sertemp, cbEmpID.Text.Substring(0, 1), cboAcc.Text, cboSign.Text, cboRT.Text, cboIss.Text, dtpRDate.Text);
                        con2.logadd(DateTime.Now.ToShortDateString(), cbEmpID.Text.Substring(2, cbEmpID.Text.Length - 2) + "/" + cbLoc.Text.Substring(2, cbLoc.Text.Length - 2), txtInven.Text, String.Concat("Property Record Created at ", DateTime.Now.ToShortTimeString()), "GENERATED", txtCost.Text);
                        MessageBox.Show("Log Entry Created", "Property Tracking", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        close.tblshow();
                        this.Close();
                    }
                }
                else
                {
                    if (inpc.EmptyCheck(groupBox1.Controls, 1))
                    {
                        int counter = 0;
                        foreach (ListViewItem serno in lvwSerial.Items)
                        {
                            counter++;
                            Random rnd        = new Random();
                            char   randomchar = (char)rnd.Next('A', 'Z');
                            string tempinv    = counter.ToString() + randomchar;
                            sertemp = serno.SubItems[0].Text;
                            con.invadd(String.Concat(txtInven.Text, tempinv), txtName.Text, cboUnit.Text, cboType.Text, txtRemarks.Text, txtArticle.Text, txtCost.Text, txtDesc.Text, cbLoc.Text.Substring(0, 1), sertemp, cbEmpID.Text.Substring(0, 1), cboAcc.Text, cboSign.Text, cboRT.Text, cboIss.Text, dtpRDate.Text);
                            con2.logadd(DateTime.Now.ToShortDateString(), cbEmpID.Text.Substring(2, cbEmpID.Text.Length - 2) + "/" + cbLoc.Text.Substring(2, cbLoc.Text.Length - 2), String.Concat(txtInven.Text, tempinv), String.Concat("Property Record Created at ", DateTime.Now.ToShortTimeString()), "GENERATED", txtCost.Text);
                            MessageBox.Show("Log Entry Created", "Property Tracking", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            close.tblshow();
                            this.Close();
                        }
                    }
                }
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (inpc.EmptyCheck(groupBox1.Controls))
     {
         con.invupdate(rid, txtName.Text, cboUnit.Text, cboType.Text, txtRemarks.Text, txtArticle.Text, txtCost.Text, txtDesc.Text, txtSerial.Text, cboAcc.Text, cboSign.Text, cboRT.Text, cboIss.Text, dtpRDate.Text);
         //Cost Change Check
         if (!String.Equals(comp3, txtCost.Text))
         {
             con2.logbalchange(rid, txtCost.Text);
             MessageBox.Show("Cost adjusted to Equipment Card", "Property Tracking", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         close.tblshow();
         this.Close();
     }
 }
Пример #3
0
 private void btnGenerate_Click(object sender, EventArgs e)
 {
     if (inpc.EmptyCheck(Controls))
     {
         con1.dispgen(piid, dtpDDate.Text, cboDMeth.Text, txtRem.Text);
         dispid = con1.dispidget(piid);
         con.intodi(piid, dispid);
         if (!con2.logtblshow(piid, 1))
         {
             con2.logadd(DateTime.Now.ToShortDateString(), con2.loggetprevmr(piid), piid, String.Concat("Property Returned for Disposal at: ", DateTime.Now.ToShortTimeString()), "DRETURN", "0");
             MessageBox.Show("Disposal Return Entry Created!", "Property Tracking", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         con2.logcurset(piid);
         con2.logadd(DateTime.Now.ToShortDateString(), con2.loggetprevmr(piid), piid, String.Concat("Property Disposed at: ", DateTime.Now.ToShortTimeString()), "DISPOSAL", con.invretmr(piid, 3));
         MessageBox.Show("Disposal Entry Created!", "Property Tracking", MessageBoxButtons.OK, MessageBoxIcon.Information);
         close.tblshow();
         this.Close();
     }
 }