private void btnPay_Click(object sender, EventArgs e) { #region CheckTextboxes if (string.IsNullOrEmpty(txtLineCode.Text.Trim())) { MessageBox.Show("لطفا شناسه ملی را پر کنید"); return; } if (string.IsNullOrEmpty(txtCompany.Text.Trim())) { MessageBox.Show("لطفا نام شرکت را پر کنید"); return; } if (string.IsNullOrEmpty(txtEmail.Text.Trim())) { MessageBox.Show("لطفا ایمیل را پر کنید"); return; } if (string.IsNullOrEmpty(txtMobile.Text.Trim())) { MessageBox.Show("لطفا شماره موبایل را پر کنید"); return; } #endregion try { #region SaveData Properties.Settings.Default.LineCode = txtLineCode.Text.Trim(); Properties.Settings.Default.Company = txtCompany.Text.Trim(); Properties.Settings.Default.Save(); #endregion #region Payment payment = new pay("9d217c8e-f979-11e9-b4aa-000c295eb8fc", int.Parse(lblAmount.Text.Replace(",", "")), "Des", "http://e-manifest.ir/payment", txtEmail.Text.Trim(), txtMobile.Text.Trim()); //auth = payment.StartPay(); auth = payment.StartPay(); System.Diagnostics.Process.Start(payment.URL + auth); payment.OnPaymentAction += Payment_OnPaymentAction; #endregion #region SaveDB if (!manifestWS.InsertCompany(txtLineCode.Text.Trim(), txtCompany.Text.Trim(), txtEmail.Text.Trim(), txtMobile.Text.Trim(), (int)(txtQty.Value), auth)) { MessageBox.Show("خطا در ثبت اطلاعات شرکت"); } #endregion Close(); } catch (Exception ex) { MessageBox.Show("مشکلی در پرداخت به وجود آمده است \n" + ex.Message); } }
private void btnPay_Click(object sender, EventArgs e) { #region SaveData Properties.Settings.Default.LineCode = txtLineCode.Text.Trim(); Properties.Settings.Default.Company = txtCompany.Text.Trim(); Properties.Settings.Default.Save(); #endregion #region Payment payment = new pay("9d217c8e-f979-11e9-b4aa-000c295eb8fc", int.Parse(lblAmount.Text.Replace(",", "")), "Des", "http://e-manifest.ir", txtEmail.Text.Trim(), txtMobile.Text.Trim()); //auth = payment.StartPay(); auth = payment.StartPay(); System.Diagnostics.Process.Start(payment.URL + auth); payment.OnPaymentAction += Payment_OnPaymentAction; #endregion #region SaveDB if (!manifestWS.InsertCompany(txtLineCode.Text.Trim(), txtCompany.Text.Trim(), txtEmail.Text.Trim(), txtMobile.Text.Trim(), (int)(txtQty.Value), auth)) { MessageBox.Show("خطا در ثبت اطلاعات شرکت"); } #endregion }