Exemplo n.º 1
0
 public void InitialiseProcessPaymentView(Account account, string packNumber, string paymentOrderNumber, System.DateTime paymentOrderDate, Organization agent, string barcode, POSView posView, CashPaymentOrderType cashPaymentOrderType, int subService, long paymentOrderPackId)
 {
     this.m_BarcodeInfo = new AIS.SN.Model.DomainObjects.BarcodeInfo();
     this.m_Account = account;
     this.m_PackNumber = packNumber;
     this.m_OrderNumber = paymentOrderNumber;
     this.m_OrderDate = paymentOrderDate;
     this.m_Agent = agent;
     this.m_CashPaymentOrderType = (int) cashPaymentOrderType;
     this.m_subService = subService;
     this.m_PaymentOrderPackId = paymentOrderPackId;
     if (this.m_Agent == Organization.Null)
     {
         User currentUser = User.GetCurrentUser();
         if (currentUser.OrgId != Organization.Null.Id)
         {
             Organization org = currentUser.GetOrg();
             if (org.ParentId != Organization.Null.Id)
             {
                 this.m_Agent = org.GetParent();
             }
             else
             {
                 this.m_Agent = org;
             }
         }
     }
     this.m_BarCode = barcode;
     this.m_posView = posView;
 }
Exemplo n.º 2
0
 public static BarcodeInfo ParseBarcode(string barcode, byte parseAlgorithm)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[2];
     parameters[0] = new System.Data.SqlClient.SqlParameter("@barcode", System.Data.SqlDbType.VarChar);
     parameters[0].set_Value(barcode);
     parameters[1] = new System.Data.SqlClient.SqlParameter("@alg", System.Data.SqlDbType.TinyInt);
     parameters[1].set_Value((byte) parseAlgorithm);
     string sql = "SELECT apartmentNumber ,\r\n\t\t                  accountNumber ,\r\n\t\t                  paymentSumm ,\r\n\t\t                  period, \r\n                          errorMsg \r\n                        FROM [sn].[ParseBarcode] (@barcode, @alg)";
     System.Data.DataTable table = DALSql.ExecuteDataTable(sql, parameters);
     BarcodeInfo info = new BarcodeInfo();
     if (table.Rows.get_Count() > 0)
     {
         if (!table.Rows.get_Item(0).IsNull("errorMsg"))
         {
             info.ErrorMsg = (string) (table.Rows.get_Item(0).get_Item("errorMsg") as string);
         }
         if (!table.Rows.get_Item(0).IsNull("accountNumber"))
         {
             info.AccountNumber = (string) (table.Rows.get_Item(0).get_Item("accountNumber") as string);
         }
         if (!table.Rows.get_Item(0).IsNull("apartmentNumber"))
         {
             info.ApartmentNumber = (string) (table.Rows.get_Item(0).get_Item("apartmentNumber") as string);
         }
         if (!table.Rows.get_Item(0).IsNull("paymentSumm"))
         {
             info.PaymentSumm = new decimal?((decimal) table.Rows.get_Item(0).get_Item("paymentSumm"));
         }
         if (!table.Rows.get_Item(0).IsNull("period"))
         {
             info.Period = new System.DateTime?((System.DateTime) table.Rows.get_Item(0).get_Item("period"));
         }
     }
     return info;
 }