Esempio n. 1
0
        protected void btnDeleteSupplier_Click(object sender, EventArgs e)
        {
            POMain poMain = new POMain();

            try
            {
                poMain.SupplierID = Convert.ToInt32(lblSupplierID.Text);
                poMain.Received   = false;
                poMain.CreatedBy  = userName;

                int retOut = poMain.UpdateSupplierDetails(poMain);

                lblMessageError.Visible = true;

                if (retOut == 1)
                {
                    ControlState();
                    lblUpdateMessage.Visible   = true;
                    lblUpdateMessage.Text      = "";
                    lblUpdateMessage.ForeColor = System.Drawing.Color.Green;
                    lblUpdateMessage.Text      = "Data Successfully Deleted";
                }

                else
                {
                    lblMessageError.Text      = "";
                    lblMessageError.ForeColor = System.Drawing.Color.Red;
                    lblMessageError.Text      = "Data Deletion Failed " + lblSupplierID.Text;
                }
            }
            catch (Exception ex)
            {
                MessageError              = ex.Message.ToString();
                lblMessageError.Text      = "";
                lblMessageError.ForeColor = System.Drawing.Color.Red;
                lblMessageError.Text      = "<b>Your Transaction Failed: </b>" + MessageError;
            }
        }
Esempio n. 2
0
        protected void btnUpdateSupplier_Click(object sender, EventArgs e)
        {
            POMain poMain = new POMain();

            try
            {
                poMain.SupplierID     = Convert.ToInt32(lblSupplierID.Text);
                poMain.MainNo         = txtMainNo.Text;
                poMain.FaxNo          = txtFaxNo.Text;
                poMain.ContactPerson  = txtContactPerson.Text;
                poMain.PhNo           = txtPhNo.Text;
                poMain.ContactPerson1 = txtContactPerson1.Text;
                poMain.PhNo1          = txtPhNo1.Text;
                poMain.Address1       = txtAdd1.Text;
                poMain.Address2       = txtAdd2.Text;
                poMain.Address3       = txtAdd3.Text;
                poMain.Address4       = txtAdd4.Text;
                poMain.Address5       = txtAdd5.Text;
                poMain.Country        = txtCountry.Text;
                poMain.Comment        = txtComment.Text;
                if (txtTerm.Text != "")
                {
                    poMain.Term = Convert.ToInt32(txtTerm.Text);
                }
                else
                {
                    poMain.Term = 0;
                }

                poMain.CreatedBy = userName;
                poMain.Received  = true;

                int retOut = poMain.UpdateSupplierDetails(poMain);



                if (retOut == 1)
                {
                    ControlState();
                    lblUpdateMessage.Visible   = true;
                    lblUpdateMessage.Text      = "";
                    lblUpdateMessage.ForeColor = System.Drawing.Color.Green;
                    lblUpdateMessage.Text      = "Data Successfully Updated";
                }

                else
                {
                    lblMessageError.Visible   = true;
                    lblMessageError.Text      = "";
                    lblMessageError.ForeColor = System.Drawing.Color.Red;
                    lblMessageError.Text      = "Failed while Updating Data" + lblSupplierID.Text;
                }
            }

            catch (Exception ex)
            {
                MessageError              = ex.Message.ToString();
                lblMessageError.Text      = "";
                lblMessageError.ForeColor = System.Drawing.Color.Red;
                lblMessageError.Text      = "<b>Your Transaction Failed: </b>" + MessageError;
            }
        }