private void button1_Click(object sender, EventArgs e)
        {
            if (IsEditMode == false)
            {
                var insertBankentry = "insert into bankentry(BankId,BankName,BankAddress) values(" + txtbnkid.Text + ",'" + txtbnkname.Text + "','" + txtbnkaddrss.Text + "')";
                DBconnection.ExecuteNonQuery(insertBankentry);
                MessageBox.Show("Data save sucessfully",
                                "save bankentry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                var updateBankentry = "update bankentry set BankName='" + txtbnkname.Text + "', BankAddress='" + txtbnkaddrss.Text + "' where BankId=" + txtbnkid.Text + "";
                DBconnection.ExecuteNonQuery(updateBankentry);

                MessageBox.Show("Data Updated sucessfully",
                                "update bankentry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            Loadbankentry();
            EnableDisableControl("Reset");
        }
Beispiel #2
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (IsEditMode == false)
            {
                var insertchequeentry = "insert into chequeentry(ChequeId,BankID,PartyId,ChequeNo,ChequeBearer,EntryDate,DateOfCash,UserId) values('" + txtchequeid.Text + "','" + txtbnkid.Text + "','" + txtprtyid.Text + "','" + txtchqno.Text + "','" + txtchqbearer.Text + "','" + dateTimeentrydate.Value.Date.ToString("MM-dd-yyyy") + "','" + dateTimedateofcash.Value.Date.ToString("MM-dd-yyyy") + "','" + txtuserid.Text + "')";
                DBconnection.ExecuteNonQuery(insertchequeentry);
                MessageBox.Show("Data save sucessfully",
                                "save UserEntry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                var updatchequeentry = "Update chequeentry set BankID='" + txtbnkid.Text + "',PartyId='" + txtprtyid.Text + "',ChequeNo='" + txtchqno.Text + "',ChequeBearer='" + txtchqbearer.Text + "',EntryDate='" + dateTimeentrydate.Value.Date.ToString("MM-dd-yyyy") + "',DateOfCash='" + dateTimedateofcash.Value.Date.ToString("MM-dd-yyyy") + "',UserId='" + txtuserid.Text + "' where chequeId='" + txtchequeid.Text + "'";
                DBconnection.ExecuteNonQuery(updatchequeentry);

                MessageBox.Show("Data Updated sucessfully",
                                "update chequeEntry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            loadchequeentry();
            EnableDisableControl("Reset");
        }
Beispiel #3
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (IsEditMode == false)
            {
                var insertpartyentry = "insert into partyentry(PartyId,PartyName,PartyAddress,MobileNo,Telephone,UserID) values('" + txtpartyid.Text + "','" + txtprtyname.Text + "','" + txtprtyadrs.Text + "','" + txtmblno.Text + "','" + txtphone.Text + "','" + txtuserid.Text + "')";
                DBconnection.ExecuteNonQuery(insertpartyentry);
                MessageBox.Show("Data save sucessfully",
                                "save UserEntry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                var updatepartyentry = "update partyentry set PartyName='" + txtprtyname.Text + "', PartyAddress='" + txtprtyadrs.Text + "', MobileNo='" + txtmblno.Text + "',Telephone ='" + txtphone.Text + "', UserID='" + txtuserid.Text + "' where partyId='" + txtpartyid.Text + "'";
                DBconnection.ExecuteNonQuery(updatepartyentry);

                MessageBox.Show("Data Updated sucessfully",
                                "update PartyEntry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            loadpartyentry();
            EnableDisableControl("Reset");
        }
Beispiel #4
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (IsEditMode == false)
            {
                var insertUserEntry = "insert into Userid(UserID,StaffName,Email,UserName,Password,Telephone) " +
                                      "values('" + txtuserid.Text + "','" + txtstaffname.Text + "','" + txtemail.Text + "','" + txtusername.Text + "','" + txtpswrd.Text + "','" + txtphone.Text + "')";
                DBconnection.ExecuteNonQuery(insertUserEntry);
                MessageBox.Show("Data save sucessfully",
                                "save UserEntry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                var updateUserEntry = "update Userid set StaffName='" + txtstaffname.Text + "', Email='" + txtemail.Text + "', UserName='******'," +
                                      "Password= '******', Telephone='" + txtphone.Text + "' where UserID='" + txtuserid.Text + "'";
                DBconnection.ExecuteNonQuery(updateUserEntry);

                MessageBox.Show("Data Updated sucessfully",
                                "update UserEntry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            loadUserEntry();
            EnableDisableControl("Reset");
        }