예제 #1
0
 public RequestLinkParams(BPS.BLL.PaymentOrders.DataSets.dsRequestsNotLinked.GetRequestsNotLinkedRow rwRequest)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     this.getServiceCharge(rwRequest);
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
예제 #2
0
        private void getServiceCharge(BPS.BLL.PaymentOrders.DataSets.dsRequestsNotLinked.GetRequestsNotLinkedRow rwRequest)
        {
            SqlCommand cmdGetServiceCharge = new SqlCommand("[GetServiceChargeForLinked]", App.Connection);

            cmdGetServiceCharge.CommandType = CommandType.StoredProcedure;
            //	cmdGetServiceCharge.Parameters.Add(new SqlParameter("@RequestID", SqlDbType.Int));
            //	cmdGetServiceCharge.Parameters.Add(new SqlParameter("@RequestTypeID", SqlDbType.Int));
            cmdGetServiceCharge.Parameters.Add(new SqlParameter("@ClientID", SqlDbType.Int));
            //cmdGetServiceCharge.Parameters.Add(new SqlParameter("@Account", SqlDbType.NVarChar));
            cmdGetServiceCharge.Parameters.Add(new SqlParameter("@OrgINN", SqlDbType.NVarChar));
            cmdGetServiceCharge.Parameters.Add(new SqlParameter("@ServiceCharge", SqlDbType.Float));
            cmdGetServiceCharge.Parameters["@ServiceCharge"].Direction = ParameterDirection.Output;
            if (rwRequest.RequestTypeID != 1)
            {
                return;
            }
            cmdGetServiceCharge.Parameters["@ClientID"].Value = rwRequest.ClientID;
            //cmdGetServiceCharge.Parameters["@Account"].Value = rwRequest.AccountTo;
            cmdGetServiceCharge.Parameters["@OrgINN"].Value = rwRequest.OrgToINN;
            App.Connection.Open();
            try
            {
                cmdGetServiceCharge.ExecuteNonQuery();
                object o = cmdGetServiceCharge.Parameters["@ServiceCharge"].Value;
                if ((o != Convert.DBNull) && (Convert.ToDouble(o) != -1d))
                {
                    this.tbvPercent.dValue = Convert.ToDouble(o);
                }
            }
            catch (Exception ex)
            {
                AM_Controls.MsgBoxX.Show(ex.Message, "BPS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            finally
            {
                App.Connection.Close();
            }
        }