private void CreateUpdateSalesArea(SalesArea s)
 {
     SqlService sql = new SqlService(_sqlConnection);
     if (s.Id != null)
         sql.AddParameter("@pId", System.Data.SqlDbType.UniqueIdentifier, s.Id);
     sql.AddParameter("@pSalesAreaName", System.Data.SqlDbType.VarChar, s.SalesAreaName);
     sql.AddParameter("@pOrderCode", System.Data.SqlDbType.VarChar, s.OrderCode);
     sql.ExecuteSP("ICMS_spCreateUpdateSalesArea");
 }
 public SalesArea GetSalesArea(Guid id)
 {
     SalesArea s = new SalesArea();
     SqlService sql = new SqlService(_sqlConnection);
     sql.AddParameter("@pId", System.Data.SqlDbType.UniqueIdentifier, id);
     using (SqlDataReader r = sql.ExecuteSPReader("ICMS_spGetSalesAreas"))
     {
         if (r.HasRows)
         {
             while (r.Read())
             {
                 SetupSalesArea(s, r);
             }
         }
     }
     return s;
 }
 private void SetupSalesArea(SalesArea s, SqlDataReader r)
 {
     s.Id = r.SafeGetGuid(r.GetOrdinal("Id"));
     s.OrderCode = r.SafeGetString(r.GetOrdinal("OrderCode"));
     s.SalesAreaName = r.SafeGetString(r.GetOrdinal("SalesArea"));
 }
 public void UpdateSalesArea(SalesArea s)
 {
     CreateUpdateSalesArea(s);
 }